Closed darcagn closed 2 months ago
Normally we do use CG_RUSTFLAGS
as you can see here. This function is called to build the command line which will be used for all commands, so if it's not setting variables correctly, maybe the code is wrong.
In this case, the environment is first set to the empty one here, so that condition is never true.
Fixed by #493.
I've successfully gotten libc/std building targetting SuperH (SH4/Dreamcast). I need to build sysroot with
-matomic-model=soft-imask
for it to work properly.I can insert
rustflags.push_str(" -Cllvm-args=-matomic-model=soft-imask");
at this line: https://github.com/rust-lang/rustc_codegen_gcc/blob/5584f5f1a22aceb3d686cfa1165c6d160c994586/build_system/src/build.rs#L150Or insert
context.add_command_line_option("-matomic-model=soft-imask");
at this line: https://github.com/rust-lang/rustc_codegen_gcc/blob/5584f5f1a22aceb3d686cfa1165c6d160c994586/src/base.rs#L118And I seem to get the desired effect. But I'd prefer not to patch things if I can do it without.
If I do
CG_RUSTFLAGS=-Cllvm-args=-matomic-model=soft-imask y.sh build
it does not seem to honor it when building the sysroot. To test this I can put gibberish flags like-blahblah
and get no error when the same would give me errors when building a normal project withy.sh cargo build
. Am I doing something wrong here or is this something not supported yet?