summaryrefslogtreecommitdiffstats
path: root/sys/conf/kern.pre.mk
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2002-01-10 03:52:01 +0000
committermsmith <msmith@FreeBSD.org>2002-01-10 03:52:01 +0000
commit2eab148603db6f9c4c5439f604fe1c4249c9b6a8 (patch)
treea46273f1dcbfd2cfbd291fc3b4703733694f4f69 /sys/conf/kern.pre.mk
parenta5dead43ce172fc62b6892ff8b57646ad7cfc647 (diff)
downloadFreeBSD-src-2eab148603db6f9c4c5439f604fe1c4249c9b6a8.zip
FreeBSD-src-2eab148603db6f9c4c5439f604fe1c4249c9b6a8.tar.gz
Eliminate the use of commons in the kernel and modules,
simplifying the module linking process and eliminating the risks associated with doubly-defined variables. Cases where commons were legitimately used (detection of compiled-in subsystems) have been converted to use sysinits, and any new code should use this or an equivalent practice as a matter of course. Modules can override this behaviour by substituting -fno-common out of ${CFLAGS} in cases where commons are necessary (eg. third-party object modules). Commons will be resolved and allocated space when the kld is linked as part of the module build process, so they will not pose a risk to the kernel or other modules. Provide a mechanism for controlling the export of symbols from the module namespace. The EXPORT_SYMS variable may be set in the Makefile to NO (export no symbols), a list of symbols to export, or the name of a file containing a newline-seperated list of symbols to be exported. Non-exported symbols are converted to local symbols. If EXPORT_SYMS is not set, all global symbols are currently exported. This behaviour is expected to change (to exporting no symbols) once modules have been converted. Reviewed by: peter (in principle) Obtained from: green (kmod_syms.awk)
Diffstat (limited to 'sys/conf/kern.pre.mk')
-rw-r--r--sys/conf/kern.pre.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 06fdf84..0feec79 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -38,7 +38,7 @@ INCLUDES+= -I/usr/include
.endif
COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -ffreestanding -include opt_global.h
-CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
+CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} -fno-common
# XXX LOCORE means "don't declare C stuff" not "for locore.s".
ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS}
@@ -76,7 +76,7 @@ SYSTEM_SFILES= $S/$M/$M/locore.s
SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} hints.o env.o config.o hack.So
SYSTEM_LD= @${LD} ${FMT} -Bdynamic -T $S/conf/ldscript.$M \
- -export-dynamic -dynamic-linker /red/herring \
+ -warn-common -export-dynamic -dynamic-linker /red/herring \
-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \
${SIZE} ${FMT} ${.TARGET} ; chmod 755 ${.TARGET}
OpenPOWER on IntegriCloud