#458 ld mingw CRASH making a static library

OTHER
closed
binutils (105)
wont-fix
Known_bugs
2013-01-22
2003-11-20
Leo
No

Hi,

mingw ld crashes when linking the attached .o files, built
from respective .cpp files to make a STATIC .a library.

Used both latest and candidate versions of mingw
binutils.

Please let me know it you fix the error or if I'm doing
something wrong, I'm eager to run my app using
mingw ;).

Thanks.

PD:
Also, I tried to compile ld from the src distribution so as
to debug ld, but when making I get this error:

$ make
make[1]: Entering directory `/home/Leo/binutils-2.14.90-
20030807-1/libiberty'
make[2]: Entering directory `/home/Leo/binutils-2.14.90-
20030807-1/libiberty/testsuite'
make[2]: Nothing to be done for `all'.

... ETC ...

Making all in po
make[3]: Entering directory `/home/Leo/binutils-2.14.90-
20030807-1/binutils/po'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/Leo/binutils-2.14.90-
20030807-1/binutils/po'
make[3]: Entering directory `/home/Leo/binutils-2.14.90-
20030807-1/binutils'
/bin/sh ./../ylwrap "" arparse.y y.tab.c arparse.c y.tab.h
arparse.h -- -d
./../ylwrap: -d: command not found
make[3]: *** [arparse.c] Error 1
make[3]: Leaving directory `/home/Leo/binutils-2.14.90-
20030807-1/binutils'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/Leo/binutils-2.14.90-
20030807-1/binutils'
make[1]: *** [all-recursive-am] Error 2
make[1]: Leaving directory `/home/Leo/binutils-2.14.90-
20030807-1/binutils'
make: *** [all-binutils] Error 2

Discussion

  • Leo

    Leo - 2003-11-20

    zipped .o files to make static .a library

     
  • Danny Smith

    Danny Smith - 2003-11-20

    Logged In: YES
    user_id=11494

    You didn't tell us what your command line was.
    Are you using ar?
    ar rc libfoo.a *.o should buyild a static lib.

    Danny

     
  • Leo

    Leo - 2003-11-22

    Logged In: YES
    user_id=913502

    Hi,

    Sorry, no I didn't attach the command line. I was using ld to
    make the static lib, since that is the configuration "RedHat
    Source Navigator" generated for the static lib project.

    This is what SN generated:

    LINKER = gcc
    LINKER_FLAGS =
    LINKER_ENTRY =
    win32_OBJECTS = Archiver.o CritSec.o File.o MsgLog.o
    NetSocket.o System.o Tasker.o Util.o

    all: util.a

    util.a: $(win32_OBJECTS)
    $(LINKER) -r util.a $(LINKER_ENTRY)
    $(LINKER_FLAGS) $(win32_OBJECTS) $(win32_LIBS)

    which would become something like:

    gcc -r util.a Archiver.o CritSec.o File.o MsgLog.o NetSocket.o
    System.o Tasker.o Util.o

    which in turn calls ld, and the crash happens.

    Strangely I didn't see the -r option in the info docs for gcc,
    so I tried other options like the following (which also crash ld):

    gcc -o util.a -Xlinker -Ur Archiver.o CritSec.o File.o MsgLog.o
    NetSocket.o System.o Tasker.o Util.o

    and

    gcc -o util.a -Xlinker -r Archiver.o CritSec.o File.o MsgLog.o
    NetSocket.o System.o Tasker.o Util.o

    The purpose to make this static lib is to be able to feed it
    later on to the linker to generate an executable with several
    static .a lib files. Will I be able to use the output from ar, as
    an input static lib to ld ?
    I thought the linker ld is the correct command to use for this.

    I'll try the ar option and see what happens.

    Thanks,
    Leo.

     
  • Danny Smith

    Danny Smith - 2004-07-27
    • status: open --> closed-wont-fix
     
  • Earnie Boyd

    Earnie Boyd - 2013-01-22
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
    
     Hi, 
    
    • status: closed-wont-fix --> closed
    • resolution: --> wont-fix
    • category: --> Known_bugs
    • milestone: --> OTHER
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks