git: 274667c1ee5c - stable/13 - linux(4): Fix amd64 gcc build.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 17 Jun 2022 19:37:15 UTC
The branch stable/13 has been updated by dchagin:
URL: https://cgit.FreeBSD.org/src/commit/?id=274667c1ee5c24a6ebb22a8ee44e759098a2fd93
commit 274667c1ee5c24a6ebb22a8ee44e759098a2fd93
Author: Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2021-07-26 19:28:21 +0000
Commit: Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-17 19:33:14 +0000
linux(4): Fix amd64 gcc build.
Do not specify memory model and mregparm for amd64, it's only
available on IA-32 architecture.
Reported by: jhb, jrtc27
MFC after: 2 weeks
(cherry picked from commit b0fa09a0a7e30f301cc58750dedb3d88ec39992d)
---
sys/modules/linux/Makefile | 8 +++++---
sys/modules/linux64/Makefile | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile
index e552e9ce6302..a0d48297e542 100644
--- a/sys/modules/linux/Makefile
+++ b/sys/modules/linux/Makefile
@@ -60,19 +60,21 @@ linux${SFX}_assym.h: linux${SFX}_genassym.o
sh ${SYSDIR}/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET}
.if ${MACHINE_CPUARCH} == "amd64"
-VDSOFLAGS=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 -m32 -mcmodel=small
+VDSOFLAGS=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 -m32
+.else
+VDSOFLAGS=-mregparm=0
.endif
linux${SFX}_locore.o: linux${SFX}_assym.h assym.inc
${CC} -c -x assembler-with-cpp -DLOCORE -fPIC -pipe -O2 -Werror \
- -msoft-float -mregparm=0 \
+ -msoft-float \
-fno-common -nostdinc -fasynchronous-unwind-tables \
-fno-omit-frame-pointer -foptimize-sibling-calls ${VDSOFLAGS} \
-fno-stack-protector -I. -I${SYSDIR} -I${SRCTOP}/include \
${.IMPSRC} -o ${.TARGET}
linux${SFX}_vdso_gtod.o: linux_vdso_gtod.inc ${VDSODEPS}
- ${CC} -c -fPIC -pipe -O2 -Werror -msoft-float -mregparm=0 \
+ ${CC} -c -fPIC -pipe -O2 -Werror -msoft-float \
-fno-common -nostdinc -fasynchronous-unwind-tables \
-fno-omit-frame-pointer -foptimize-sibling-calls ${VDSOFLAGS} \
-fno-stack-protector -I. -I${SYSDIR} -I${SRCTOP}/include \
diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile
index 0764d1b0dc99..e2a408f49bad 100644
--- a/sys/modules/linux64/Makefile
+++ b/sys/modules/linux64/Makefile
@@ -31,7 +31,7 @@ linux_assym.h: linux_genassym.o
sh ${SYSDIR}/kern/genassym.sh linux_genassym.o > ${.TARGET}
.if ${MACHINE_CPUARCH} == "amd64"
-VDSOFLAGS=-mregparm=0 -mcmodel=small -msoft-float
+VDSOFLAGS=-mcmodel=small -msoft-float
VDSODEPS=linux_vdso_gettc_x86.inc
.elif ${MACHINE_CPUARCH} == "aarch64"
# The Linux uses tiny memory model, but our ld does not know about