Closed
Description
Per https://bugzilla.mozilla.org/show_bug.cgi?id=1181441#c4 we have the --disable-elf-tls
option to support MacOS X 10.6. This requires a custom build, and therefore users need a way to detect whether a given build has that customization.
For Firefox I wrote a configure feature test. There's a school of autotools coding which asserts this is best because it's more robust to test the actual thing you need (linking rust to C++ targeting 10.6). However it is slow and wordy, and we'd like to be able to just ask rustc how it was built.
Two ideas:
- Add a
--print cfg
switch which reports the various #[cfg] values on the command line. Driver scripts could call this and parse the output. This is a general mechanism which might be useful for other features. - The
--disable-elf-tls
option could append a build specifier like+notls
to the semver, and driver scripts could look for that in the output ofrustc --version
. Could be a quick fix.
NB we'd like to remove the need for --disable-elf-tls
entirely (#26581) at which point we could require a minimum rustc version to assert this, but until that time I think it's helpful to address this.