[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] Questions about cross-compiling Chicken
From: |
Mario Domenech Goulart |
Subject: |
Re: [Chicken-hackers] Questions about cross-compiling Chicken |
Date: |
Fri, 15 Feb 2013 11:21:20 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
On Fri, 15 Feb 2013 11:18:49 -0500 Mario Domenech Goulart <address@hidden>
wrote:
> On Fri, 15 Feb 2013 11:38:27 +0100 (CET) Felix <address@hidden> wrote:
>
>>> 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.
>
> Ok. Thanks. I'm gonna update the documentation accordingly.
>
>
>>> 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. :-)
>
> In this case, shouldn't TARGET_FEATURES be passed to the cross chicken?
> By cross chicken I mean the chicken that runs on the host, but generates
> native code for the target system using the cross C compiler.
>
> If I understand correctly, the chicken we build for the target gets its
> features correctly set,
... even if we don't explicitly set TARGET_FEATURES, ...
> since chicken.h will try match against constants defined in the header
> files of the cross-toolchain (e.g., if __arm__ is defined somewhere in
> the cross-toolchain headers, C_MACHINE_TYPE would get set as "arm").
Best wishes.
Mario
--
http://parenteses.org/mario