git » libfiu » commit e2a7a5a

tests/collisions: Reorder cc command line to fix compile errors

author Alberto Bertogli
2015-08-14 22:24:29 UTC
committer Alberto Bertogli
2015-08-14 22:26:21 UTC
parent 5084cd7cc2cd8cf3742a201e4554d522ad66758e

tests/collisions: Reorder cc command line to fix compile errors

In Ubuntu's gcc 4.9.2-10ubuntu13 we get the following errors when building the
tests:

$ cc -I../../libfiu/ -L../../libfiu/ -L./ -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -fPIC -DFIU_ENABLE=1 -std=c99 -pedantic -Wall -rdynamic -L.  -lfiu -lcoltest binary.c -o binary
/tmp/ccoma62o.o: In function `main':
binary.c:(.text+0x22): undefined reference to `called_wtable_get'
binary.c:(.text+0x2f): undefined reference to `called_wtable_get'
binary.c:(.text+0x53): undefined reference to `wtable_get'
binary.c:(.text+0x5a): undefined reference to `called_wtable_get'
binary.c:(.text+0x68): undefined reference to `called_wtable_get'
collect2: error: ld returned 1 exit status

Reordering the command line fixes this, as the symbols now get processed in
the right order.

tests/collisions/Makefile +1 -1

diff --git a/tests/collisions/Makefile b/tests/collisions/Makefile
index 0192572..0292d84 100644
--- a/tests/collisions/Makefile
+++ b/tests/collisions/Makefile
@@ -44,7 +44,7 @@ libcoltest.so: libcoltest.c libcoltest.h
 	$(NICE_CC) $(ALL_CFLAGS) -shared -fPIC $< -o $@
 
 binary: binary.c libcoltest.so
-	$(NICE_CC) $(ALL_CFLAGS) -L. -lfiu -lcoltest $< -o $@
+	$(NICE_CC) $(ALL_CFLAGS) -L. $< -lfiu -lcoltest -o $@
 
 
 tests: binary