Opened 6 years ago

Closed 6 years ago

#1429 closed defect (fixed)

"make check" requires installing first

Reported by: sjamaan Owned by:
Priority: major Milestone: 5.0
Component: compiler Version: 4.12.0
Keywords: csc, static linking Cc:
Estimated difficulty: medium

Description

When running "make check" while not having CHICKEN installed yet will, it will fail because we're referring directly to libchicken.a under the installation prefix's library dir.

This is wrong in two ways: firstly, this means you can't run make check without installing first. Secondly, this means we're not testing the runtime of the CHICKEN being built, but that the CHICKEN which was previously installed to the same prefix.

$ rm -rf /home/sjamaan/chickens/chicken-5
$ make check PREFIX=/home/sjamaan/chickens/chicken-5 CHICKEN=/home/sjamaan/chickens/chicken-5-dbg/bin/chicken PLATFORM=linux
... lots of stuff elided...
======================================== linking tests ...
/home/sjamaan/src/chicken-core/tests/../chicken 'reverser/tags/1.0/reverser.scm' -output-file 'reverser.c' -verbose -include-path /home/sjamaan/src/chicken-core/tests/.. -unit reverser -emit-all-import-libraries
generating import library `reverser.import.scm' for module `reverser' ...
'gcc' 'reverser.c' -o 'reverser.o' -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer -I/home/sjamaan/src/chicken-core/tests/.. -I/home/sjamaan/chickens/chicken-5/include/chicken
rm reverser.c
/home/sjamaan/src/chicken-core/tests/../chicken 'linking-tests.scm' -output-file 'a.c' -verbose -include-path /home/sjamaan/src/chicken-core/tests/.. -uses reverser
'gcc' 'a.c' -o 'a.o' -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer -I/home/sjamaan/src/chicken-core/tests/.. -I/home/sjamaan/chickens/chicken-5/include/chicken
rm a.c
'gcc' 'reverser.o' 'a.o' -o 'a.out' -L/home/sjamaan/src/chicken-core/tests/.. -L/home/sjamaan/chickens/chicken-5/lib  -Wl,-R'/home/sjamaan/chickens/chicken-5/lib' -lchicken -lm -ldl
rm a.o
/home/sjamaan/src/chicken-core/tests/../chicken 'linking-tests.scm' -output-file 'a.c' -static -verbose -include-path /home/sjamaan/src/chicken-core/tests/.. -uses reverser -emit-link-file a.link
'gcc' 'a.c' -o 'a.o' -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer -I/home/sjamaan/src/chicken-core/tests/.. -I/home/sjamaan/chickens/chicken-5/include/chicken
rm a.c
'gcc' 'reverser.o' 'a.o' -o 'a.out' -L/home/sjamaan/src/chicken-core/tests/.. -L/home/sjamaan/chickens/chicken-5/lib  -Wl,-R'/home/sjamaan/chickens/chicken-5/lib' /home/sjamaan/chickens/chicken-5/lib/libchicken.a -lm -ldl
gcc: error: /home/sjamaan/chickens/chicken-5/lib/libchicken.a: No such file or directory

Error: shell command terminated with non-zero exit status 256: 'gcc' 'reverser.o' 'a.o' -o 'a.out' -L/home/sjamaan/src/chicken-core/tests/.. -L/home/sjamaan/chickens/chicken-5/lib  -Wl,-R'/home/sjamaan/chickens/chicken-5/lib' /home/sjamaan/chickens/chicken-5/lib/libchicken.a -lm -ldl
rules.make:993: recipe for target 'check' failed
make: *** [check] Error 1

I'm not sure what the correct fix would be for this. Currently the location really is hardcoded. I think we should be able to somehow rely on gcc's library path when linking, but simply saying -lchicken makes it dynamically linked.

Maybe we need an extra environment variable through which we can tell it where to find libraries, which when not specified falls back to the built-in PREFIX libdir?

Change History (1)

comment:1 Changed 6 years ago by evhan

Resolution: fixed
Status: newclosed

Fixed with 7d892447.

Note: See TracTickets for help on using tickets.