Re: [hatari-devel] mingw-w64 |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] mingw-w64
- From: Christer Solskogen <christer.solskogen@xxxxxxxxx>
- Date: Thu, 26 Sep 2013 12:26:00 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=XiFlEAMA+z5E33pJN1JfwtGbQYzMsSMMWw+g2/CJVaE=; b=0Ro90Ako9rCpNWV4KLTFFF9J5T+bxmh2wSa06vHwK89OTFcuNI7eND99gQvd9CTjN/ CRaxCP+r/5lrKXKp/n1HUchYVyhy9aOU+eFqSCFZVe1qrF5KGAqb1hjgZpRqTeZyn2Nd jzK3DCUJJK4P/Gid1MqaWAQHx4lmf/3JYibxMjI5Y3cXg6A2ezQCDwX6avGiY9YZenmT mFwb09ItJ+o9/VmK8RHW3gnSgTJO4qLn3jYrFXxb6cr2HSg4aLbbUtO8gfE70za+IeaH 7E1ChToYiW7T9E/qQOyL22SV6pQBQr1meGDqEU888jFMPaHxT6xTAJ4+T2kgyv1KHwn1 a6KA==
On Thu, Sep 26, 2013 at 11:23 AM, Nicolas Pomarède
<npomarede@xxxxxxxxxxxx> wrote:
> On 26/09/2013 11:06, Christer Solskogen wrote:
>>
>> On Thu, Sep 26, 2013 at 12:07 AM, Nicolas Pomarède
>> <npomarede@xxxxxxxxxxxx> wrote:
>>
>>> I changed Toolchain-mingw32.cmake a little to allow changing the mingw's
>>> values using cmake -D parameters, instead of editing the file.
>>>
>>> In your case, you would use for example :
>>> -DMINGW_EXE_PREFIX=x86_64-w64-mingw32 -DMINGW_ROOT_PATH=i686-w64-mingw32
>>>
>>
>> Cool, but I think you only need to set one variable. The system should
>> be able to figure out the rest it self.
>> I mean, the setting over is meaningless since it will use a 64bit
>> compiler with a sysroot that contains 32bit libraries.
>>
>
> I don't see how the system can find MINGW_ROOT_PATH ; in my case and in most
> distribs it's "mingws", in your case it's i686-w64-mingw32. We can maintain
> a list of all possible directory variations that go under "sysroot/". Patch
> welcome if you have one.
>
The compiler does. If you use for instance have #include <SDL/SDL.h>
in your source file, the cross compiler will *not* use the one in
/usr/include, but will instead use the one that is located in
$SYSROOT.
If you compile a cross compiler without the --with-sysroot option, it
will default to ${gcc_tooldir}/sys-root (which in most distributions
will mean /usr/x86_64-w64-mingw32/sys-root)
My point is that the compiler knows where the sysroot are. You don't
have to tell the compiler, linker or make-system anything unless the
sys-root is somewhere else that gcc was initially configured with.
I don't rely on my distribution for the cross compiler, since I
compile that myself (I follow mingw-w64 a lot). And since I configure
gcc with a path and sysroot that is relative to each other, "my" cross
compiler is relocatable. And by that means that it does not care if it
is placed in /opt or $HOME. It will still find the correct headers and
libraries.
> /usr/i586-pc-mingw32/sys-root/mingw/
> or /usr/i686-w64-mingw32/sys-root/mingw
> or /usr/x86_64-w64-mingw32/sys-root/mingw
>
> I wouldn't go as far as to say that all distribs are wrong :)
>
I would. But also note that they do not compile gcc with
--with-sysroot. Also their compilers don't need to be relocateable.
> Also, Hatari build system should try to accomodate to what most distribs
> provide to ease compilation and inclusion of Hatari in such distribs
> (especially when they all provide the same directory hierarchy in that
> case). More advanced users who use their own tools will have no problem
> adjusting their settings.
>
I agree. But it is possible to accommodate both ways by doing it right
the first time :-)
--
chs,