Skip to content
Snippets Groups Projects
Commit b34f61c1 authored by Robin Randhawa's avatar Robin Randhawa
Browse files

Introduce a target family for Redox

The Redox base target spec located within the rustc source did not
specify a 'target_family' attribute. However, the x86_64 specific target
spec located within the redox source did.

Now AArch64 could have done something similar but unfortunately can't
since there are rust compiler mods needed to support Redox on AArch64
which imply that any AArch64 target spec file in the Redox source shall
be ignored in favour of the target spec within the rustc source.

The target_family attribute is eventually translated into an environment
variable called CARGO_CFG_TARGET_FAMILY whose presence can be tested by
software built with the compiler generated from the target spec.

Some crates expect this variable to contain something failing which they
crash. Eg onig_sys within rust-onig. Since the Redox base target spec in
the rustc source doesn't specify target_family for AArch64, such crates
don't build.

The solution is to introduce target_family in the Redox base
target spec within the rustc source so both x86_64 and AArch64 have it
defined by default. It is set to "redox".

"unix" would perhaps be more preferable but using that breaks the rustc
build which starts making incorrect assumptions about the support libs
that Redox has.
parent 6e2d298e
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment