Skip to contentSkip to conversation

package/ogre: link with libatomic when needed

PATCH New Fabrice Fontaine 2 participants 3 messages Feb 10, 2020 – Mar 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/ogre: link with libatomic when needed

On some architectures, atomic binutils are provided by the libatomic library from gcc. Linking with libatomic is therefore necessary, otherwise the build fails with:

/home/test/autobuild/run/instance-1/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/8.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: ../../lib/libOgreMain.so.1.12.0: undefined reference to `__atomic_fetch_add_8'

This is often for example the case on sparc v8 32 bits.

Fixes:
- http://autobuild.buildroot.org/results/3a09e2d1d26b19243244eb7f9235c85488a788d2

---
 package/ogre/ogre.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/ogre/ogre.mk +5 -0
index f7711e41f1..253e022a73 100644
@@ -39,4 +39,9 @@ else
 OGRE_CONF_OPTS += -DOGRE_BUILD_COMPONENT_PYTHON=OFF
 endif
 
+# Uses __atomic_fetch_add_8
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+OGRE_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -latomic"
+endif
+
 $(eval $(cmake-package))
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/1 package/ogre: link with libatomic when needed

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Fabrice" == Fabrice Fontaine <[email protected]> writes:

On some architectures, atomic binutils are provided by the libatomic library from gcc. Linking with libatomic is therefore necessary, otherwise the build fails with:

/home/test/autobuild/run/instance-1/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/8.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld:
../../lib/libOgreMain.so.1.12.0: undefined reference to
`__atomic_fetch_add_8'

Quoted 6 lines

This is often for example the case on sparc v8 32 bits.

Fixes:
- http://autobuild.buildroot.org/results/3a09e2d1d26b19243244eb7f9235c85488a788d2

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 package/ogre: link with libatomic when needed

In reply to Fabrice Fontaine
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Fabrice" == Fabrice Fontaine <[email protected]> writes:

On some architectures, atomic binutils are provided by the libatomic library from gcc. Linking with libatomic is therefore necessary, otherwise the build fails with:

/home/test/autobuild/run/instance-1/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/8.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld:
../../lib/libOgreMain.so.1.12.0: undefined reference to
`__atomic_fetch_add_8'

Quoted 6 lines

This is often for example the case on sparc v8 32 bits.

Fixes:
- http://autobuild.buildroot.org/results/3a09e2d1d26b19243244eb7f9235c85488a788d2

Committed to 2019.11.x, thanks (ogre not in 2019.02.x).

Signature · 1 line
Bye, Peter Korsgaard