Opened 2 years ago

Last modified 13 months ago

#1196 new defect

Static compilation doesn't respect $LIBDIR.

Reported by: evhan Owned by:
Priority: major Milestone: someday
Component: build system Version: 4.9.x
Keywords: Cc:
Estimated difficulty: medium


Reported by Enigmatic_Fellow in #chicken.

After building CHICKEN with a nonstandard $LIBDIR:

# CHICKEN built with LIBDIR=/usr/local/lib64
$ csc -verbose foo.scm                                                                                                                            
'/usr/local/bin/chicken' 'foo.scm' -output-file 'foo.c' -verbose
'gcc-4.6' 'foo.c' -o 'foo.o' -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -g -Wall -Wno-unused -I"/usr/local/include/chicken"
rm foo.c
'gcc-4.6' 'foo.o' -o 'foo' -L"/usr/local/lib"  -Wl,-R"/usr/local/lib" -lchicken -lm -ldl
rm foo.o
$ csc -static -verbose foo.scm                                                                                                                             
'/usr/local/bin/chicken' 'foo.scm' -output-file 'foo.c' -feature chicken-compile-static -verbose
'gcc-4.6' 'foo.c' -o 'foo.o' -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -g -Wall -Wno-unused -I"/usr/local/include/chicken"
rm foo.c
'gcc-4.6' 'foo.o' -o 'foo' -L"/usr/local/lib"  -Wl,-R"/usr/local/lib" -static '/usr/local/lib/libchicken.a' -lm -ldl
gcc-4.6: error: /usr/local/lib/libchicken.a: No such file or directory

Error: shell command terminated with non-zero exit status 256: 'gcc-4.6' 'foo.o' -o 'foo' -L"/usr/local/lib"  -Wl,-R"/usr/local/lib" -static '/usr/local/lib/libchicken.a' -lm -ldl

It seems the compiler passes -static '/usr/local/lib/libchicken.a' but should use '/usr/local/lib64/libchicken.a' instead.

Change History (1)

comment:1 Changed 13 months ago by sjamaan

  • Estimated difficulty set to medium
Note: See TracTickets for help on using tickets.