This is the mail archive of the gcc@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]

Re: can't build gcc-2.95.2 on SCO OSR 5.0.5



>
>And for the top of tree, that's true.  For 2.95.2, it is not.  2.95.2
>does support COFF generation.
>

He, I see.

>
>This was an, err, negative interaction between GCC and the System V
>linkers that Jason fixed in the top-of-tree a year or so ago.  I think
>the patch was in the 2.95.3 backport set, but I'm not following 2.95.3.
>It's definitely in the 2.95.2.pl1 (that's the patch that makes it "patch
>level 1") binary kit available on Skunkware.

I had downloaded and installed gcc-2.95.2.pl1, but when I used shared 
library, there had something wrong, so I wanted to build gcc myself. One 
example just like bellow,the source files are n1.cpp and n2.cpp :
n1.cpp:
-------------------------
#include <stdlib.h>
#include <limits.h>
#include <iostream.h>

void
fun(char * s)
{
        char * s1;
        long n;

        n = strtol(s, &s1, 8);
        cout << n << endl;
}
-----------------------------

n2.cpp:
-----------------------------
void fun(char*);

main()
{
        fun("377");
}
----------------------------

compile them and run n2:
$ c++ -c n1.cpp
$ c++ -G -o libn1.so n1.o
$ c++ -o n2 n2.cpp -ln1
$ ./n2
the result is 0!!! It's wrong.

when I compile them without using shared library:
$ c++ -o n2 n1.cpp n2.cpp
$ ./n2
the result is 255!!! It's right.


>
>Aaaah, it's the "--enable-shared" that caused you grief.  This was
>definitely naughty unless you specified --disable-multilib.
>

What you mean is that these two flags can't use together, isn't it?

>
>RJL

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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