chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] Fix #1347 and static linking when cross-compil


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Fix #1347 and static linking when cross-compiling with customised target library name
Date: Sun, 5 Mar 2017 17:04:14 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

Hi all,

Attached is a patch to fix #1347 ("make check" fails when CHICKEN
hasn't been installed yet).

After I fixed this, I found out that the static linking tests would
also break, because csc would generate a command like

'gcc' 'test.o' -o 'test' -static /target/chicken/lib/libchicken.a -lm -ldl

The /target/chicken/lib would not exist yet (or refer to an old version
of chicken), so this would fail.  Instead, we can simply do

'gcc' 'test.o' -o 'test' -static -lchicken -lm -ldl

This works because -l is interpreted as referring to static libraries
when it follows -static.

If I'm not mistaken, static cross-compilation should also be broken
in the current situation if the target library name (TARGET_LIB_NAME)
was different from the host library name (INSTALL_LIB_NAME).

The attached patch is CHICKEN 5 only.  I can't explain why it doesn't
break on master, but it might have something to do with the many changes
in loading of units that we've made, or the difference in what modules
are available by default.

I'm assuming the cross-compilation bug exists in master as well, in
which case we might decide to fix that as well?  For now I don't think
it's that important (not many people customize the target library name?)

Cheers,
Peter

Attachment: 0001-Fix-running-of-tests-when-not-installed-1347.patch
Description: Text Data

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]