home *** CD-ROM | disk | FTP | other *** search
- > The sharelibs don't work in the following case:
- >
- > prog.c
- >
- > extern char string[];
- > main(){ printf("%s\n",string); }
- >
- > lib.c
- >
- > char string[]="123456";
- >
- > ----------------
- > ----------------
- >
- > gcc -c lib.c -fpic
- > warning size <-1....
-
- I tried to fix this according to the hint Niklas Hallqvist gave, but
- then I discovered - quite puzzled.. - that my copy of gcc didn't
- exhibit the problems you're describing. I tried to reproduce your
- case, but with my gcc (2.5.6, the one distributed in the new binaries)
- I didn't get any warning (which came from as, btw), and the resulting
- library linked fine with prog.c, creating a working executable. The
- only case I could imagine that you're having troubles with gcc is, if
- you should be using an old version of gcc that still produces SunOS
- style PIC without .size directives.
-
- I now built 2.5.7 with the patch Niklas suggested, but I wasn't able
- to reproduce a change in behavior. Furthermore, I got the impression
- from trying to understand what the patch does, that it only plays some
- role in error-recovery (at least it references an error node...).
-
- So, any definite answers to this problem? I'll wait installing the
- new 2.5.7 gcc so I can still verify whether the problem really exists
- with the 2.5.6 gcc I distributed, if someone can come up with an
- example that exhibits the problem. The above example worked fine for
- me.
-
- -Markus
- --
- CHUUG/EUnet Switzerland Markus Wild
- Zweierstrasse 35 Tel: +41 1 291 45 80 mw@eunet.ch
- CH-8004 Zuerich Fax: +41 1 291 46 42 S=mw;P=EUnet;A=EUnet;C=CH
-
-