kern.pre.mk (fac6dee9eb58b2b558fec2aea749460ca623f6d6) kern.pre.mk (91b31c100b5eb30c59f2f78dd10922e7e0b2c6e2)
1# $FreeBSD$
2
3# Part of a unified Makefile for building kernels. This part contains all
4# of the definitions that need to be before %BEFORE_DEPEND.
5
6# Allow user to configure things that only effect src tree builds.
7# Note: This is duplicated from src.sys.mk to ensure that we include
8# /etc/src.conf when building the kernel. Kernels can be built without

--- 152 unchanged lines hidden (view full) ---

161 defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == ""
162.error amd64/arm64/i386/ppc* kernel requires linker ifunc support
163.endif
164.if ${MACHINE_CPUARCH} == "amd64"
165LDFLAGS+= -z max-page-size=2097152
166.if ${LINKER_TYPE} != "lld"
167LDFLAGS+= -z common-page-size=4096
168.else
1# $FreeBSD$
2
3# Part of a unified Makefile for building kernels. This part contains all
4# of the definitions that need to be before %BEFORE_DEPEND.
5
6# Allow user to configure things that only effect src tree builds.
7# Note: This is duplicated from src.sys.mk to ensure that we include
8# /etc/src.conf when building the kernel. Kernels can be built without

--- 152 unchanged lines hidden (view full) ---

161 defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == ""
162.error amd64/arm64/i386/ppc* kernel requires linker ifunc support
163.endif
164.if ${MACHINE_CPUARCH} == "amd64"
165LDFLAGS+= -z max-page-size=2097152
166.if ${LINKER_TYPE} != "lld"
167LDFLAGS+= -z common-page-size=4096
168.else
169.if defined(LINKER_FEATURES) && !${LINKER_FEATURES:Mifunc-noplt}
170.warning "Linker ${LD} does not support -z ifunc-noplt -> ifunc calls are unoptimized."
171.else
169LDFLAGS+= -z notext -z ifunc-noplt
170.endif
171.endif
172LDFLAGS+= -z notext -z ifunc-noplt
173.endif
174.endif
175.endif # ${MACHINE_CPUARCH} == "amd64"
172
173.if ${MACHINE_CPUARCH} == "riscv"
174# Hack: Work around undefined weak symbols being out of range when linking with
175# LLD (address is a PC-relative calculation, and BFD works around this by
176# rewriting the instructions to generate an absolute address of 0); -fPIE
177# avoids this since it uses the GOT for all extern symbols, which is overly
178# inefficient for us. Drop once undefined weak symbols work with medany.
179.if ${LINKER_TYPE} == "lld"

--- 174 unchanged lines hidden ---
176
177.if ${MACHINE_CPUARCH} == "riscv"
178# Hack: Work around undefined weak symbols being out of range when linking with
179# LLD (address is a PC-relative calculation, and BFD works around this by
180# rewriting the instructions to generate an absolute address of 0); -fPIE
181# avoids this since it uses the GOT for all extern symbols, which is overly
182# inefficient for us. Drop once undefined weak symbols work with medany.
183.if ${LINKER_TYPE} == "lld"

--- 174 unchanged lines hidden ---