Rename is_like_osx to is_like_darwin

This commit is contained in:
Mads Marquart 2024-08-19 15:20:02 +02:00
parent 7d49ae9731
commit 328846c6eb
24 changed files with 54 additions and 54 deletions

View file

@ -373,7 +373,7 @@ impl<'a> GccLinker<'a> {
// * On OSX they have their own linker, not binutils'
// * For WebAssembly the only functional linker is LLD, which doesn't
// support hint flags
!self.sess.target.is_like_osx && !self.sess.target.is_like_wasm
!self.sess.target.is_like_darwin && !self.sess.target.is_like_wasm
}
// Some platforms take hints about whether a library is static or dynamic.
@ -425,7 +425,7 @@ impl<'a> GccLinker<'a> {
fn build_dylib(&mut self, crate_type: CrateType, out_filename: &Path) {
// On mac we need to tell the linker to let this library be rpathed
if self.sess.target.is_like_osx {
if self.sess.target.is_like_darwin {
if self.is_cc() {
// `-dynamiclib` makes `cc` pass `-dylib` to the linker.
self.cc_arg("-dynamiclib");
@ -470,7 +470,7 @@ impl<'a> GccLinker<'a> {
fn with_as_needed(&mut self, as_needed: bool, f: impl FnOnce(&mut Self)) {
if !as_needed {
if self.sess.target.is_like_osx {
if self.sess.target.is_like_darwin {
// FIXME(81490): ld64 doesn't support these flags but macOS 11
// has -needed-l{} / -needed_library {}
// but we have no way to detect that here.
@ -485,7 +485,7 @@ impl<'a> GccLinker<'a> {
f(self);
if !as_needed {
if self.sess.target.is_like_osx {
if self.sess.target.is_like_darwin {
// See above FIXME comment
} else if self.is_gnu && !self.sess.target.is_like_windows {
self.link_arg("--as-needed");
@ -618,7 +618,7 @@ impl<'a> Linker for GccLinker<'a> {
let colon = if verbatim && self.is_gnu { ":" } else { "" };
if !whole_archive {
self.link_or_cc_arg(format!("-l{colon}{name}"));
} else if self.sess.target.is_like_osx {
} else if self.sess.target.is_like_darwin {
// -force_load is the macOS equivalent of --whole-archive, but it
// involves passing the full path to the library to link.
self.link_arg("-force_load");
@ -634,7 +634,7 @@ impl<'a> Linker for GccLinker<'a> {
self.hint_static();
if !whole_archive {
self.link_or_cc_arg(path);
} else if self.sess.target.is_like_osx {
} else if self.sess.target.is_like_darwin {
self.link_arg("-force_load").link_arg(path);
} else {
self.link_arg("--whole-archive").link_arg(path).link_arg("--no-whole-archive");
@ -669,7 +669,7 @@ impl<'a> Linker for GccLinker<'a> {
// -dead_strip can't be part of the pre_link_args because it's also used
// for partial linking when using multiple codegen units (-r). So we
// insert it here.
if self.sess.target.is_like_osx {
if self.sess.target.is_like_darwin {
self.link_arg("-dead_strip");
// If we're building a dylib, we don't use --gc-sections because LLVM
@ -727,7 +727,7 @@ impl<'a> Linker for GccLinker<'a> {
fn debuginfo(&mut self, strip: Strip, _: &[PathBuf]) {
// MacOS linker doesn't support stripping symbols directly anymore.
if self.sess.target.is_like_osx {
if self.sess.target.is_like_darwin {
return;
}
@ -794,7 +794,7 @@ impl<'a> Linker for GccLinker<'a> {
debug!("EXPORTED SYMBOLS:");
if self.sess.target.is_like_osx {
if self.sess.target.is_like_darwin {
// Write a plain, newline-separated list of symbols
let res: io::Result<()> = try {
let mut f = File::create_buffered(&path)?;
@ -840,7 +840,7 @@ impl<'a> Linker for GccLinker<'a> {
}
}
if self.sess.target.is_like_osx {
if self.sess.target.is_like_darwin {
self.link_arg("-exported_symbols_list").link_arg(path);
} else if self.sess.target.is_like_solaris {
self.link_arg("-M").link_arg(path);