]> git.proxmox.com Git - pve-edk2-firmware.git/commitdiff
debian: add patch to enforce the basic x86-64 march
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 7 Mar 2023 08:38:45 +0000 (09:38 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 7 Mar 2023 08:38:47 +0000 (09:38 +0100)
this is mostly done to secure against a future change of the default
march that may come from the x86-64-v* microarchitecture level [0]
concept that is currently being developed and by some more bleeding
edge  distros even already adopted.

[0]: https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
debian/patches/series
debian/patches/x64-baseline-abi.patch [new file with mode: 0644]

index 31911bc9a9e31ec3f69c3a9dc14bf4e151c5121f..ade866533ed481e5d7747ff591ee730550387189 100644 (file)
@@ -1,2 +1,3 @@
 no-stack-protector-all-archs.diff
 brotlicompress-disable.diff
+x64-baseline-abi.patch
diff --git a/debian/patches/x64-baseline-abi.patch b/debian/patches/x64-baseline-abi.patch
new file mode 100644 (file)
index 0000000..f49c076
--- /dev/null
@@ -0,0 +1,20 @@
+Description: Explicitly target generic x86-64 ABI
+ The system compiler may be configured to target a higher x86-64 psABI by
+ default, so explicitly target the generic psABI to retain compatibility
+ with older machine types.
+Author: dann frazier <dannf@debian.org>
+Bug-Ubuntu: http://launchpad.net/bugs/1976267
+Forwarded: https://edk2.groups.io/g/devel/message/90447
+Last-Update: 2022-06-10
+
+--- a/BaseTools/Conf/tools_def.template
++++ b/BaseTools/Conf/tools_def.template
+@@ -1885,7 +1885,7 @@
+ DEFINE GCC48_ALL_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -ffunction-sections -fdata-sections -fno-stack-protector -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings\r
+ DEFINE GCC48_IA32_X64_DLINK_COMMON   = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20\r
+ DEFINE GCC48_IA32_CC_FLAGS           = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address\r
+-DEFINE GCC48_X64_CC_FLAGS            = DEF(GCC48_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address\r
++DEFINE GCC48_X64_CC_FLAGS            = DEF(GCC48_ALL_CC_FLAGS) -m64 -march=x86-64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address\r
+ DEFINE GCC48_IA32_X64_ASLDLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable\r
+ DEFINE GCC48_IA32_X64_DLINK_FLAGS    = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive\r
+ DEFINE GCC48_IA32_DLINK2_FLAGS       = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON)\r