[LARTC] static linking of /usr/sbin/tc?

2006-07-26 Thread Matthias Ferdinand

Hello,

I am trying to revive an old linux server installation, which still has 
libc5. Sadly, most current software does not compile anymore on this 
system, including the tc utility. As with other tools (net-tools, 
coreutils, procps etc.) I tried to compile and statically link 
(LDFLAGS=-static) on a more recent linux machine and copy the static 
binaries over to the old machine.


But no luck with tc. Even on the host where I compiled it (Debian Sarge 
3.1), the static binary (/usr/local/iproute2-2.6.16-060323/usr/sbin/tc) 
does not see any qdisc:


xoff:~# /sbin/tc qdisc ls dev eth0
qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

xoff:~# /usr/local/iproute2-2.6.16-060323/usr/sbin/tc qdisc ls dev eth0
qdisc pfifo_fast 0: [Unknown qdisc, optlen=20]


The source code makes use of dlopen() / dlsym() functions, which may be the 
reason for the failure. Does anybody know a way to make it work in a static 
binary?


Regards
Matthias

___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] static linking of /usr/sbin/tc?

2006-07-26 Thread Stephen Hemminger
On Wed, 26 Jul 2006 19:25:00 +0200
Matthias Ferdinand <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> I am trying to revive an old linux server installation, which still has 
> libc5. Sadly, most current software does not compile anymore on this 
> system, including the tc utility. As with other tools (net-tools, 
> coreutils, procps etc.) I tried to compile and statically link 
> (LDFLAGS=-static) on a more recent linux machine and copy the static 
> binaries over to the old machine.
> 
> But no luck with tc. Even on the host where I compiled it (Debian Sarge 
> 3.1), the static binary (/usr/local/iproute2-2.6.16-060323/usr/sbin/tc) 
> does not see any qdisc:
> 
> xoff:~# /sbin/tc qdisc ls dev eth0
> qdisc pfifo_fast 0: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
> 
> xoff:~# /usr/local/iproute2-2.6.16-060323/usr/sbin/tc qdisc ls dev eth0
> qdisc pfifo_fast 0: [Unknown qdisc, optlen=20]
> 
> The source code makes use of dlopen() / dlsym() functions, which may be the 
> reason for the failure. Does anybody know a way to make it work in a static 
> binary?
>

The dlopen() stuff is just to allow adding support for new qdisc's later.
It also is introspective, it is used to find the qdisc's that are statically
linked in.  Why bother updating it?

You could with some effort change tc to have a list of qdisc structure
pointers and change get_qdisc_kind to walk the list.
___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] static linking of /usr/sbin/tc?

2006-07-26 Thread Matthias Ferdinand
--On Mittwoch, Juli 26, 2006 12:22:40 -0700 Stephen Hemminger 
<[EMAIL PROTECTED]> wrote:

On Wed, 26 Jul 2006 19:25:00 +0200
Matthias Ferdinand <[EMAIL PROTECTED]> wrote:

But no luck with tc. Even on the host where I compiled it (Debian Sarge
3.1), the static binary (/usr/local/iproute2-2.6.16-060323/usr/sbin/tc)
does not see any qdisc:



You could with some effort change tc to have a list of qdisc structure
pointers and change get_qdisc_kind to walk the list.


Thanks for the answer, but I guess that would be more trouble than it's 
worth, and probably nobody would use that patched stuff except myself. I 
can do QoS stuff on a Linux router nearby, it would have been just 
aesthetically pleasing to have it all available on the old server.


Regards
Matthias
___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc