aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-12-11 19:05:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-12-11 19:05:28 +0000
commit959530cc41aea5f878c2c2cea5b545d295108bab (patch)
tree4bf5920e1317751893105a9bbe7cc80dc239c12e /sys
parent7124b5ba04d1471e7ff3d167cfd5e0104cc10ca1 (diff)
parent2bf1d8b75f80db563df19c5b7b8e3c1f80ca14e6 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/files3
-rw-r--r--sys/conf/kern.mk1
-rw-r--r--sys/conf/kern.pre.mk7
-rw-r--r--sys/conf/ldscript.i3863
-rw-r--r--sys/i386/i386/locore.s4
-rw-r--r--sys/modules/fxp/Makefile2
6 files changed, 15 insertions, 5 deletions
diff --git a/sys/conf/files b/sys/conf/files
index 52eba7d16677..df7cf0d2e3d6 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1781,7 +1781,8 @@ dev/flash/cqspi.c optional cqspi fdt xdma
dev/flash/mx25l.c optional mx25l
dev/flash/n25q.c optional n25q fdt
dev/flash/qspi_if.m optional cqspi fdt | n25q fdt
-dev/fxp/if_fxp.c optional fxp
+dev/fxp/if_fxp.c optional fxp \
+ compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS}"
dev/fxp/inphy.c optional fxp
dev/gem/if_gem.c optional gem
dev/gem/if_gem_pci.c optional gem pci
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index 398df66f66fd..76bfa3e9e67f 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -25,6 +25,7 @@ NO_WUNNEEDED_INTERNAL_DECL= -Wno-error-unneeded-internal-declaration
NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized
NO_WCAST_QUAL= -Wno-error-cast-qual
NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare
+NO_WARRAY_BOUNDS= -Wno-error-array-bounds
# Several other warnings which might be useful in some cases, but not severe
# enough to error out the whole kernel build. Display them anyway, so there is
# some incentive to fix them eventually.
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 37e31b50ca10..bca9ff79e756 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -133,7 +133,12 @@ LDFLAGS+= -Wl,--build-id=sha1
.error amd64/arm64/i386 kernel requires linker ifunc support
.endif
.if ${MACHINE_CPUARCH} == "amd64"
-LDFLAGS+= -Wl,-z max-page-size=2097152 -Wl,-z common-page-size=4096 -Wl,-z -Wl,ifunc-noplt
+LDFLAGS+= -Wl,-z max-page-size=2097152
+.if ${LINKER_TYPE} != "lld"
+LDFLAGS+= -Wl,-z common-page-size=4096
+.else
+LDFLAGS+= -Wl,-z -Wl,ifunc-noplt
+.endif
.endif
NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
diff --git a/sys/conf/ldscript.i386 b/sys/conf/ldscript.i386
index 21eab2a136ed..e5d0f0cf5f43 100644
--- a/sys/conf/ldscript.i386
+++ b/sys/conf/ldscript.i386
@@ -140,9 +140,9 @@ SECTIONS
}
.data1 : { *(.data1) }
_edata = .; PROVIDE (edata = .);
- __bss_start = .;
.bss :
{
+ __bss_start = .;
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
@@ -152,6 +152,7 @@ SECTIONS
FIXME: Why do we need it? When there is no .bss section, we don't
pad the .data section. */
. = ALIGN(. != 0 ? 32 / 8 : 1);
+ __bss_end = .;
}
. = ALIGN(32 / 8);
. = ALIGN(32 / 8);
diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s
index e8b677ce3a8a..454f7f0a1010 100644
--- a/sys/i386/i386/locore.s
+++ b/sys/i386/i386/locore.s
@@ -120,8 +120,8 @@ NON_GPROF_ENTRY(btext)
* inactive from now until we switch to new ones, since we don't load any
* more segment registers or permit interrupts until after the switch.
*/
- movl $end,%ecx
- movl $edata,%edi
+ movl $__bss_end,%ecx
+ movl $__bss_start,%edi
subl %edi,%ecx
xorl %eax,%eax
cld
diff --git a/sys/modules/fxp/Makefile b/sys/modules/fxp/Makefile
index fbe14392f69f..6a47028f8822 100644
--- a/sys/modules/fxp/Makefile
+++ b/sys/modules/fxp/Makefile
@@ -6,3 +6,5 @@ KMOD= if_fxp
SRCS= device_if.h bus_if.h if_fxp.c inphy.c miibus_if.h miidevs.h pci_if.h
.include <bsd.kmod.mk>
+
+CWARNFLAGS+= ${NO_WARRAY_BOUNDS}