diff options
author | Göktürk Yüksek <gokturk@gentoo.org> | 2016-05-25 08:31:55 -0400 |
---|---|---|
committer | Göktürk Yüksek <gokturk@gentoo.org> | 2016-05-25 08:31:55 -0400 |
commit | 07f61719e735f932440e3300da586c873099adc6 (patch) | |
tree | f67e8425e1c7d2b0458b371499c0aed4e4e3aa70 | |
parent | 3e6402456b00e29f659baf26ced10f3d7205cf63 (diff) | |
download | imv-07f61719e735f932440e3300da586c873099adc6.tar.gz |
Fix the linking order of tests in the Makefile for --as-needed
When '--as-needed' linker flag is added to LDFLAGS, linker strips out
the symbols from the libraries needed for the tests due to the order
in which the libraries appear on the command line. List the source
files before the libraries to fix the linking issue.
For more information, see:
https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Importance_of_linking_order
Signed-off-by: Göktürk Yüksek <gokturk@gentoo.org>
-rw-r--r-- | Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -48,7 +48,7 @@ $(BUILDDIR)/%.o: src/%.c $(BUILDDIR)/test_%: test/%.c src/%.c @echo "BUILDING $@" - $(MUTE)$(CC) -o $@ -Isrc $(TFLAGS) $(LDFLAGS) -lcmocka $^ + $(MUTE)$(CC) -o $@ -Isrc $(TFLAGS) $^ $(LDFLAGS) -lcmocka check: $(BUILDDIR) $(TESTS) @echo "RUNNING TESTS" |