public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: other/5235: -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic combo fails
@ 2003-05-13  6:50 steven
  0 siblings, 0 replies; 3+ messages in thread
From: steven @ 2003-05-13  6:50 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, swansma

Synopsis: -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic combo fails

State-Changed-From-To: open->feedback
State-Changed-By: steven
State-Changed-When: Tue May 13 06:50:46 2003
State-Changed-Why:
    Old PR -- Dara has asked for feedback

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5235


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: other/5235: -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic combo fails
@ 2003-05-13  1:16 Dara Hazeghi
  0 siblings, 0 replies; 3+ messages in thread
From: Dara Hazeghi @ 2003-05-13  1:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR other/5235; it has been noted by GNATS.

From: Dara Hazeghi <dhazeghi@yahoo.com>
To: swansma@yahoo.com, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: other/5235: -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic combo fails
Date: Mon, 12 May 2003 18:08:26 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=5235
 
 Hello,
 
 gcc 3.0.3 is quite old. Would it be possible for you to determine  
 whether this problem still occurs on a more current version of gcc (ie  
 3.2.3)? Thanks,
 
 Dara
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* other/5235: -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic combo fails
@ 2002-01-01 14:06 swansma
  0 siblings, 0 replies; 3+ messages in thread
From: swansma @ 2002-01-01 14:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5235
>Category:       other
>Synopsis:       -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic combo fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 01 14:06:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     swansma@yahoo.com
>Release:        unknown-1.0
>Organization:
>Environment:
binutils-2.11.92.0.12-1mdk.i586.rpm
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.0.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share/gcc-3.0.3 --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-cstdio=stdio --enable-clocale=generic --enable-languages=c,c++,f77,objc,java --program-suffix=-3.0.3 --enable-objc-gc --host=i586-mandrake-linux-gnu
Thread model: posix
gcc version 3.0.3 (Mandrake Linux 8.2 3.0.3-1mdk)
>Description:
It is not possible to mix static and dynamic linking
with gcc-3.0.2 or gcc-3.0.3.

Included are some pasted sample targets. Some are obviously
not correct.

I also note that unless you do it incorrectly the library
is (incorrectly) specified in the static and dynamic sections.

F.E. g++-3.0.3 -v vec.cpp -o vec -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
will place -lstdc++ in the static and dynamic section.

To get this library only listed in the static section you must
use an incorrect format:

g++-3.0.3 -v vec.cpp -o vec -Wl,-Bstatic,-lstdc++ -Wl,-Bdynamic

In any case, even though the library is only in the static
section it still will not link statically.

>How-To-Repeat:
None of the following make targets work:

vec: vec.o Makefile
    ld -o vec vec.o /usr/lib/crt1.o /usr/lib/crti.o \
    /usr/lib/gcc-lib/i586-mandrake-linux-gnu/${GCCVER}/crtbegin.o \
    -L/usr/lib/gcc-lib/i586-mandrake-linux-gnu/${GCCVER} \
    -lm -lgcc_s -lc -lgcc -lstdc++ \
    /usr/lib/gcc-lib/i586-mandrake-linux-gnu/${GCCVER}/crtend.o \
    /usr/lib/crtn.o

vec2: vec.o
    ld -o vec2 vec.o /usr/lib/crt1.o /usr/lib/crti.o \
    /usr/lib/gcc-lib/i586-mandrake-linux-gnu/${GCCVER}/crtbegin.o \
    -L/usr/lib/gcc-lib/i586-mandrake-linux-gnu/${GCCVER} \
    -Bstatic -lstdc++ \
    -Bdynamic -lm -lgcc_s -lc -lgcc \
    /usr/lib/gcc-lib/i586-mandrake-linux-gnu/${GCCVER}/crtend.o \
    /usr/lib/crtn.o

vec3: vec.cpp Makefile
    ${CPP} -v vec.cpp \
    /usr/lib/gcc-lib/i586-mandrake-linux-gnu/${GCCVER}/libstdc++.a \
    -L/usr/lib/gcc-lib/i586-mandrake-linux-gnu/${GCCVER} \
    -lm -lgcc_s -lc -lgcc \
    -o vec3

vec4: vec.cpp Makefile
    ${CPP} -v vec.cpp -o vec4 -Wl,-Bstatic -lstdc++ -lm -Wl,-Bdynamic

vec5: vec.cpp Makefile
    ${CPP} -v vec.cpp -o vec5 -Wl,-static,-lstdc++,-lm

vec6: vec.cpp Makefile
    ${CPP} -v vec.cpp -o vec6 -static

vec7: vec.cpp Makefile
    ${CPP} -v vec.cpp -o vec7 -static -lstdc++ -lm -Wl,-Bdynamic
>Fix:
If some libraries must be linked statically (as is my case)
there is no option but to use "gcc -static" to statically
link the entire executable.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="vec.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="vec.cpp"

Ly8KLy8gJElkOiB2ZWMuY3BwLHYgMS4zIDIwMDEvMTEvMTQgMTk6MTg6NTAgbXN3YW5zb24gRXhw
ICQKLy8KCiNpbmNsdWRlIDx2ZWN0b3I+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4o
aW50IGFyZ2MsIGNoYXIqKiBhcmd2KSB7CgkKCXZlY3RvcjxpbnQ+IHg7Cgl4LnB1c2hfYmFjaygw
KTsKCglyZXR1cm4gMDsKfQoK


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-13  6:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-13  6:50 other/5235: -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic combo fails steven
  -- strict thread matches above, loose matches on Subject: below --
2003-05-13  1:16 Dara Hazeghi
2002-01-01 14:06 swansma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).