summaryrefslogtreecommitdiff
path: root/util/xcompile
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2018-12-11 19:21:45 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-03-06 20:00:38 +0000
commit0c590f064e040e0f75abdc9e816ef1d21bf8b437 (patch)
tree0210129bad41def7cc6a32a37cd20527b348bd31 /util/xcompile
parent57b4ec6bd36325baf8053f4aeca59d96b99d3954 (diff)
pci_drivers/cpu_drivers: Fix constructed arrays on x86_64
The __pci_driver and __cpu_driver uses variable length arrays which are constructed by the linker at build-time. The linker always place the structs at 16-byte boundary, as per "System V ABI". That's not a problem on x86, as the struct is exactly 16 Bytes in size. On other platforms, like x86_64 it breaks, because the default data alignment isn't SysV compatible. Set -malign-data=abi to make x86_64 gcc use the SysV psABI. Fixes broken __pci_driver and __cpu_driver on x86_64. Change-Id: I2491d47ed03dcfd8db110dfb181b2c5281449591 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/30116 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/xcompile')
-rwxr-xr-xutil/xcompile/xcompile2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index 0fefff2f5a..4a29cdd647 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -238,7 +238,7 @@ EOF
# to use i586 instead.
if [ "${TARCH}" = "x86_64" ]; then
cat <<EOF
- GCC_CFLAGS_${TARCH} += -march=nocona
+ GCC_CFLAGS_${TARCH} += -march=nocona -malign-data=abi
EOF
fi