This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

other/490: -static / -shared not equivalent to -Wl,-Bshared / -Wl,-Bdynamic under linux with GNU ld



>Number:         490
>Category:       other
>Synopsis:       -static / -shared not equivalent to -Wl,-Bshared / -Wl,-Bdynamic under linux with GNU ld
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 27 18:16:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     histed@mit.edu
>Release:        2.95.2
>Organization:
>Environment:

>Description:
You can't use -shared and -static in a positional way on the gcc command line with GNU ld under linux: if -static is present without -shared all libraries are linked statically.
However, you can get this effect by passing -B options to the linker.

I'm not sure whether this is a bug or desired functionality.
>How-To-Repeat:
gcc -g -O2 -o prog prog.o -static -lglib -shared -lm
produces an executable with all libraries dynamically linked
but
gcc -g -O2 -o prog prog.o -Wl,-Bstatic -lglib -Wl,-Bdynamic
statically links libglib and nothing else.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]