mirror of
https://github.com/wolfcw/libfaketime.git
synced 2026-05-17 08:36:28 +03:00
Fix link order for --as-needed (see http://bugs.debian.org/711958)
In Ubuntu, the attached patch was applied to achieve the following: * as-needed.patch: Fix object/library link order for --as-needed. When building with --as-needed, libraries need to be listed on the link line after the objects that reference them. In the autotools world (and elsewhere), the LDFLAGS variable has been split into LDFLAGS and LDADD to represent the need to list libs last. This patch makes that change to your Makefile, so this builds correctly with --as-needed in LDFLAGS.
This commit is contained in:
@@ -53,7 +53,8 @@ INSTALL ?= install
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
CFLAGS += -std=gnu99 -Wall -DFAKE_STAT -DFAKE_INTERNAL_CALLS -fPIC -DPOSIX_REALTIME -DLIMITEDFAKING -DSPAWNSUPPORT
|
||||
LDFLAGS += -shared -ldl -lm -lpthread
|
||||
LDFLAGS += -shared
|
||||
LDADD += -ldl -lm -lpthread
|
||||
|
||||
SRC = faketime.c
|
||||
OBJ = faketime.o faketimeMT.o
|
||||
@@ -69,7 +70,7 @@ ${OBJ}: faketime.c
|
||||
${CC} -o $@ -c ${CFLAGS} ${EXTRA_FLAGS} $<
|
||||
|
||||
lib%.so.${SONAME}: %.o
|
||||
${CC} -o $@ -Wl,-soname,$@ $< ${LDFLAGS}
|
||||
${CC} -o $@ -Wl,-soname,$@ ${LDFLAGS} $< ${LDADD}
|
||||
|
||||
clean:
|
||||
@rm -f ${OBJ} ${LIBS}
|
||||
|
||||
Reference in New Issue
Block a user