Pass target features to bpf-linker

This commit is contained in:
Alessandro Decina 2021-04-18 17:45:08 +10:00
parent cf5ac6228c
commit 12ac719b99

View file

@ -1489,6 +1489,10 @@ impl<'a> Linker for BpfLinker<'a> {
Some(ref s) => s, Some(ref s) => s,
None => &self.sess.target.options.cpu, None => &self.sess.target.options.cpu,
}); });
self.cmd.arg("--cpu-features").arg(match &self.sess.opts.cg.target_feature {
feat if !feat.is_empty() => feat,
_ => &self.sess.target.options.features,
});
} }
fn link_dylib(&mut self, _lib: Symbol, _verbatim: bool, _as_needed: bool) { fn link_dylib(&mut self, _lib: Symbol, _verbatim: bool, _as_needed: bool) {