From 7c97ddfbbb70de9d380d809a0a808fb725fda908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sun, 16 Aug 2020 21:32:46 +0200 Subject: [PATCH 1/2] Enable function sections on windows-gnu --- src/librustc_target/spec/windows_gnu_base.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/librustc_target/spec/windows_gnu_base.rs b/src/librustc_target/spec/windows_gnu_base.rs index 69236e98e58d7..ba574ad433e10 100644 --- a/src/librustc_target/spec/windows_gnu_base.rs +++ b/src/librustc_target/spec/windows_gnu_base.rs @@ -66,8 +66,6 @@ pub fn opts() -> TargetOptions { ); TargetOptions { - // FIXME(#13846) this should be enabled for windows - function_sections: false, linker: Some("gcc".to_string()), dynamic_linking: true, executables: true, From b6550278c9e4b6aa484796815fe0201299f15041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sun, 16 Aug 2020 21:39:43 +0200 Subject: [PATCH 2/2] Stable-symbol-names test: compare only global symbols With MinGW and specific flags symbol may end up in multiple sections in some cases like: 0000000000000000 p .pdata$_ZN20stable_symbol_names113mono_function17hd4880e88dec8766dE 0000000000000000 t .text$_ZN20stable_symbol_names113mono_function17hd4880e88dec8766dE 0000000000000000 r .xdata$_ZN20stable_symbol_names113mono_function17hd4880e88dec8766dE 0000000000000000 T _ZN20stable_symbol_names113mono_function17hd4880e88dec8766dE This will cause an error when comparing that output directly with other library that only imports the symbol since it will appear only once. To avoid the issue pass "-g" to nm so only the global symbol (the one with "T" letter) will be listed. --- src/test/run-make-fulldeps/stable-symbol-names/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/run-make-fulldeps/stable-symbol-names/Makefile b/src/test/run-make-fulldeps/stable-symbol-names/Makefile index 451af809b2223..e393684024bde 100644 --- a/src/test/run-make-fulldeps/stable-symbol-names/Makefile +++ b/src/test/run-make-fulldeps/stable-symbol-names/Makefile @@ -9,7 +9,7 @@ # 4. sort those symbol names for deterministic comparison # 5. write the result into a file -dump-symbols = nm "$(TMPDIR)/lib$(1).rlib" \ +dump-symbols = nm -g "$(TMPDIR)/lib$(1).rlib" \ | grep -E "$(2)" \ | sed -E "s/.*(_ZN.*E|_R[a-zA-Z0-9_]*).*/\1/" \ | sort \