Hello, I would like to ask the more knowledgeable people in this community why can't Cargo accept arbitrary arguments to rustc on build scripts' behalf?
Currently, it is explictly stated in the code (cargo/custom_build.rs at c8c6e339967617bca15195748b0a72a2a73e486d · rust-lang/cargo · GitHub) that only -L and -l flags are allowed for the
rustc-flags build script output option, but no explanation given as to why is that the case. Also, if there is no objections from others on this topic, I would like to work on making other options available to be passed on as well.
An example of how this might benefit the user is the
link-flavor codegen options, which, in some rare cases, might need to be specified according to the target for which the user is compiling the code to.