Opened 10 years ago

Closed 2 years ago

#1196 closed defect (worksforme)

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

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.

Change History (2)

comment:1 Changed 8 years ago by sjamaan

Estimated difficulty: medium

comment:2 Changed 2 years ago by felix winkelmann

Resolution: worksforme
Status: newclosed

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.

Note: See TracTickets for help on using tickets.