tor: link with libatomic when needed
PATCH 1/1 tor: link with libatomic when needed
Following errors might occur on architectures required to use gcc libatomics:
sparc-buildroot-linux-uclibc/sysroot/lib/libatomic.so.1: error adding
symbols: DSO missing from command line
This is often the case for sparcv8 32 bit toolchains.
See d28591a2ee39704f6795c8aa1d0a3db7e909facc,55a9d6d55888b04ec6c476399e5b98a2412995f5 and03f6e005e6a9617767b24a9026da9477848020cc.
Fixes:
- http://autobuild.buildroot.net/results/0f7107d0b703223f567c6749722bc82c81a04d54
--- package/tor/tor.mk | 4 ++++ 1 file changed, 4 insertions(+)
package/tor/tor.mk +4 -0
@@ -47,6 +47,10 @@ endif # uses gnu extensions TOR_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99' +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +TOR_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -latomic" +endif + define TOR_INSTALL_CONF $(INSTALL) -D -m 644 $(@D)/src/config/torrc.minimal \ $(TARGET_DIR)/etc/tor/torrc
Signature · 1 line
2.14.1
PATCH 1/1 tor: link with libatomic when needed
Hello,
Quoted 2 lines · Fabrice Fontaine
Following errors might occur on architectures required to use gcc libatomics:
"Might occur" is a bit imprecise. Some architectures have atomic builtins implemented in libatomic, on such architectures, linking with libatomic is mandatory.
package/tor/tor.mk endif · line 51
Quoted 10 lines
package/tor/tor.mk +2
-0@@ -47,6 +47,10 @@ endif # uses gnu extensions TOR_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99' +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +TOR_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -latomic"
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
So, using LIBS is more correct than LDFLAGS.
I've adjusted the commit log, and changed LDFLAGS to LIBS, and applied. Thanks!
However, it would be nicer to have a solution in the upstream configure script for this.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com