Link against libgcc and libc to avoid unresolved symbols
authorGuillem Jover <guillem@debian.org>
Tue, 31 May 2016 18:38:08 +0000 (19:38 +0100)
committerGuillem Jover <guillem@debian.org>
Tue, 31 May 2016 18:38:08 +0000 (19:38 +0100)
Origin: vendor
Bug-Debian: 764509
Forwarded: no
Last-Update: 2014-10-09

We need to link agaisnt -lgcc, on at least hppa.

We also link against -lc and -Wl,--as-needed, this way we pull the
required fortified functions from the internal libc_nonshared.a, but
do not link against the shared library because we do not use any of
its symbols.

Gbp-Pq: Name 01_link_libs.patch

src/Makefile

index eadb336b47e364735430bfa9aca5e4214067050d..ecf5bf8d7147d60549217786f062e2e5f47df3c0 100644 (file)
@@ -6,7 +6,7 @@ CFLAGS ?= -g -fomit-frame-pointer -O2
 CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
 SO_CFLAGS=-shared $(CFLAGS)
 L_CFLAGS=$(CFLAGS)
-LINK_FLAGS=
+LINK_FLAGS=-Wl,--as-needed -lgcc -lc
 LINK_FLAGS+=$(LDFLAGS)
 
 soname=libaio.so.1