rust-lang / rustc_codegen_gcc

libgccjit AOT codegen for rustc
Apache License 2.0
893 stars 61 forks source link

Modify build_system's prepare stage to allow for custom sysroot source path #494

Closed darcagn closed 2 months ago

darcagn commented 2 months ago

This change allows users to specify a custom directory from which to copy the sysroot source code instead of being forced to use the rust-src provided with the rustup toolchain. The path is passed to --sysroot-source during the prepare stage, like so:

./y.sh prepare --sysroot-source /path/to/custom/source

This removes a pain point for using rustc_codegen_gcc while creating and testing support for new platforms with architectures without LLVM support.

GuillaumeGomez commented 2 months ago

I wonder if it shouldn't a setting (in config.toml) instead. It's easy to forget to pass an argument after all... An opinion maybe @antoyo?

darcagn commented 2 months ago

That's definitely a reasonable approach -- let me know what you think @antoyo and I'll be happy to adjust my PR to implement this functionality in that way.

antoyo commented 2 months ago

@darcagn: I would say: choose the approach that is the most convenient to you since you're the main user of this new flag.

antoyo commented 2 months ago

Thanks for your contribution!