Skip to content

Cannot pass CG_RUSTFLAGS when building sysroot #491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
darcagn opened this issue Apr 17, 2024 · 3 comments
Closed

Cannot pass CG_RUSTFLAGS when building sysroot #491

darcagn opened this issue Apr 17, 2024 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@darcagn
Copy link
Contributor

darcagn commented Apr 17, 2024

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:

Or insert context.add_command_line_option("-matomic-model=soft-imask"); at this line:

And 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 with y.sh cargo build. Am I doing something wrong here or is this something not supported yet?

@GuillaumeGomez
Copy link
Member

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.

@antoyo
Copy link
Contributor

antoyo commented Apr 17, 2024

In this case, the environment is first set to the empty one here, so that condition is never true.

@antoyo antoyo added good first issue Good for newcomers bug Something isn't working labels Apr 17, 2024
@antoyo
Copy link
Contributor

antoyo commented Apr 17, 2024

Fixed by #493.

@antoyo antoyo closed this as completed Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants