From 9ee5286c716ff71a2cb0a46290c63fa58a493a11 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 10 Dec 2019 20:03:31 +0100 Subject: [PATCH] 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 --- src/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index d103a5d..a0f54ac 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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