Commit Graph

7 Commits

Author SHA1 Message Date
Mike Smith
0b3178a45c 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)
2002-01-10 03:52:01 +00:00
Warner Losh
714b6aa6ff s/oferride/override/
submitted by: dima
2002-01-06 20:33:55 +00:00
Warner Losh
99fd86af3f Move initialization of the MKMODULESENV envorinoment to kern.pre.mk
from kern.post.mk so port makefiles can augment it.

Submitted by: nyan
2002-01-05 06:21:06 +00:00
Warner Losh
4e8764288f Move all: target to kern.pre.mk so it matters less where you include
kern.post.mk.

# this should allow us to move kern.post.mk to the last line of the makefiles,
# but I'll do that slowly as I verify that one can do that w/o breaking things.

Submitted by: naddy
2001-11-11 06:16:53 +00:00
Warner Losh
1fddc467ee Move machine link creation from genassym to kernel-depend, per nyan@ 2001-11-04 23:10:39 +00:00
Warner Losh
7ff5025996 Arrgh. A clean pc98 build failed due to bogons on my part :-(.
Fix it by putting back the link of machine to sys/i386/include rather
than ../../include (aka sys/pc98/include).  I had a stale machine link
on my first test.

Not sure what the "right" fix is, but this unbreaks things.
2001-11-02 21:50:15 +00:00
Warner Losh
41c8eb3039 Factor the common parts of the Makefile.foo files. This introduces two
new files: kern.pre.mk, which contains most of the definitions, and
kern.post.mk, which contains most of the rules.

I've tested this on i386 and pc98.  I have had feedback on the sparc64
port, but no reports from anybody on alpha, ia64 or powerpc.  I
appologize in advance if I've broken you.

Reviewed by: jake, jhb, arch@
2001-11-02 21:34:20 +00:00