Skip to content

Fix loongarch64 atomic build error#20

Open
zhaixiaojuan wants to merge 1 commit intopal-robotics:humble-develfrom
zhaixiaojuan:loongarch64
Open

Fix loongarch64 atomic build error#20
zhaixiaojuan wants to merge 1 commit intopal-robotics:humble-develfrom
zhaixiaojuan:loongarch64

Conversation

@zhaixiaojuan
Copy link
Copy Markdown

Dear maintainer,
The LoongArch architecture (LoongArch) is an Instruction Set Architecture (ISA) that has a RISC style.
Documentations:
ISA:
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
ABI:
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
More docs can be found at:
https://loongson.github.io/LoongArch-Documentation/README-EN.html

When I execute the following command on a loongarch64 debian environment:

PKG_CONFIG=/usr/bin/pkg-config cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/loongarch64-linux-gnu -DCMAKE_INSTALL_PREFIX=/opt/ros/jazzy -DAMENT_PREFIX_PATH=/opt/ros/jazzy -DCMAKE_PREFIX_PATH=/opt/ros/jazzy
make -j1 VERBOSE=1

I get an error:

[100%] Linking CXX executable pal_statistics-test
/usr/bin/cmake -E cmake_link_script CMakeFiles/pal_statistics-test.dir/link.txt --verbose=1
/usr/bin/ld: libpal_statistics.so: undefined reference to `__atomic_store_16'      
/usr/bin/ld: libpal_statistics.so: undefined reference to `__atomic_load_16'    
/usr/bin/ld: libpal_statistics.so: undefined reference to `__atomic_compare_exchange_16'  

I submitted a fix for the above problem and completed the test verification locally.

@zhaixiaojuan
Copy link
Copy Markdown
Author

Hi, is there any latest progress on this PR?

@kimdoyoung0319
Copy link
Copy Markdown

A build for RISC-V suffers with same problem. It would be nice to link libatomic for both loongarch and RISC-V (if it is merged).

@christophfroehlich
Copy link
Copy Markdown
Contributor

@saikishor 👀

@saikishor
Copy link
Copy Markdown
Member

Hello!

I completely missed this one. We will try to take a look at this, Thanks for reporting

@saikishor
Copy link
Copy Markdown
Member

@zhaixiaojuan Can you test @mathias-luedtke's fix in the branch https://github.com/pal-robotics/pal_statistics/tree/fix/link-atomic

Let us know if it works for you

@zhaixiaojuan
Copy link
Copy Markdown
Author

@saikishor

Let us know if it works for you

Okay, I'll test it now.

@saikishor
Copy link
Copy Markdown
Member

@zhaixiaojuan Thank you!

@zhaixiaojuan
Copy link
Copy Markdown
Author

Hi, @saikishor
Great, I tested it locally and it solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants