Summary

Static compilation doesn't respect $LIBDIR.

Metadata

Description

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.

Changes and comments

[2016-08-25 21:42:38 UTC] sjamaan set difficulty to medium

[2022-10-31 11:37:52 UTC] felix changed status from new to closed

[2022-10-31 11:37:52 UTC] felix set resolution to worksforme

[2022-10-31 11:37:52 UTC] felix wrote:

In CHICKEN 5 the distinction between target and host libdir (which seems to be the root of this problem) has changed. I can't reproduce the problem with a changed LIBDIR with the new behaviour.