Link against libgcc and libc to avoid unresolved symbols
authorGuillem Jover <guillem@debian.org>
Tue, 26 Feb 2019 04:26:21 +0000 (04:26 +0000)
committerGuillem Jover <guillem@debian.org>
Tue, 26 Feb 2019 04:26:21 +0000 (04:26 +0000)
Origin: vendor
Bug-Debian: 764509
Forwarded: no
Last-Update: 2014-10-09

We need to link agaisnt -lgcc, on at least hppa. We also need to link
against -lc, because we are now always using the syscall() libc function.
So let's stop passing -nostdlib and -nostartfiles.

Note: we used to use -Wl,--as-needed, this way we made sure we pulled the
required fortified functions from the internal libc_nonshared.a, but did
not link against the shared library because we did not use any of its
symbols.

Gbp-Pq: Name 01_link_libs.patch

src/Makefile

index b437945f7c4fc47c4a8435d7f5a4b51031dedabe..37ae219a83c0c72390804a6126324eaede8d652e 100644 (file)
@@ -3,7 +3,7 @@ includedir=$(prefix)/include
 libdir=$(prefix)/lib
 
 CFLAGS ?= -g -fomit-frame-pointer -O2
-CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
+CFLAGS += -Wall -I. -fPIC
 SO_CFLAGS=-shared $(CFLAGS)
 L_CFLAGS=$(CFLAGS)
 LINK_FLAGS=