Related to #8522 but not quite the same: There needs to be a way, in librustpkg/api.rs, to set rustc flags. An example scenario, suggested by @erickt , is to make rustpkg build essentially run:
rustc --linker c++ --link-args $(llvm-config --ldflags --libs all) llvm.rs