Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `__sync_synchronize' #112

Open
pdl0x0lbq opened this issue Aug 8, 2023 · 4 comments
Open

undefined reference to `__sync_synchronize' #112

pdl0x0lbq opened this issue Aug 8, 2023 · 4 comments

Comments

@pdl0x0lbq
Copy link

pdl0x0lbq commented Aug 8, 2023

Hi,

I Get this error:
opt/st/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.linux64_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/ros/CLionProjects/csmr/micro_ros_stm32cubemx_utils/microros_static_library_ide/libmicroros/libmicroros.a(librcutils-atomic_64bits.c.obj): in function `unlock_memory':
atomic_64bits.c:(.text+0xa0): undefined reference to `__sync_synchronize'
/opt/st/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.linux64_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/ros/CLionProjects/csmr/micro_ros_stm32cubemx_utils/microros_static_library_ide/libmicroros/libmicroros.a(librcutils-atomic_64bits.c.obj): in function `__atomic_load_8':
atomic_64bits.c:(.text+0x11c): undefined reference to `__sync_synchronize'
/opt/st/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.linux64_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/ros/CLionProjects/csmr/micro_ros_stm32cubemx_utils/microros_static_library_ide/libmicroros/libmicroros.a(librcutils-atomic_64bits.c.obj): in function `__atomic_store_8':
atomic_64bits.c:(.text+0x198): undefined reference to `__sync_synchronize'
/opt/st/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.linux64_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/ros/CLionProjects/csmr/micro_ros_stm32cubemx_utils/microros_static_library_ide/libmicroros/libmicroros.a(librcutils-atomic_64bits.c.obj): in function `__atomic_exchange_8':
atomic_64bits.c:(.text+0x214): undefined reference to `__sync_synchronize'
/opt/st/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.linux64_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/ros/CLionProjects/csmr/micro_ros_stm32cubemx_utils/microros_static_library_ide/libmicroros/libmicroros.a(librcutils-atomic_64bits.c.obj): in function `__atomic_fetch_add_8':
atomic_64bits.c:(.text+0x2a8): undefined reference to `__sync_synchronize'

How to resolve this error

@pdl0x0lbq
Copy link
Author

@pdl0x0lbq
Copy link
Author

You can disable building atomic_64bits.c file here: https://github.com/micro-ROS/micro_ros_stm32cubemx_utils/blob/3819f6819cee1ff01c3da58ecbc8bfcbf4b0a2a5/microros_static_library_ide/library_generation/colcon.meta#L26C19-L26C40

Another error occurred
/opt/st/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.linux64_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/ros/CLionProjects/csmr/micro_ros_stm32cubemx_utils/microros_static_library_ide/libmicroros/libmicroros.a(librcl-time.c.obj): in function rcl_get_ros_time':
time.c:(.text.rcl_get_ros_time+0xa): undefined reference to __atomic_load_8'

@pablogs9
Copy link
Member

pablogs9 commented Aug 8, 2023

That is the point that you need to have 64 bits atomics in your platform to use micro-ROS. If your native platform does not implement them nor is able to build the provided ones, you need to provide an implementation of __atomic_load_8

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

No branches or pull requests

2 participants