From a5b31eab4e1f190d68d51c47dabb60b64ee471e7 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 14 May 2013 14:35:28 +0200 Subject: [PATCH] Revert "Fix (another) linker library order" This reverts commit a51ac6d9a011ba10b0be396dc1e801b2fc829651. Hrm, actually, these patches are wrong. commit 725e63c5194bfdcde0a2a3507aca156ba36cf49f for instance: "Libraries must be specified after the binary target." demo: demo.o - $(CC) -o $@ $(LIBS) $^ + $(CC) -o $@ $^ $(LIBS) the binary target here is "$@". $^ is the source file name (demo.c). this patch moves the source file name prior to the libraries, which is incorrect (ref: gcc(1)). The input files should appear last. So it breaks builds where $(LIBS) is non-empty. Signed-off-by: Mathieu Desnoyers --- doc/examples/hello-static-lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/hello-static-lib/Makefile b/doc/examples/hello-static-lib/Makefile index dd246f70..a5bf2df1 100644 --- a/doc/examples/hello-static-lib/Makefile +++ b/doc/examples/hello-static-lib/Makefile @@ -46,7 +46,7 @@ hello.o: hello.c $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< hello: hello.o lttng-ust-provider-hello.a - $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) + $(CC) -o $@ $(LDFLAGS) $(LIBS) $^ .PHONY: clean clean: -- 2.34.1