| @@ -1,36 +1,34 @@ | | | @@ -1,36 +1,34 @@ |
1 | # $NetBSD: bsd.kmodule.mk,v 1.36 2012/03/15 02:00:52 joerg Exp $ | | 1 | # $NetBSD: bsd.kmodule.mk,v 1.37 2012/08/10 16:34:23 joerg Exp $ |
2 | | | 2 | |
3 | # We are not building this with PIE | | 3 | # We are not building this with PIE |
4 | MKPIE=no | | 4 | MKPIE=no |
5 | | | 5 | |
6 | .include <bsd.init.mk> | | 6 | .include <bsd.init.mk> |
7 | .include <bsd.klinks.mk> | | 7 | .include <bsd.klinks.mk> |
8 | .include <bsd.sys.mk> | | 8 | .include <bsd.sys.mk> |
9 | | | 9 | |
10 | ##### Basic targets | | 10 | ##### Basic targets |
11 | realinstall: kmodinstall | | 11 | realinstall: kmodinstall |
12 | | | 12 | |
13 | KERN= $S/kern | | 13 | KERN= $S/kern |
14 | | | 14 | |
15 | CFLAGS+= -ffreestanding ${COPTS} | | 15 | CFLAGS+= -ffreestanding ${COPTS} |
16 | CPPFLAGS+= -nostdinc -I. -I${.CURDIR} -isystem $S -isystem $S/arch | | 16 | CPPFLAGS+= -nostdinc -I. -I${.CURDIR} -isystem $S -isystem $S/arch |
17 | CPPFLAGS+= -isystem ${S}/../common/include | | 17 | CPPFLAGS+= -isystem ${S}/../common/include |
18 | CPPFLAGS+= -D_KERNEL -D_LKM -D_MODULE -DSYSCTL_INCLUDE_DESCR | | 18 | CPPFLAGS+= -D_KERNEL -D_LKM -D_MODULE -DSYSCTL_INCLUDE_DESCR |
19 | | | 19 | |
20 | # XXX until the kernel is fixed again... | | 20 | # XXX until the kernel is fixed again... |
21 | .if defined(HAVE_GCC) || defined(HAVE_PCC) || defined(HAVE_LLVM) | | | |
22 | CFLAGS+= -fno-strict-aliasing -Wno-pointer-sign | | 21 | CFLAGS+= -fno-strict-aliasing -Wno-pointer-sign |
23 | .endif | | | |
24 | | | 22 | |
25 | # XXX This is a workaround for platforms that have relative relocations | | 23 | # XXX This is a workaround for platforms that have relative relocations |
26 | # that, when relocated by the module loader, result in addresses that | | 24 | # that, when relocated by the module loader, result in addresses that |
27 | # overflow the size of the relocation (e.g. R_PPC_REL24 in powerpc). | | 25 | # overflow the size of the relocation (e.g. R_PPC_REL24 in powerpc). |
28 | # The real solution to this involves generating trampolines for those | | 26 | # The real solution to this involves generating trampolines for those |
29 | # relocations inside the loader and removing this workaround, as the | | 27 | # relocations inside the loader and removing this workaround, as the |
30 | # resulting code would be much faster. | | 28 | # resulting code would be much faster. |
31 | .if ${MACHINE_CPU} == "arm" | | 29 | .if ${MACHINE_CPU} == "arm" |
32 | CFLAGS+= -mlong-calls | | 30 | CFLAGS+= -mlong-calls |
33 | .elif ${MACHINE_CPU} == "powerpc" | | 31 | .elif ${MACHINE_CPU} == "powerpc" |
34 | CFLAGS+= -mlongcall | | 32 | CFLAGS+= -mlongcall |
35 | .elif ${MACHINE_CPU} == "vax" | | 33 | .elif ${MACHINE_CPU} == "vax" |
36 | CFLAGS+= -fno-pic | | 34 | CFLAGS+= -fno-pic |