Currently when one attempts to install a cross-compiler bindist, one must pass --target=... to the bindist configure. Ideally the configure script would already know the target platform.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
Bizarrely, it is actually necessary to pass both --target=$tripleand--host=$triple to the bindist configure script. The latter seems to be necessary to get configure to find CC while the former is needed to find ar.
Passing --target is also necessary to get the configure script to correctly detect whether we are trying to install an x86 or aarch64 compiler on darwin (and shouldn't be necessary for the same reason).
In the distrib/configure.ac.in script we already set the bootstrap_target varible, which precisely records what the target for the compiler we are going to install is. It seems we should just set target = bootstrap_target and be done with it.
I think the correct fix is to use $TargetCPU, $TargetOS and $TargerVendor which are all set by FPTOOLS_SET_PLATFORM_VARS via FPTOOLS_OVERRIDE_PLATFORM_FROM_BOOTSTRAP.
This then means we don't ever use a raw $target_* in our configure script.
For cross-compiling it seems incorrect that FPTOOLS_OVERRIDE_PLATFORM_FROM_BOOTSTRAP sets variables like HostOS from $bootstrap_target, but I restrict my scope now for the darwin issues which seem related but not the end of the matter.
But using TargetPlatform rather than target_platform seems incorrect as $LlvmTarget is calculated from the canonical gnu triple rather than the TargetPlatform GHC triple.
It would seem to me that we should calculate the LlvmTarget from the GHC naming of platforms rather than the canonical version. That way we don't have bugs like this where we don't respect the value of bootstrap_target.
There are special cases in GHC_LLVM_TARGET which I don;t feel comfortable changing. It seems the most direct fix is to add a special case for whether bootstrap_target is set and use that instead of $target_cpu etc
I think the easiest thing to do for an immediate fix is to add bootstrap_llvm_target and use that conditionally when trying to set LlvmTarget.