Hi,
Currently, KERN_AS is set in Makefile.arch. However, it should be
determined on whether module(7) is enabled or not, for *all* ports,
something like
OPT_MODULAR= %MODULAR%
.if !empty(OPT_MODULAR)
KERN_AS= obj
.else
KERN_AS= library
.endif
Therefore, it is not a good idea to have the common segment of
codes above in all Makefile.arch. We would have three options:
(1) use sys/conf/Makefile.conf
(2) add %MODULAR directive and emitmodular() function in config(1)
(3) set OPT_MODULAR in Makefile.arch, and change a default value for
KERN_AS depending on its value in sys/lib/libkern/Makefile.inc
(1) does not work since %MODULAR% is not expanded if it is in
sys/conf/Makefile.conf. And (2) seems too much for me. Therefore,
I propose (3) as a compromise. Please find the attached patch (MD
part is only for amd64 as an example).
Thoughts?
Thanks,
rin
On 2018/09/18 21:52, maya%netbsd.org@localhost wrote:
I'd like to propose the following to remove dead code intended for
modules, which are not enabled.