Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40658 - brain dead logic in module-init-tools-3.0_pre9
Summary: brain dead logic in module-init-tools-3.0_pre9
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High blocker (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-06 16:44 UTC by solar (RETIRED)
Modified: 2004-02-07 07:09 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description solar (RETIRED) gentoo-dev 2004-02-06 16:44:31 UTC
I don't use 2.6.x at all but I need to develop a patch for it. On my first unpack,compile I noticed during it's compile that it seems to have some 
brain dead logic.
-Wl,-Bstatic -Wl,-Bdynamic <-- this really does not make any sense to me.

I'm going to try to dig up some other toolchain guru's to 
comment on this as it could possibly cause a whole array of problems.

Reproducible: Always
Steps to Reproduce:
1. ebuild  module-init-tools-3.0_pre9.ebuild clean unpack compile
2.
3.

Actual Results:  
gcc  -Wunused -Wall   -o insmod.static -static insmod.o  
gcc  -Wunused -Wall   -o lsmod  lsmod.o -Wl,-Bstatic -lz -Wl,-Bdynamic 
gcc  -Wunused -Wall   -o insmod  insmod.o -Wl,-Bstatic -lz -Wl,-Bdynamic 
gcc  -Wunused -Wall   -o modprobe  modprobe.o zlibsupport.o -Wl,-Bstatic -lz
-Wl,-Bdynamic 
gcc  -Wunused -Wall   -o rmmod  rmmod.o -Wl,-Bstatic -lz -Wl,-Bdynamic 
gcc  -Wunused -Wall   -o depmod  depmod.o moduleops.o tables.o zlibsupport.o
-Wl,-Bstatic -lz -Wl,-Bdynamic 
gcc  -Wunused -Wall   -o modinfo  modinfo.o zlibsupport.o -Wl,-Bstatic -lz
-Wl,-Bdynamic

Expected Results:  
sane logic to be used.
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2004-02-06 17:00:57 UTC
Yeah, this is rather silly as -Bstatic and -Bdynamic knock each other out: and a library has to be either static, or dynamic: it seems to go the dynamic route as that's how the flags are parsed but who knows what GCC might do on a bad day...

Secondly, the Makefile makes insmod.static elsewhere in a detached section so I don't see why -Bstatic is there...
Comment 2 solar (RETIRED) gentoo-dev 2004-02-06 17:52:49 UTC
plasmaroo,

So would you say that this is really this is an upstream bug?

If so then somebody should touch base. I'm not planning on doing the follow up with this cuz I'm not willing to do the testing.
Comment 3 SpanKY gentoo-dev 2004-02-06 17:59:07 UTC
rusty: take a look at this for us please ?
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-06 21:39:52 UTC
I do not see what the problem is:

--
gcc  -g -O2 -Wunused -Wall   -o modinfo  modinfo.o zlibsupport.o -Wl,-Bstatic -lz -Wl,-Bdynamic
--

means, link in zlib's static lib, but have the binary dynamic (in above case
modinfo).  Anything I missed?
Comment 5 Rusty Russell 2004-02-06 22:44:31 UTC
This, in fact, is how you make one library static while the others are dynamic.

In this case, it's zlib, and if you look in configure.in, you'll see this comment:
# If zlib is required, libz must be linked static, modprobe is in
# /sbin, libz is in /usr/lib and may not be available when it is run.

If you're going to use emotionally charged phrases like "brain dead" and "expect sane logic to be used", here's some free advice:

1) Make DAMN sure you know exactly what you are talking about,

2) Make sure that the mistake is not your own, and

3) Picture the last time you thought (1) and (2) were correct and you made
   a complete dick of yourself when it turned out neither were true.

For me, doing these three has significantly reduced the number of people who think I'm an arrogant git.

Hope that helps you too,
Rusty.
Comment 6 solar (RETIRED) gentoo-dev 2004-02-07 07:09:33 UTC
Rusty, 

Thank you for your insight. I've also checked with others and you are absolutely correct. I had not seen this type of linking done before and was fishing more for a technical explanation if that was the intended behavior.
I'll also note to be a tad more carefull about the wording I use when inquiring about such things in the future.

changing resolution to INVALID