From 8cf85bc0dcabcf99775f2b9a7fa2191caea7f164 Mon Sep 17 00:00:00 2001 From: Alan Egerton Date: Mon, 8 Jun 2020 17:24:21 +0100 Subject: [PATCH] Use shorthand linker strip arguments in order to support MacOS --- src/librustc_codegen_ssa/back/linker.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs index d9fed998c92fb..b17c367820748 100644 --- a/src/librustc_codegen_ssa/back/linker.rs +++ b/src/librustc_codegen_ssa/back/linker.rs @@ -481,10 +481,12 @@ impl<'a> Linker for GccLinker<'a> { match strip { Strip::None => {} Strip::Debuginfo => { - self.linker_arg("--strip-debug"); + // MacOS linker does not support longhand argument --strip-debug + self.linker_arg("-S"); } Strip::Symbols => { - self.linker_arg("--strip-all"); + // MacOS linker does not support longhand argument --strip-all + self.linker_arg("-s"); } } }