Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] tor: link with libatomic when needed
@ 2018-06-14 18:23 Fabrice Fontaine
  2018-06-17 21:01 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2018-06-14 18:23 UTC (permalink / raw)
  To: buildroot

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 and
03f6e005e6a9617767b24a9026da9477848020cc.

Fixes:
 - http://autobuild.buildroot.net/results/0f7107d0b703223f567c6749722bc82c81a04d54

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/tor/tor.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/tor/tor.mk b/package/tor/tor.mk
index f7af718b9b..fb02741d3a 100644
--- a/package/tor/tor.mk
+++ b/package/tor/tor.mk
@@ -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
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH 1/1] tor: link with libatomic when needed
  2018-06-14 18:23 [Buildroot] [PATCH 1/1] tor: link with libatomic when needed Fabrice Fontaine
@ 2018-06-17 21:01 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2018-06-17 21:01 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 14 Jun 2018 20:23:19 +0200, Fabrice Fontaine wrote:
> 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.

> diff --git a/package/tor/tor.mk b/package/tor/tor.mk
> index f7af718b9b..fb02741d3a 100644
> --- a/package/tor/tor.mk
> +++ b/package/tor/tor.mk
> @@ -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
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-17 21:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-14 18:23 [Buildroot] [PATCH 1/1] tor: link with libatomic when needed Fabrice Fontaine
2018-06-17 21:01 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox