Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-26 Thread perryh
Gary Jennejohn gljennj...@googlemail.com wrote:

 IMO if you're going to make the binaries in base non-executable
 you might just as well delete them.

The chmod is reversible without having to recover the base binaries
from somewhere.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-25 Thread Gary Jennejohn
On Thu, 24 Jun 2010 09:54:45 -0700
Ted Faber fa...@isi.edu wrote:

 On Thu, Jun 24, 2010 at 08:29:57AM -0700, Ted Faber wrote:
  On Thu, Jun 24, 2010 at 09:40:00AM +0100, Tom Evans wrote:
   I also have this in make.conf:
   CUPS_OVERWRITE_BASE=yes
   WITHOUT_LPR=yes
   
   which print/cups-base uses to do make any lpr related binaries in
   /usr/bin non-executable, so they are skipped over and the cups
   specific ones in /usr/loca/bin are used instead. WITHOUT_LPR just
   stops LPR being built by buildworld.
  
  The clear winner, and one I was unaware of.
  
  Thanks, Tom.
 
 CUPS_OVERWRITE_BASE seems to do an odd thing.  It doesn't install the
 cups binaries in /usr/bin, but it does do a chmod  on everything it
 replaces in /usr/bin .  For example
 
 praxis:~$ ls -l /usr/bin/lpr
 -r-sr-sr-x  1 root  daemon  29876 Jun 24 09:16 /usr/bin/lpr
 # portupgrade -f cups-base-1.4.3
 praxis:~$ ls -l /usr/bin/lpr
 --  1 root  daemon  29876 Jun 24 09:16 /usr/bin/lpr
 
 I'll still use it, but interesting behavior.
 

IMO if you're going to make the binaries in base non-executable you might
just as well delete them.

But CUPS_OVERWRITE_BASE does have the advantage that it works without
(active) user intervention.

--
Gary Jennejohn
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Gary Jennejohn
On Wed, 23 Jun 2010 18:15:09 -0700
Ted Faber fa...@isi.edu wrote:

 (/usr/local/bin/ preceeds /usr/bin in my path so I can use the lpr
 commands from cupsd, though it's evidently a bit of a dangerous idea.)
 
[trimmed Cc]

I use cupsd and have these settings to get around using the base system
lp stuff:

in /etc/src.conf - WITHOUT_LPR=yes

and these symbolic links in /usr/bin
lrwxr-xr-x  1 root  wheel  17 Mar 18  2009 /usr/bin/lp - /usr/local/bin/lp
lrwxr-xr-x  1 root  wheel  24 Mar 18  2009 /usr/bin/lpoptions - 
/usr/local/bin/lpoptions
lrwxr-xr-x  1 root  wheel  18 Mar 18  2009 /usr/bin/lpq - 
/usr/local/bin/lpq
lrwxr-xr-x  1 root  wheel  18 Mar 18  2009 /usr/bin/lpr - 
/usr/local/bin/lpr
lrwxr-xr-x  1 root  wheel  19 Mar 18  2009 /usr/bin/lprm - 
/usr/local/bin/lprm
lrwxr-xr-x  1 root  wheel  21 Mar 18  2009 /usr/bin/lpstat - 
/usr/local/bin/lpstat

and /usr/bin is _before_ /usr/local/bin in my PATH.

 ---
Gary Jennejohn
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Alban Hertroys
On 24 Jun 2010, at 9:23, Gary Jennejohn wrote:

 On Wed, 23 Jun 2010 18:15:09 -0700
 Ted Faber fa...@isi.edu wrote:
 
 (/usr/local/bin/ preceeds /usr/bin in my path so I can use the lpr
 commands from cupsd, though it's evidently a bit of a dangerous idea.)
 
 [trimmed Cc]
 
 I use cupsd and have these settings to get around using the base system
 lp stuff:
 
 in /etc/src.conf - WITHOUT_LPR=yes
 
 and these symbolic links in /usr/bin
 lrwxr-xr-x  1 root  wheel  17 Mar 18  2009 /usr/bin/lp - 
 /usr/local/bin/lp
 lrwxr-xr-x  1 root  wheel  24 Mar 18  2009 /usr/bin/lpoptions - 
 /usr/local/bin/lpoptions
 lrwxr-xr-x  1 root  wheel  18 Mar 18  2009 /usr/bin/lpq - 
 /usr/local/bin/lpq
 lrwxr-xr-x  1 root  wheel  18 Mar 18  2009 /usr/bin/lpr - 
 /usr/local/bin/lpr
 lrwxr-xr-x  1 root  wheel  19 Mar 18  2009 /usr/bin/lprm - 
 /usr/local/bin/lprm
 lrwxr-xr-x  1 root  wheel  21 Mar 18  2009 /usr/bin/lpstat - 
 /usr/local/bin/lpstat
 
 and /usr/bin is _before_ /usr/local/bin in my PATH.


Wouldn't it be easier to alias those commands instead of physically replacing 
them?
In my .tcshrc I have:

alias lp/usr/local/bin/lp
alias lpq   /usr/local/bin/lpq
alias lpr   /usr/local/bin/lpr
alias lprm  /usr/local/bin/lprm

I only have /usr/local/bin/lpoptions on my system (7-STABLE), so I guess that's 
exclusive to CUPS, hence no need for me to alias it.

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:909,4c2317ad286211131610927!


___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Gary Jennejohn
On Thu, 24 Jun 2010 10:30:26 +0200
Alban Hertroys dal...@solfertje.student.utwente.nl wrote:

 On 24 Jun 2010, at 9:23, Gary Jennejohn wrote:
 
  On Wed, 23 Jun 2010 18:15:09 -0700
  Ted Faber fa...@isi.edu wrote:
  
  (/usr/local/bin/ preceeds /usr/bin in my path so I can use the lpr
  commands from cupsd, though it's evidently a bit of a dangerous idea.)
  
  [trimmed Cc]
  
  I use cupsd and have these settings to get around using the base system
  lp stuff:
  
  in /etc/src.conf - WITHOUT_LPR=yes
  
  and these symbolic links in /usr/bin
  lrwxr-xr-x  1 root  wheel  17 Mar 18  2009 /usr/bin/lp - 
  /usr/local/bin/lp
  lrwxr-xr-x  1 root  wheel  24 Mar 18  2009 /usr/bin/lpoptions - 
  /usr/local/bin/lpoptions
  lrwxr-xr-x  1 root  wheel  18 Mar 18  2009 /usr/bin/lpq - 
  /usr/local/bin/lpq
  lrwxr-xr-x  1 root  wheel  18 Mar 18  2009 /usr/bin/lpr - 
  /usr/local/bin/lpr
  lrwxr-xr-x  1 root  wheel  19 Mar 18  2009 /usr/bin/lprm - 
  /usr/local/bin/lprm
  lrwxr-xr-x  1 root  wheel  21 Mar 18  2009 /usr/bin/lpstat - 
  /usr/local/bin/lpstat
  
  and /usr/bin is _before_ /usr/local/bin in my PATH.
 
 
 Wouldn't it be easier to alias those commands instead of physically replacing 
 them?
 In my .tcshrc I have:
 
 alias lp/usr/local/bin/lp
 alias lpq   /usr/local/bin/lpq
 alias lpr   /usr/local/bin/lpr
 alias lprm  /usr/local/bin/lprm
 
 I only have /usr/local/bin/lpoptions on my system (7-STABLE), so I guess 
 that's exclusive to CUPS, hence no need for me to alias it.
 

That's a valid option, of course.  My thought was that the base lp isn't
being installed anyway so it's just as simple to use symbolic links.

--
Gary Jennejohn
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Tom Evans
On Thu, Jun 24, 2010 at 8:23 AM, Gary Jennejohn
gljennj...@googlemail.com wrote:
 On Wed, 23 Jun 2010 18:15:09 -0700
 Ted Faber fa...@isi.edu wrote:

 (/usr/local/bin/ preceeds /usr/bin in my path so I can use the lpr
 commands from cupsd, though it's evidently a bit of a dangerous idea.)

 [trimmed Cc]

 I use cupsd and have these settings to get around using the base system
 lp stuff:

 in /etc/src.conf - WITHOUT_LPR=yes

 and these symbolic links in /usr/bin
 lrwxr-xr-x  1 root  wheel      17 Mar 18  2009 /usr/bin/lp - 
 /usr/local/bin/lp
 lrwxr-xr-x  1 root  wheel      24 Mar 18  2009 /usr/bin/lpoptions - 
 /usr/local/bin/lpoptions
 lrwxr-xr-x  1 root  wheel      18 Mar 18  2009 /usr/bin/lpq - 
 /usr/local/bin/lpq
 lrwxr-xr-x  1 root  wheel      18 Mar 18  2009 /usr/bin/lpr - 
 /usr/local/bin/lpr
 lrwxr-xr-x  1 root  wheel      19 Mar 18  2009 /usr/bin/lprm - 
 /usr/local/bin/lprm
 lrwxr-xr-x  1 root  wheel      21 Mar 18  2009 /usr/bin/lpstat - 
 /usr/local/bin/lpstat

 and /usr/bin is _before_ /usr/local/bin in my PATH.

  ---
 Gary Jennejohn

I also have this in make.conf:
CUPS_OVERWRITE_BASE=yes
WITHOUT_LPR=yes

which print/cups-base uses to do make any lpr related binaries in
/usr/bin non-executable, so they are skipped over and the cups
specific ones in /usr/loca/bin are used instead. WITHOUT_LPR just
stops LPR being built by buildworld.

Cheers

Tom
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-24 Thread Dag-Erling Smørgrav
Andriy Gapon a...@icyb.net.ua writes:
 Yes, you are absolutely correct.  This comes from the fact that amd64 uses 
 simple
 objects files (aka .o) as kernel modules and i386 uses full-blow dso.

The obvious question is: since, as I understand, amd64's solution is
superior, what would it take to switch to .o on other platforms?

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Andrew Reilly
On Thu, Jun 24, 2010 at 09:23:37AM +0200, Gary Jennejohn wrote:
 in /etc/src.conf - WITHOUT_LPR=yes
 
 and these symbolic links in /usr/bin
 lrwxr-xr-x  1 root  wheel  17 Mar 18  2009 /usr/bin/lp - 
 /usr/local/bin/lp
 lrwxr-xr-x  1 root  wheel  24 Mar 18  2009 /usr/bin/lpoptions - 
 /usr/local/bin/lpoptions
 lrwxr-xr-x  1 root  wheel  18 Mar 18  2009 /usr/bin/lpq - 
 /usr/local/bin/lpq
 lrwxr-xr-x  1 root  wheel  18 Mar 18  2009 /usr/bin/lpr - 
 /usr/local/bin/lpr
 lrwxr-xr-x  1 root  wheel  19 Mar 18  2009 /usr/bin/lprm - 
 /usr/local/bin/lprm
 lrwxr-xr-x  1 root  wheel  21 Mar 18  2009 /usr/bin/lpstat - 
 /usr/local/bin/lpstat
 
 and /usr/bin is _before_ /usr/local/bin in my PATH.

Since you have /usr/local/bin in your path, why bother with
the symlinks at all?  Your shell will find them in their new
locations just fine.  You'll want to remove the old ones from
/usr/bin, but make delete-old will probably do that nicely
anyway.

Cheers,

-- 
Andrew
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Tom Evans
On Thu, Jun 24, 2010 at 10:21 AM, Andrew Reilly arei...@bigpond.net.au wrote:
 On Thu, Jun 24, 2010 at 09:23:37AM +0200, Gary Jennejohn wrote:
 in /etc/src.conf - WITHOUT_LPR=yes

 and these symbolic links in /usr/bin
 lrwxr-xr-x  1 root  wheel      17 Mar 18  2009 /usr/bin/lp - 
 /usr/local/bin/lp
 lrwxr-xr-x  1 root  wheel      24 Mar 18  2009 /usr/bin/lpoptions - 
 /usr/local/bin/lpoptions
 lrwxr-xr-x  1 root  wheel      18 Mar 18  2009 /usr/bin/lpq - 
 /usr/local/bin/lpq
 lrwxr-xr-x  1 root  wheel      18 Mar 18  2009 /usr/bin/lpr - 
 /usr/local/bin/lpr
 lrwxr-xr-x  1 root  wheel      19 Mar 18  2009 /usr/bin/lprm - 
 /usr/local/bin/lprm
 lrwxr-xr-x  1 root  wheel      21 Mar 18  2009 /usr/bin/lpstat - 
 /usr/local/bin/lpstat

 and /usr/bin is _before_ /usr/local/bin in my PATH.

 Since you have /usr/local/bin in your path, why bother with
 the symlinks at all?  Your shell will find them in their new
 locations just fine.  You'll want to remove the old ones from
 /usr/bin, but make delete-old will probably do that nicely
 anyway.

 Cheers,

 --
 Andrew

make delete-old removes old deprecated files, not files that weren't
built because of src.conf options. It definitely will not remove the
lpr binaries from /usr/bin if they exist there.

There already is a proper solution for this: if you want to have LPR
from CUPS, and don't want to use LPR from base, then you set these
settings in make.conf:
CUPS_OVERWRITE_BASE=yes
WITHOUT_LPR=yes

With these, lpr in base will not be built, and print/cups-base will
deactivate any base system lpr binaries that are installed. It's
documented in the FreeBSD CUPS article here:
http://www.freebsd.org/doc/en/articles/cups/article.html#PRINTING-CUPS-PORTS-KNOBS

Cheers

Tom
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Alex Dupre
Tom Evans ha scritto:
 make delete-old removes old deprecated files, not files that weren't
 built because of src.conf options.

I think you are wrong:
http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/build/mk/OptionalObsoleteFiles.inc?rev=1.66

-- 
Alex Dupre
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Tom Evans
On Thu, Jun 24, 2010 at 10:45 AM, Alex Dupre a...@freebsd.org wrote:
 Tom Evans ha scritto:
 make delete-old removes old deprecated files, not files that weren't
 built because of src.conf options.

 I think you are wrong:
 http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/build/mk/OptionalObsoleteFiles.inc?rev=1.66

 --
 Alex Dupre


Meh, OK. It didn't used to, there was a discussion about this about 6
months ago, and yes, check the history of that file. This support was
added in February, nothing in /usr/src/UPDATING about it..

Still, besides the point. There is one supported way to get cups-base
lpr used instead of base lpr, and it's got not much to do with 'make
delete-old'.

http://www.freebsd.org/doc/en/articles/cups/article.html#PRINTING-CUPS-PORTS-KNOBS

Cheers

Tom
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Ed Schouten
* Andrew Reilly arei...@bigpond.net.au wrote:
 On Thu, Jun 24, 2010 at 09:23:37AM +0200, Gary Jennejohn wrote:
  in /etc/src.conf - WITHOUT_LPR=yes
  
  and these symbolic links in /usr/bin
  lrwxr-xr-x  1 root  wheel  17 Mar 18  2009 /usr/bin/lp - 
  /usr/local/bin/lp
  lrwxr-xr-x  1 root  wheel  24 Mar 18  2009 /usr/bin/lpoptions - 
  /usr/local/bin/lpoptions
  lrwxr-xr-x  1 root  wheel  18 Mar 18  2009 /usr/bin/lpq - 
  /usr/local/bin/lpq
  lrwxr-xr-x  1 root  wheel  18 Mar 18  2009 /usr/bin/lpr - 
  /usr/local/bin/lpr
  lrwxr-xr-x  1 root  wheel  19 Mar 18  2009 /usr/bin/lprm - 
  /usr/local/bin/lprm
  lrwxr-xr-x  1 root  wheel  21 Mar 18  2009 /usr/bin/lpstat - 
  /usr/local/bin/lpstat
  
  and /usr/bin is _before_ /usr/local/bin in my PATH.
 
 Since you have /usr/local/bin in your path, why bother with
 the symlinks at all?  Your shell will find them in their new
 locations just fine.  You'll want to remove the old ones from
 /usr/bin, but make delete-old will probably do that nicely
 anyway.

In theory, yes. In practice, no. Just for fun, remove your
/usr/sbin/sendmail while having Postfix's /usr/local/sbin/sendmail
installed. It simply won't work. If I remember correctly, you won't even
receive the periodic(8) emails.

Nowadays it's probably better, but I remember in the old days GNOME
would always print through /usr/bin/lpr, even when CUPS is installed.

-- 
 Ed Schouten e...@80386.nl
 WWW: http://80386.nl/


pgp3h4AAkzhyp.pgp
Description: PGP signature


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Ed Schouten
* Mike Meyer m...@mired.org wrote:
 Maybe it's time for /usr/sbin/lpwrapper, to do the same thing for
 print systems?

In my opinion, we should just rename mailwrapper to whateverwrapper and
list the lpr programs in there as well.

-- 
 Ed Schouten e...@80386.nl
 WWW: http://80386.nl/


pgpzwgJfIGCWZ.pgp
Description: PGP signature


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Ted Faber
On Thu, Jun 24, 2010 at 09:40:00AM +0100, Tom Evans wrote:
 I also have this in make.conf:
 CUPS_OVERWRITE_BASE=yes
 WITHOUT_LPR=yes
 
 which print/cups-base uses to do make any lpr related binaries in
 /usr/bin non-executable, so they are skipped over and the cups
 specific ones in /usr/loca/bin are used instead. WITHOUT_LPR just
 stops LPR being built by buildworld.

The clear winner, and one I was unaware of.

Thanks, Tom.


-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgp4QFrvNdcSN.pgp
Description: PGP signature


Re: using cupsd instead of base lpr [was Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)]

2010-06-24 Thread Ted Faber
On Thu, Jun 24, 2010 at 08:29:57AM -0700, Ted Faber wrote:
 On Thu, Jun 24, 2010 at 09:40:00AM +0100, Tom Evans wrote:
  I also have this in make.conf:
  CUPS_OVERWRITE_BASE=yes
  WITHOUT_LPR=yes
  
  which print/cups-base uses to do make any lpr related binaries in
  /usr/bin non-executable, so they are skipped over and the cups
  specific ones in /usr/loca/bin are used instead. WITHOUT_LPR just
  stops LPR being built by buildworld.
 
 The clear winner, and one I was unaware of.
 
 Thanks, Tom.

CUPS_OVERWRITE_BASE seems to do an odd thing.  It doesn't install the
cups binaries in /usr/bin, but it does do a chmod  on everything it
replaces in /usr/bin .  For example

praxis:~$ ls -l /usr/bin/lpr
-r-sr-sr-x  1 root  daemon  29876 Jun 24 09:16 /usr/bin/lpr
# portupgrade -f cups-base-1.4.3
praxis:~$ ls -l /usr/bin/lpr
--  1 root  daemon  29876 Jun 24 09:16 /usr/bin/lpr

I'll still use it, but interesting behavior.

-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgpMBBMf5Jte6.pgp
Description: PGP signature


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Andriy Gapon
on 23/06/2010 03:38 Hans Petter Selasky said the following:
 Hi,
 
 I'm creating a new thread on this issue.
 
 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
 
 It appears many kmods are broken because the linker is stripping away static 
 data declared with the section attribute in FreeBSD 8.1-RC1.
 
 cite
 
 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.
 
 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.0 -0800
 +++ Makefile.kmod   2010-06-22 14:02:52.0 -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:275c r
 __set_sysinit_set_sym_cuse_kern_init_sys_init
 /boot/modules/cuse4bsd.ko:2758 r 
 __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit
 /boot/modules/cuse4bsd.ko:3194 d cuse_kern_init_sys_init
 /boot/modules/cuse4bsd.ko:3184 d cuse_kern_uninit_sys_uninit

I am not sure if this analysis is correct.
I tested on head and stable/8 and my nm output is exactly like above (bad
module), still the module loads fine and creates /dev/cuse.

I don't think there were any recent changes related to build infrastructure or
linker in 8.1.

Please consider other possibilities.

 Good module:
 
 $ nm -o ./cuse4bsd.ko  | grep sys
 ./cuse4bsd.ko:28cc r __set_sysinit_set_sym_cuse_kern_init_sys_init
 ./cuse4bsd.ko:28c8 r __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit
 ./cuse4bsd.ko: U __start_set_sysctl_set
 ./cuse4bsd.ko:28cc A __start_set_sysinit_set
 ./cuse4bsd.ko:28c8 A __start_set_sysuninit_set
 ./cuse4bsd.ko: U __stop_set_sysctl_set
 ./cuse4bsd.ko:28d0 A __stop_set_sysinit_set
 ./cuse4bsd.ko:28cc A __stop_set_sysuninit_set
 ./cuse4bsd.ko:3194 d cuse_kern_init_sys_init
 ./cuse4bsd.ko:3184 d cuse_kern_uninit_sys_uninit
 
 /cite

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Hans Petter Selasky
On Wednesday 23 June 2010 08:47:52 Andriy Gapon wrote:
 on 23/06/2010 03:38 Hans Petter Selasky said the following:
  Hi,
 
  I'm creating a new thread on this issue.
 
  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
 
  It appears many kmods are broken because the linker is stripping away
  static data declared with the section attribute in FreeBSD 8.1-RC1.
 
  cite
 
  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.
 
  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.0 -0800
  +++ Makefile.kmod   2010-06-22 14:02:52.0 -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:275c r
  __set_sysinit_set_sym_cuse_kern_init_sys_init
  /boot/modules/cuse4bsd.ko:2758 r
  __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit
  /boot/modules/cuse4bsd.ko:3194 d cuse_kern_init_sys_init
  /boot/modules/cuse4bsd.ko:3184 d cuse_kern_uninit_sys_uninit
 
 I am not sure if this analysis is correct.
 I tested on head and stable/8 and my nm output is exactly like above (bad
 module), still the module loads fine and creates /dev/cuse.
 
 I don't think there were any recent changes related to build infrastructure
  or linker in 8.1.
 
 Please consider other possibilities.

I installed PC-BSD 8.1-RC1 and the stock cuse4bsd module is broken. Andriy, 
make sure that you re-make the toolchain before building the module in 
question. Also I think you have to:

cd /usr/src ; make buildenv TARGET_ARCH=xxx_target 

Then you cd to the module directory and type make.

--HPS
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Andriy Gapon
on 23/06/2010 09:52 Hans Petter Selasky said the following:
 On Wednesday 23 June 2010 08:47:52 Andriy Gapon wrote:
 on 23/06/2010 03:38 Hans Petter Selasky said the following:
 Hi,

 I'm creating a new thread on this issue.

 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
 It appears many kmods are broken because the linker is stripping away
 static data declared with the section attribute in FreeBSD 8.1-RC1.

 cite

 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.

 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.0 -0800
 +++ Makefile.kmod   2010-06-22 14:02:52.0 -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:275c r
 __set_sysinit_set_sym_cuse_kern_init_sys_init
 /boot/modules/cuse4bsd.ko:2758 r
 __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit
 /boot/modules/cuse4bsd.ko:3194 d cuse_kern_init_sys_init
 /boot/modules/cuse4bsd.ko:3184 d cuse_kern_uninit_sys_uninit
 I am not sure if this analysis is correct.
 I tested on head and stable/8 and my nm output is exactly like above (bad
 module), still the module loads fine and creates /dev/cuse.

 I don't think there were any recent changes related to build infrastructure
  or linker in 8.1.

 Please consider other possibilities.
 
 I installed PC-BSD 8.1-RC1 and the stock cuse4bsd module is broken.

I don't dispute that it is found broken in particular environments, I just think
that the analysis could be incorrect.

 Andriy, 
 make sure that you re-make the toolchain before building the module in 
 question. Also I think you have to:
 
 cd /usr/src ; make buildenv TARGET_ARCH=xxx_target 
 
 Then you cd to the module directory and type make.

I don't think that this is needed when _not_ cross-building for a different
architecture.

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Andriy Gapon
on 23/06/2010 10:02 Andriy Gapon said the following:
 I don't dispute that it is found broken in particular environments, I just 
 think
 that the analysis could be incorrect.

Which also brings the question - what arch(s) is affected?
I tested on amd64.

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Hans Petter Selasky
On Wednesday 23 June 2010 09:10:59 Andriy Gapon wrote:
 on 23/06/2010 10:02 Andriy Gapon said the following:
  I don't dispute that it is found broken in particular environments, I
  just think that the analysis could be incorrect.

Ok.

 
 Which also brings the question - what arch(s) is affected?
 I tested on amd64.
 

I tested on i386.

--HPS
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Kris Moore

On 06/23/2010 02:52, Hans Petter Selasky wrote:

On Wednesday 23 June 2010 08:47:52 Andriy Gapon wrote:
   

on 23/06/2010 03:38 Hans Petter Selasky said the following:
 

Hi,

I'm creating a new thread on this issue.

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
 

It appears many kmods are broken because the linker is stripping away
static data declared with the section attribute in FreeBSD 8.1-RC1.

cite

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.

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.0 -0800
+++ Makefile.kmod   2010-06-22 14:02:52.0 -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
+
+
  .includebsd.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:275c r
__set_sysinit_set_sym_cuse_kern_init_sys_init
/boot/modules/cuse4bsd.ko:2758 r
__set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit
/boot/modules/cuse4bsd.ko:3194 d cuse_kern_init_sys_init
/boot/modules/cuse4bsd.ko:3184 d cuse_kern_uninit_sys_uninit
   

I am not sure if this analysis is correct.
I tested on head and stable/8 and my nm output is exactly like above (bad
module), still the module loads fine and creates /dev/cuse.

I don't think there were any recent changes related to build infrastructure
  or linker in 8.1.

Please consider other possibilities.
 

I installed PC-BSD 8.1-RC1 and the stock cuse4bsd module is broken. Andriy,
make sure that you re-make the toolchain before building the module in
question. Also I think you have to:

cd /usr/src ; make buildenv TARGET_ARCH=xxx_target

Then you cd to the module directory and type make.

--HPS
   


Are you going to be updating the port soon to fix the build? We're just 
doing a regular make install on the cuse4bsd-kmod port for our RC1 
build, and it would be nice to have this fixed for 8.1-Release.



--
Kris Moore
PC-BSD Software
iXsystems

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Hans Petter Selasky
On Wednesday 23 June 2010 16:43:31 Kris Moore wrote:
 On 06/23/2010 02:52, Hans Petter Selasky wrote:
  On Wednesday 23 June 2010 08:47:52 Andriy Gapon wrote:
  on 23/06/2010 03:38 Hans Petter Selasky said the following:
  Hi,
 
  I'm creating a new thread on this issue.
 
  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
 
  It appears many kmods are broken because the linker is stripping away
  static data declared with the section attribute in FreeBSD 8.1-RC1.
 
  cite
 
  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.
 
  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.0 -0800
  +++ Makefile.kmod   2010-06-22 14:02:52.0 -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
  +
  +
.includebsd.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:275c r
  __set_sysinit_set_sym_cuse_kern_init_sys_init
  /boot/modules/cuse4bsd.ko:2758 r
  __set_sysuninit_set_sym_cuse_kern_uninit_sys_uninit
  /boot/modules/cuse4bsd.ko:3194 d cuse_kern_init_sys_init
  /boot/modules/cuse4bsd.ko:3184 d cuse_kern_uninit_sys_uninit
 
  I am not sure if this analysis is correct.
  I tested on head and stable/8 and my nm output is exactly like above
  (bad module), still the module loads fine and creates /dev/cuse.
 
  I don't think there were any recent changes related to build
  infrastructure or linker in 8.1.
 
  Please consider other possibilities.
 
  I installed PC-BSD 8.1-RC1 and the stock cuse4bsd module is broken.
  Andriy, make sure that you re-make the toolchain before building the
  module in question. Also I think you have to:
 
  cd /usr/src ; make buildenv TARGET_ARCH=xxx_target
 
  Then you cd to the module directory and type make.
 
  --HPS
 
 Are you going to be updating the port soon to fix the build? We're just
 doing a regular make install on the cuse4bsd-kmod port for our RC1
 build, and it would be nice to have this fixed for 8.1-Release.
 

Hi,

Not unless there is a bug in my module. I'm a little bit busy right now, 
though I think that other modules like fuse.ko might be affected aswell. 

Could you try to make a cuse4bsd build on a stock 8-stable and compare the 
resulting cuse4bsd.ko (i386 build) like described earlier in this thread.

Or something like this:

objdump -D -x cuse4bsd.ko  a.txt
objdump -D -x cuse4bsd.ko  b.txt

diff -u a.txt b.txt

What compiler did you bundle with the PCBSD 8.1 RC1 and how did you build the 
cuse4bsd ports module? Did you use something like clang?

I haven't checked too much yet, but it appears that like Andriy is reporting 
that it's not a problem for everyone. When booting PCBSD 8.1 RC1 you will see 
warnings from the webcamd rc.d.

--HPS
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Ted Faber
On Wed, Jun 23, 2010 at 10:10:59AM +0300, Andriy Gapon wrote:
 on 23/06/2010 10:02 Andriy Gapon said the following:
  I don't dispute that it is found broken in particular environments, I just 
  think
  that the analysis could be incorrect.
 
 Which also brings the question - what arch(s) is affected?
 I tested on amd64.

Right.  I'm i386 and I have the problem.  Good point!

-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgpVLIqZ5Js9n.pgp
Description: PGP signature


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Ryan Stone
On Wed, Jun 23, 2010 at 3:10 AM, Andriy Gapon a...@icyb.net.ua wrote:

 Which also brings the question - what arch(s) is affected?
 I tested on amd64.

This should explain it.  It looks to me like i386 uses kern/link_elf.c
as its linker, while amd64 uses kern/link_elf_obj.c.  link_elf.c can
only find the sections containing the sysinits(and some related
things) via the magic symbols.  link_elf_obj.c seems to understand ELF
objects much better and doesn't need those symbols to be present.  It
just looks up the section that contains the sysinits directly via the
ELF metadata that is already present.

As far as I can tell, amd64 is the only arch in the tree that uses
link_elf_obj.c, so all other arches may be affected.

I have to admit that I'm more than a little surprised that this
problem does not affect modules that in src, but maybe that's because
I don't know all that much about FreeBSD's build infrastructure.  Are
the src modules being linked with a linker script that is not being
used for out-of-src modules?  Are the people affected by this not
using the base compiler to build ports?(I see that this affects PC-BSD
as well, and I'd be a little surprised to learn that it wasn't using
the base compiler).

The link line that I gave was a hack.  The proper solution is to use a
linker script that unconditionally puts the magic symbols in.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Kris Moore

On 06/23/2010 10:55, Hans Petter Selasky wrote:


Hi,

Not unless there is a bug in my module. I'm a little bit busy right now,
though I think that other modules like fuse.ko might be affected aswell.

Could you try to make a cuse4bsd build on a stock 8-stable and compare the
resulting cuse4bsd.ko (i386 build) like described earlier in this thread.

Or something like this:

objdump -D -x cuse4bsd.ko  a.txt
objdump -D -x cuse4bsd.ko  b.txt

diff -u a.txt b.txt
   
I'll have to try that on another system, all amd64 here, and rebuilding 
the port gives identical cuse4bsd.ko to what we already include in system.



What compiler did you bundle with the PCBSD 8.1 RC1 and how did you build the
cuse4bsd ports module? Did you use something like clang?

   
The system is just regular FreeBSD 8.1-RC1, no clang or other funky make 
options.


The port was built with in a chroot environment with the stock FreeBSD 
8.1-RC1 loaded in it.



I haven't checked too much yet, but it appears that like Andriy is reporting
that it's not a problem for everyone. When booting PCBSD 8.1 RC1 you will see
warnings from the webcamd rc.d.

--HPS
   
Yea, i see the error messages here as well, but only on my laptop. My 
desktops use the same build, but don't throw the error, even though 
cuse4bsd is loaded. (Of course they don't have a webcam connected, which 
I'm sure is part of it)




--
Kris Moore
PC-BSD Software
iXsystems

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Andriy Gapon
on 23/06/2010 18:03 Ryan Stone said the following:
 On Wed, Jun 23, 2010 at 3:10 AM, Andriy Gapon a...@icyb.net.ua wrote:
 Which also brings the question - what arch(s) is affected?
 I tested on amd64.
 
 This should explain it.  It looks to me like i386 uses kern/link_elf.c
 as its linker, while amd64 uses kern/link_elf_obj.c.  link_elf.c can
 only find the sections containing the sysinits(and some related
 things) via the magic symbols.  link_elf_obj.c seems to understand ELF
 objects much better and doesn't need those symbols to be present.  It
 just looks up the section that contains the sysinits directly via the
 ELF metadata that is already present.

Yes, you are absolutely correct.  This comes from the fact that amd64 uses 
simple
objects files (aka .o) as kernel modules and i386 uses full-blow dso.

 As far as I can tell, amd64 is the only arch in the tree that uses
 link_elf_obj.c, so all other arches may be affected.
 
 I have to admit that I'm more than a little surprised that this
 problem does not affect modules that in src, but maybe that's because
 I don't know all that much about FreeBSD's build infrastructure.  Are
 the src modules being linked with a linker script that is not being
 used for out-of-src modules?

No, we don't have any special linker script for modules.

 Are the people affected by this not
 using the base compiler to build ports?(I see that this affects PC-BSD
 as well, and I'd be a little surprised to learn that it wasn't using
 the base compiler).

I think that even out-of-base modules still use the same module build
infrastructure (bsd.kmod.mk).  At least this is the case for cuse4bsd.

 The link line that I gave was a hack.  The proper solution is to use a
 linker script that unconditionally puts the magic symbols in.

Module link process on i386 is like this (simplified):
1) combine object files into a single object file mod.kld
ld -r -o mod.kld 1.o 2.o
2) convert it to dso
ld -Bshareable -d -warn-common -o mod.ko mod.kld

I believe that __start/__stop symbols for sections should be automatically added
at step 2 by linker.

Reference:
http://sourceware.org/binutils/docs/ld/Orphan-Sections.html#Orphan-Sections

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-23 Thread Ted Faber
On Wed, Jun 23, 2010 at 11:03:45AM -0400, Ryan Stone wrote:
 I have to admit that I'm more than a little surprised that this
 problem does not affect modules that in src, but maybe that's because
 I don't know all that much about FreeBSD's build infrastructure.  Are
 the src modules being linked with a linker script that is not being
 used for out-of-src modules?  Are the people affected by this not
 using the base compiler to build ports?(I see that this affects PC-BSD
 as well, and I'd be a little surprised to learn that it wasn't using
 the base compiler).

I had the problem on i386, base compiler.  It also affects the sample
module in /usr/share/examples/kld/cdev/ which also uses the base
compiler, if you want a case w/o th eports infrastructure.

-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgpk7CXCsISMP.pgp
Description: PGP signature


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 (solved)

2010-06-23 Thread Ted Faber
On Wed, Jun 23, 2010 at 08:45:31AM -0700, Ted Faber wrote:
 On Wed, Jun 23, 2010 at 11:03:45AM -0400, Ryan Stone wrote:
  I have to admit that I'm more than a little surprised that this
  problem does not affect modules that in src, but maybe that's because
  I don't know all that much about FreeBSD's build infrastructure.  Are
  the src modules being linked with a linker script that is not being
  used for out-of-src modules?  Are the people affected by this not
  using the base compiler to build ports?(I see that this affects PC-BSD
  as well, and I'd be a little surprised to learn that it wasn't using
  the base compiler).
 
 I had the problem on i386, base compiler.  It also affects the sample
 module in /usr/share/examples/kld/cdev/ which also uses the base
 compiler, if you want a case w/o the ports infrastructure.

Just so it gets into Google:

Andriy Gapon went a few rounds of debugging with me and it turns out
that the problem was that the binutils port had installed a loader in
/usr/local/bin/ld that was incompatible with the module system.
(/usr/local/bin/ preceeds /usr/bin in my path so I can use the lpr
commands from cupsd, though it's evidently a bit of a dangerous idea.)
Basically if the linker you're using to compile isn't /usr/bin/ld you
may have problems building kernel modules.

The easiest way to detect this is to get the -v output (version number)
from the linker in use and compare it against /usr/bin/ld .  I was able
to do that by adding LDFLAGS += -v to the Makefile in question.

Thanks Andriy!

-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgpXJGFp1X6q8.pgp
Description: PGP signature


Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

2010-06-22 Thread Ted Faber
On Wed, Jun 23, 2010 at 02:38:06AM +0200, Hans Petter Selasky wrote:
 It appears many kmods are broken because the linker is stripping away static 
 data declared with the section attribute in FreeBSD 8.1-RC1.
 
 cite
 
 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.

Hi.

I'm the fellow in Hans's cite.../cite.

If someone's looking into this, it's worth mentioning that the sample
cdev kmodule in /usr/share/examples/kld/cdev/ also exhibits the
behavior.  On my 8.1-PRERELEASE system that module does not create the
/dev/cedv device, but if you add the line 

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

right before the 

.include bsd.kmod.mk

in /usr/share/examples/kld/cdev/module/Makefile and remake everything,
the module creates the /dev/cdev file when it's loaded.

That magical line was suggested by Ryan Stone in another thread:
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=120718+0+current/freebsd-hackers

Happy hunting, and I'm happy to test patches or provide more information.

-- 
Ted Faber
http://www.isi.edu/~faber   PGP: http://www.isi.edu/~faber/pubkeys.asc
Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#SIG


pgploXUNQKXc1.pgp
Description: PGP signature