TT#48647 Fix gcc argument order

Newer gcc versions have become more picky on their argument order, due
to the --as-needed default, and require the libraries to be linked to,
to be passed after the code/objects that use them, otherwise they will
get dropped as unused.

Change-Id: I8ace79186b0c8709ccb9cb93f51a9890ce6e1043
changes/43/36043/1
Guillem Jover 5 years ago
parent f4aeb4fcf0
commit 9ee5286c71

@ -4,12 +4,14 @@ CPPFLAGS ?=
CPPFLAGS += -DPACKAGE_VERSION="\"$(PACKAGE_VERSION)\""
CFLAGS ?= -ggdb -O2 -Wall -Wextra -Wno-unused-parameter
CFLAGS += -fPIC -ldl -fvisibility=hidden
CFLAGS += -fPIC -fvisibility=hidden
LDLIBS ?=
LDLIBS += -ldl
PLUGIN = fake-uname.so
$(PLUGIN): fake-uname.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -shared $<
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $< $(LDLIBS) -o $@ -shared
UNAME_CHECK = LD_PRELOAD="$(CURDIR)/$(PLUGIN)" uname

Loading…
Cancel
Save