diff options
author | imp <imp@FreeBSD.org> | 2010-09-13 07:16:48 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2010-09-13 07:16:48 +0000 |
commit | c517eaecea2a739c5f36639f44972b3c85b8e918 (patch) | |
tree | e7c4722a8acfafb64407b46fc74672eed3553d4e /sys | |
parent | a05e8d3ea87a132fa8c80e21a3f74223ee2100b9 (diff) | |
download | FreeBSD-src-c517eaecea2a739c5f36639f44972b3c85b8e918.zip FreeBSD-src-c517eaecea2a739c5f36639f44972b3c85b8e918.tar.gz |
Use MACHINE_CPUARCH as appropriate
Define __KLD_SHARED to be yes or no depending on if the target uses shared
binaries for klds or not (this also eliminates 4 uses of MACHINE_ARCH).
Diffstat (limited to 'sys')
-rw-r--r-- | sys/conf/kmod.mk | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 63f4748..de4ba36 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -81,6 +81,13 @@ OBJCOPY?= objcopy .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S +# amd64 and mips use direct linking for kmod, all others use shared binaries +.if ${MACHINE_CPUARCH} != amd64 && ${MACHINE_CPUARCH} != mips +__KLD_SHARED=yes +.else +__KLD_SHARED=no +.endif + .if ${CC:T:Micc} == "icc" CFLAGS:= ${CFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/} .else @@ -128,15 +135,15 @@ CFLAGS+= -fno-common LDFLAGS+= -d -warn-common CFLAGS+= ${DEBUG_FLAGS} -.if ${MACHINE_ARCH} == amd64 +.if ${MACHINE_CPUARCH} == amd64 CFLAGS+= -fno-omit-frame-pointer .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == powerpc CFLAGS+= -mlongcall -fno-omit-frame-pointer .endif -.if ${MACHINE_ARCH} == "mips" +.if ${MACHINE_CPUARCH} == mips CFLAGS+= -G0 -fno-pic -mno-abicalls -mlong-calls .endif @@ -190,7 +197,7 @@ ${PROG}.symbols: ${FULLPROG} ${OBJCOPY} --only-keep-debug ${FULLPROG} ${.TARGET} .endif -.if ${MACHINE_ARCH} != amd64 && ${MACHINE_ARCH} != mips +.if ${__KLD_SHARED} == yes ${FULLPROG}: ${KMOD}.kld ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld .if !defined(DEBUG_FLAGS) @@ -203,7 +210,7 @@ EXPORT_SYMS?= NO CLEANFILES+= export_syms .endif -.if ${MACHINE_ARCH} != amd64 && ${MACHINE_ARCH} != mips +.if ${__KLD_SHARED} == yes ${KMOD}.kld: ${OBJS} .else ${FULLPROG}: ${OBJS} @@ -223,8 +230,7 @@ ${FULLPROG}: ${OBJS} export_syms | xargs -J% ${OBJCOPY} % ${.TARGET} .endif .endif -.if !defined(DEBUG_FLAGS) && \ - (${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == mips) +.if !defined(DEBUG_FLAGS) && ${__KLD_SHARED} == no ${OBJCOPY} --strip-debug ${.TARGET} .endif |