home *** CD-ROM | disk | FTP | other *** search
/ Amiga GigaPD 3 / Amiga_GigaPD_v3_3of3.iso / netbsd / docs / mailinglist-archive / 1993-12 / text0457.txt < prev    next >
Encoding:
Text File  |  1993-06-25  |  1.5 KB  |  45 lines

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