chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] patch: Always build in host mode unless cross-compilin


From: Kristian Lein-Mathisen
Subject: [Chicken-hackers] patch: Always build in host mode unless cross-compiling
Date: Thu, 26 Apr 2018 23:25:07 +0200


Hi all,


I'm trying to solve this problem: I have a built chicken with a 5 suffix. When I compile with csc5, it fails:

2314 address@hidden /t/bar  ➤ cat bar.scm
(print "test")
2317 address@hidden /t/bar  ➤ csc5 -v bar.scm 
'/usr/bin/chicken5' 'bar.scm' -output-file 'bar.c' -verbose
'gcc' 'bar.c' -o 'bar.o' -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer -I/usr/include/chicken
bar.c:8:10: fatal error: chicken.h: No such file or directory
 #include "chicken.h"
          ^~~~~~~~~~~
compilation terminated.

Error: shell command terminated with non-zero exit status 256: 'gcc' 'bar.c' -o 'bar.o' -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer -I/usr/include/chicken

It fails because C_TARGET_INCLUDE_HOME is "$(TARGET_PREFIX)/include/chicken", which doesn't contain the 5 suffix.

Invoking csc with -host makes the problem disappear. That's why this problem didn't pop up before, as chicken-install always issues csc with -host. 

Felix says the C_TARGET_ are correct: they should not contain suffix/prefix because those are intended for the build machine (the host binaries gets the arm- prefix, for example, not the target binaries).

This patch essentially adds the "-host" parameter on by default whenever you're compiling with a non cross-chicken.

K.

Attachment: 0002-Always-build-in-host-mode-unless-cross-compiling.patch
Description: Text Data


reply via email to

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