Commit Graph

39 Commits

Author SHA1 Message Date
matt
cba6c5bed5 Add support for generating tramponlines in the module at link time.
This is done using some awk scripts and KMODTRAMPOLINE in <machine/asm.h>
It's not as efficient as having the kloader do it but it is a lot simpler.
2013-08-07 17:36:11 +00:00
skrll
b88df2aff1 Add -mlong-calls to hppa module builds. 2013-08-06 06:08:39 +00:00
joerg
fabb48a37a Remove effectively tautological condition. 2012-08-10 16:34:23 +00:00
joerg
17cb70e7b4 Decouple HAVE_LLVM from HAVE_GCC. For GCC, add -Wno-format-zero-length
when -Wformat is used.
2012-03-15 02:00:52 +00:00
matt
47c982a38d Add support for --combine with gcc. 2012-02-19 23:19:37 +00:00
christos
110af54a7b use osrelease -k to avoid that the path is 6.0_BETA 2012-02-16 23:58:15 +00:00
mbalmer
d3aee14626 Move SYSCTL_USE_DESCR to a better place. 2011-09-11 18:38:02 +00:00
apb
386a389aab Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.
2011-09-10 16:57:35 +00:00
matt
dff840eccd VAX kernel modules need to be built with -fno-pic 2011-07-14 18:12:35 +00:00
mrg
75e42fa7da remove most of the remaining HAVE_GCC tests that are always true in
the modern world.
2011-06-20 07:43:56 +00:00
christos
6bbebf8328 Enable c99 mode by default.
This has the side effect of complaining for missing prototypes
implicit type declarations and missing return statements.

NB:	I've only ran a build on amd64, so other platforms MI code might break.
	If you can't wait for me to fix them, revert this commit.
2011-05-17 01:12:34 +00:00
mrg
19625811ee prepare for evbppc modules, and allow overriding the ${MACHINE} for
installed modules.
2011-04-17 09:47:40 +00:00
matt
d24d5902b3 Kernels modules are c99 (gnu99) just like the kernel.
Add(move) -std=gnu99 to CPPFLAGS (from COPTS).
2011-01-02 19:24:47 +00:00
martin
f6c30c513f Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.
2010-12-11 18:42:33 +00:00
joerg
49755c474a gcc passes down -r directly to ld, so make it explicitly a linker option. 2010-12-08 02:04:13 +00:00
jmmv
874cd0d0c1 Generate long calls in modules for arm32 and powerpc to avoid unsupported
relocations by the module loader in the kernel.  This makes modules work
in, at least, shark and macppc respectively.

This is obviously a workaround that results in slower code, but at least
makes modules work.  I'm adding a comment detailing what the real solution
would be so that the whole thing can be revisited in the future.  (Read:
I don't have time now to dig the details of how to implement trampoline
generation.)

(Based on the old bsd.kmod.mk file, I understand that hppa needs this
workaround too, but I can't check this platform.)
2010-01-18 23:39:07 +00:00
mrg
588b1ff87f use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.
2009-12-14 08:51:16 +00:00
matt
1e301281a1 Merge from matt-nb5-mips64 2009-12-14 01:00:46 +00:00
skrll
25edd46c0c Move the kmodule linker script source into sys/modules/xldscripts. It is
not part of binutils and definitely not GPL v3.

Discussed with mrg.
2009-11-10 14:47:52 +00:00
skrll
c93ac2bc84 Update for new binutils location.
XXX Why is kmodule under binutils anyway?
2009-11-08 22:27:09 +00:00
apb
91fe922f05 Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links.  They have no effect except when using a
metalog, in which case the information is added to the metalog.  In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg.  This should fix PR 24457 and PR 41155.
2009-04-10 16:16:12 +00:00
rmind
6d73ddd355 Revert path of modules back to "/stand". 2009-01-24 22:14:44 +00:00
rmind
f0e51651e4 Change path to kernel modules from "/stand" to "/kernel".
Needs to go in before 5.0.  Proposed on <tech-kern>.
2009-01-24 00:29:12 +00:00
hubertf
740e3df3fd Work around a bug in Solaris' shs (both /bin and /usr/xpg4/bin)
where "for d in ; ..." results in a syntax error.

Suggested by apb@
2008-11-30 22:05:56 +00:00
ad
0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
elad
fb62056e51 Don't build kernel modules with PIE.
Discussed with and okay christos@.
2008-11-05 00:54:25 +00:00
mrg
d5ae492949 find the kmodule ldscript in the source tree again.
should fix a build issue reported by jmcneill.
2008-10-14 18:31:42 +00:00
mrg
86340158d0 - install ldscripts on sparc64
- move ldscripts to /usr/libdata/ldscripts
2008-10-12 23:00:53 +00:00
gmcgarry
ce206e318d Honour HAVE_PCC 2008-08-24 06:27:00 +00:00
dyoung
eeabda7de2 Fix two bugs to make MKMODULAR=yes builds will work again, for the
first time.

share/mk/bsd.kmodule.mk: only set _INST_DIRS if KMODULEDIR is not
    set.  That we we avoid installing some bogus directories in
    the DESTDIR and in $DESTDIR/METALOG.

tests/modules/k_helper/Makefile: add missing .include <bsd.own.mk>,
    and set the KMODULEDIR that the author seems to have intended.
2008-05-31 19:58:35 +00:00
he
775e29197c Do ${INSTALL_DIR} on all the intermediate directory levels from
the top of the tree down to where the kernel modules are installed,
so that unprivileged builds have a chance at working again.

Note, to use this fix in a tree where you've already hit on this
problem, you need to manually remove the kernel modules in
$DESTDIR/stand/<arch/, and then reinstall them from sys/modules/.
2008-05-21 19:56:30 +00:00
jmcneill
70932cf82f Don't echo 'hello sh' when installing modules :-) 2008-05-21 03:48:42 +00:00
ad
14cd43625f Install kernel modules into the proper locations, taking machine and
kernel version into account.
2008-05-20 19:01:10 +00:00
ad
575673e1ce fno-zero-initialized-in-bss no longer required. 2008-05-20 12:18:45 +00:00
ad
0b78a6ea64 Use an ldscript to merge kernel modules' .bss sections into .data. Passing
-fno-common -fno-zero-initialized-in-bss to gcc does not work, and objcopy
refuses to expand the bss section.
2008-05-20 12:17:48 +00:00
ad
64be07548a Kill the tramp stuff, since it can be handled with lkm_map. 2008-05-20 12:08:05 +00:00
ad
19913f0560 Pass -d to the linker, to assign space to common objects up front. The kernel
linker isn't smart enough to do that...
2008-05-03 15:48:15 +00:00
ad
7d1f779aa2 Build and install modules into /kernel/modules. Each module gets a
directory for properties, blobs, etc. It's not fixed in stone and
can easily be changed if there are issues with the location/layout.
2008-05-02 23:12:00 +00:00
ad
3ba209837a - Add a bsd.kmodule.mk to build new style modules.
- Set the file suffix to .kmod
2008-05-02 14:20:50 +00:00