[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] Questions about cross-compiling Chicken
From: |
Felix |
Subject: |
Re: [Chicken-hackers] Questions about cross-compiling Chicken |
Date: |
Fri, 15 Feb 2013 11:38:27 +0100 (CET) |
> The "Cross development" chapter in the manual
> (http://wiki.call-cc.org/man/4/Cross%20development) suggests the
> following command line to build Chicken for the target machine:
>
> make ARCH= \
> PREFIX=/usr \
> PLATFORM=linux \
> HOSTSYSTEM=arm-none-linux-gnueabi \
> DESTDIR=$HOME/target \
> TARGET_FEATURES="-no-feature x86 -feature arm" \
> install
>
> Some questions:
>
> 1. Shouldn't ARCH be set with the target platform instead of set empty?
Possibly, yes. It is important not to assume the host system's ARCH,
so it must be overridden.
>
> If it is empty, I suppose apply-hack won't be applied, even if it is
> supported on the target platform. Is it right? If so, wouldn't it be
> better to provide a value for ARCH?
Yes, I think so.
>
>
> 2. On TARGET_FEATURES="-no-feature x86 -feature arm"
>
> If I understand the hardware-related feature correctly, it is set
> according to `machine-type', which is determined (in chicken.h --
> C_MACHINE_TYPE) based on constants defined by the toolchain header
> files. Since we provide HOSTSYSTEM, and C_COMPILER gets its value based
> on that (i.e., the toolchain has been selected), is it necessary to
> explicitly set TARGET_FEATURES?
The host-system will have features defined for the host architecture.
If you have compile-time expressions like
(cond-expand (x86 ...) ...)
they will be selected for the system that you are cross-building on,
not for the target. Well, I think so. It is all very confusing. :-)
cheers,
felix