GNU bug report logs -
#54239
[PATCH] gnu: Add cross-clang.
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Julien Lepiller <julien <at> lepiller.eu> writes:
> Le Fri, 04 Mar 2022 19:34:07 +0000,
> Pierre Langlois <pierre.langlois <at> gmx.com> a écrit :
>
>> Hi Julien,
>>
>> Julien Lepiller <julien <at> lepiller.eu> writes:
>>
>> > * gnu/packages/llvm.scm (cross-llvm): New variable.
>>
>> Do you really need to define a cross package for LLVM? In my
>> experience it was possible to use the same llvm libraries for native
>> and cross compilation. By default LLVM builds support for all
>> supported targets (provided they are not "experimental" IIRC).
>
> No, I don't think it's required. I only need it so I can define a
> default target that's different from the host.
>
>>
>> Whereas for the clang package, at the moment it does have to be built
>> for a specific target IIUC. I hope that one day we could have the same
>> clang for native and cross compilation in Guix, but I don't think it
>> can work without some serious re-design of how cross-compilation
>> works. I've been trying to think about it but I don't yet have a good
>> understanding of it.
>
> You can use --target to control which target clang builds for (although
> I don't know if our clang package can work like that). I wanted to have
> a default target though, because passing --target all the time is
> cumbersome and we would have to adjust all recipes to pass the flag.
> With the default target set appropriately, (clang-for-target) will
> always produce binaries for the correct architecture, whether
> cross-compiling or not.
>
Ah I see, that makes sense! I suppose a possible alternative could be
to define a wrapper around clang to pass the `--target=<triplet>' option
by default, but that might be a bit ugly (although we already have a
ld-wrapper).
Thanks,
Pierre
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 2 years and 329 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.