Date: Wed, 23 Jun 2010 16:34:56 +0300 From: "Sergey V. Dyatko" <sergey.dyatko@gmail.com> To: Hans Petter Selasky <hselasky@c2i.net> Cc: freebsd-multimedia@freebsd.org Subject: Re: building world with debugging symbols [broken?] Message-ID: <20100623163456.17002d41@tiger.minsk.domain> In-Reply-To: <20100622210721.GC18012@zod.isi.edu> References: <permail-20100305171533f7e55a9d0000225a-a_best01@message-id.uni-muenster.de> <201003301510.58203.jhb@freebsd.org> <87bpe4ps9m.fsf@kobe.laptop> <201006222208.23271.hselasky@c2i.net> <AANLkTimD3Hcjqpy2w9Q0tvVDJ01gCH1ClSQCj2c4MFBz@mail.gmail.com> <20100622210721.GC18012@zod.isi.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 22 Jun 2010 14:07:21 -0700 Ted Faber <faber@isi.edu> wrote: > On Tue, Jun 22, 2010 at 04:39:17PM -0400, Ryan Stone wrote: > > I saw similar behaviour a couple of years ago when I switched from > > using gcc 4.0.2 to gcc 4.3.0 to compile some out-of-tree KLD > > modules. The problem ended up being a change in the linker script > > used by GNU ld for linking kernel modules. It used to always put > > some magic symbols used by the linker to implement things like > > sysinits into the module. It was changed to only provide those > > symbols, which apparently means that the linker would discard those > > symbols if nothing referenced them(and nothing did reference > > them). I had to work around it by adding the following to my link > > line: > > > > -u __start_set_sysinit_set -u __start_set_sysuninit_set \ > > -u __start_set_sysctl_set -u __start_set_modmetadata_set \ > > -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ > > -u __stop_set_sysctl_set -u __stop_set_modmetadata_set > > HPS: > > I added those lines to the LDFLAGS in Makefile.kmod in the cuse4bsd > port made the module and the result loads and creates the /dev/cuse > file. > works fine for me too. pwcview and mplayer (mplayer tv:// -tv driver=v4l[12]:width=640:height=480:device=/dev/video0) but, unfortunately skype doesn't work:(( > Here's a diff relative to > /usr/ports/multimedia/cuse4bsd-kmod/work/cuse4bsd-kmod-0.1.11 just so > it's clear what I did. > > > --- Makefile.kmod.orig 2010-02-11 03:28:02.000000000 -0800 > +++ Makefile.kmod 2010-06-22 14:02:52.000000000 -0700 > @@ -30,4 +30,10 @@ > KMOD= cuse4bsd > SRCS= cuse4bsd_kmod.c device_if.h bus_if.h vnode_if.h > > +LDFLAGS += -u __start_set_sysinit_set -u __start_set_sysuninit_set \ > + -u __start_set_sysctl_set -u __start_set_modmetadata_set \ > + -u __stop_set_sysinit_set -u __stop_set_sysuninit_set \ > + -u __stop_set_sysctl_set -u __stop_set_modmetadata_set > + > + > .include <bsd.kmod.mk> > > Running nm -o on the two modules, the difference seems to be that the > -u results in some additional absolute symbols being defined: > > Bad module: > $ nm -o /boot/modules/cuse4bsd.ko| grep sys > /boot/modules/cuse4bsd.ko:0000275c r > __set_sysinit_set_sym_cuse_kern_init_sys_init > /boot/modules/cuse4bsd.ko:00002758 r > __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit /boot/modules/cuse4bsd.ko:00003194 > d cuse_kern_init_sys_init /boot/modules/cuse4bsd.ko:00003184 d > cuse_kern_uninit_sys_uninit > > Good module: > > $ nm -o ./cuse4bsd.ko | grep sys > ./cuse4bsd.ko:000028cc r __set_sysinit_set_sym_cuse_kern_init_sys_init > ./cuse4bsd.ko:000028c8 r > __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit ./cuse4bsd.ko: > U __start_set_sysctl_set ./cuse4bsd.ko:000028cc A > __start_set_sysinit_set ./cuse4bsd.ko:000028c8 A > __start_set_sysuninit_set ./cuse4bsd.ko: U > __stop_set_sysctl_set ./cuse4bsd.ko:000028d0 A __stop_set_sysinit_set > ./cuse4bsd.ko:000028cc A __stop_set_sysuninit_set > ./cuse4bsd.ko:00003194 d cuse_kern_init_sys_init > ./cuse4bsd.ko:00003184 d cuse_kern_uninit_sys_uninit > > -- wbr, tiger
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100623163456.17002d41>
