Julien Lepiller writes: > Le Fri, 04 Mar 2022 19:34:07 +0000, > Pierre Langlois a écrit : > >> Hi Julien, >> >> Julien Lepiller 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=' option by default, but that might be a bit ugly (although we already have a ld-wrapper). Thanks, Pierre