From db3274b1c7281dfb07bfd94a83fa4204654debd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Sun, 11 Dec 2022 15:06:06 +0100 Subject: [PATCH] build: Build PE modules with -mcmodel=small. This breaks MinGW autoimport mechanism but nothing in Proton should be using it. Instead, any PE module should be using standard dllimport and ntdll will do the relocations as expected. We also don't and hopefully never have modules larger than 2GB, so 32-bit %rip relative offsets should be enough for everything. This will OTOH save a lot of .refptr indirections, that are otherwise generated for any extern symbols, even though they are later linked in the same module, making all code smaller and maybe a little faster. --- Makefile.in | 1 + configure.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 456c7a8d..1daec846 100644 --- a/Makefile.in +++ b/Makefile.in @@ -180,6 +180,7 @@ SANITY_FLAGS := -fwrapv -fno-strict-aliasing DEBUG_FLAGS := -gdwarf-2 -gstrict-dwarf COMMON_FLAGS = $(DEBUG_FLAGS) $(OPTIMIZE_FLAGS) $(SANITY_FLAGS) -ffile-prefix-map=$(CCACHE_BASEDIR)=. COMMON_FLAGS32 := -mstackrealign +COMMON_FLAGS64 := -mcmodel=small CARGO_BUILD_ARG := --release ## diff --git a/configure.sh b/configure.sh index 34e5bb0f..6510f25b 100755 --- a/configure.sh +++ b/configure.sh @@ -182,7 +182,7 @@ function configure() { # arg_steamrt="soldier" -arg_protonsdk_image="registry.gitlab.steamos.cloud/proton/soldier/sdk:0.20220601.0-1" +arg_protonsdk_image="registry.gitlab.steamos.cloud/proton/soldier/sdk:0.20220601.0-4" arg_no_protonsdk="" arg_build_name="" arg_container_engine=""