Skip to contentSkip to conversation

ibrdtn-tools: fix linking problem when building statically

PATCH New Vicente Olivert Riera 2 participants 2 messages Sep 10, 2015 – Oct 4, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ibrdtn-tools: fix linking problem when building statically

The problem looks like this:

/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr//lib/librt.a(timer_routines.os):
In function `__start_helper_thread':
timer_routines.c:(.text+0x2f4): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status

Adding -pthread to LDFLAGS fixes the problem.

Fixes:

http://autobuild.buildroot.net/results/a87/a87a764d3a28f835ed8645923594f7023a662ae8/

---
 package/ibrdtn-tools/ibrdtn-tools.mk |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
package/ibrdtn-tools/ibrdtn-tools.mk +4 -0
index c9a585d..ca26c8a 100644
@@ -10,6 +10,10 @@ IBRDTN_TOOLS_LICENSE = Apache-2.0
 IBRDTN_TOOLS_LICENSE_FILES = COPYING
 IBRDTN_TOOLS_DEPENDENCIES = ibrcommon ibrdtn host-pkgconf
 
+ifeq ($(BR2_STATIC_LIBS),y)
+IBRDTN_TOOLS_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -pthread"
+endif
+
 ifeq ($(BR2_PACKAGE_LIBDAEMON),y)
 IBRDTN_TOOLS_CONF_OPTS += --with-libdaemon
 IBRDTN_TOOLS_DEPENDENCIES += libdaemon
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 ibrdtn-tools: fix linking problem when building statically

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vicente" == Vicente Olivert Riera <[email protected]> writes:

The problem looks like this:
/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr//lib/librt.a(timer_routines.os):
In function `__start_helper_thread':
timer_routines.c:(.text+0x2f4): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status

Quoted 7 lines

Adding -pthread to LDFLAGS fixes the problem.

Fixes:

http://autobuild.buildroot.net/results/a87/a87a764d3a28f835ed8645923594f7023a662ae8/

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard