home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / linux / 8414 < prev    next >
Encoding:
Internet Message Format  |  1992-08-16  |  5.5 KB

  1. Path: sparky!uunet!wupost!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!serval!phys1.physics.wsu.edu!hlu
  2. From: hlu@phys1.physics.wsu.edu (Hongjiu Lu)
  3. Newsgroups: comp.os.linux
  4. Subject: FAQ for gcc 2.2.2d
  5. Message-ID: <1992Aug17.002813.15152@serval.net.wsu.edu>
  6. Date: 17 Aug 92 00:28:13 GMT
  7. Sender: news@serval.net.wsu.edu (USENET News System)
  8. Organization: Washington State University
  9. Lines: 150
  10.  
  11.  
  12. -- 
  13. H.J.
  14. Gcc/libc maintainer for Linux.
  15. ---------
  16. QUESTION: What compiler should I use for Linux?
  17.  
  18. ANSWER: You should only use the same version on tsx-11.mit.edu or
  19. fgb1.fgb.mw.tu-muenchen.de under /pub/linux/GCC. If you want to use
  20. the testing release, first join the GCC channel on the Linux mailing
  21. list, and then send a note to hlu@eecs.wsu.edu. Don't use gcc older
  22. than the one on tsx-11.mit.edu or fgb1.fgb.mw.tu-muenchen.de.
  23.  
  24. QUESTION: Where is the latest official gcc 2.xx for Linux?
  25.  
  26. ANSWER: It's on tsx-11.mit.edu under /pub/Linux/GCC and
  27. fgb1.fgb.mw.tu-muenchen.de under pub/linux/GCC. You may find it on the
  28. other sites. There are 4 files, 2.xxdb.tar.Z, 2.xxg1.tar.Z,
  29. 2.xxlib.tar.Z and 2.xxmisc.tar.Z. Another file, binutils.tar.Z, is not
  30. the part of gcc 2.xx, but used by gcc 2.xx. It contains all the binary
  31. utilities you need to run gcc 2.xx.  You should read the release note
  32. to see if you should get the new binutils.tar.Z.
  33.  
  34. QUESTION: What are the contents of them?
  35.  
  36. ANSWER: 2.xxdb.tar.Z contains libg.a (compiled with -g), libc_p.a and
  37. jump table stuffs. 2.xxg1.tar.Z contains libg.a compiled with -g1.
  38. 2.xxlib.tar.Z contains cc1 and cc1plus. 2.xxmisc.tar.Z contains gcc
  39. 2.xx drivers, cpp, header files, libraries, manual pages and
  40. installation instructions.
  41.  
  42. Another file, XXXXinc.tar.Z, where XXXX is the current version number
  43. of Linux kernel, has all the header files to replace the header files 
  44. from kernel. 
  45.  
  46. YOU MUST INSTALL IT.
  47. YOU MUST INSTALL IT.
  48. YOU MUST INSTALL IT.
  49. YOU MUST INSTALL IT.
  50. YOU MUST INSTALL IT.
  51.  
  52. To use gcc 2.xx, you have to put the header files from kernel source of
  53. version XXXX on line. Please read README for details.
  54.  
  55. QUESTION: How do I install it?
  56.  
  57. ANSWER: Read README and release notes.
  58.  
  59. QUESTION: What are the main differences with the old release?
  60.  
  61. ANSWER: Read README and release notes.
  62.  
  63. QUESTION: Can I use the old version of gcc?
  64.  
  65. ANSWER: Please get rid of gcc older than gcc 2.2.2. Starting from
  66. gcc 2.2.2, you can do
  67.  
  68.     gcc -V xxxx
  69.  
  70. where xxxx is the version number. Please read `release.xxxx' for
  71. detail. There is one catch in gcc 2.2.2d, setjmp/longjmp is changed,
  72. so the old header files is not compatible with gcc 2.2.2. Before you
  73. install gcc 2.2.2d, please do
  74.  
  75. cp /usr/include/setjmp.h /usr/lib/gcc-lib/i386-linux/2.2.2/include
  76.  
  77. where /usr/include/setjmp.h is come with gcc 2.2.2.
  78.  
  79. QUESTION: Is stdio ANSI compatible?
  80.  
  81. ANSWER: Yes, please test it.
  82.  
  83. QUESTION: Is g++ in 2.xx?
  84.  
  85. ANSWER: Yes.
  86.  
  87. QUESTION: How do I use gcc?
  88.  
  89. ANSWER: Read manual page, gcc.ps or gcc.man in /usr/install/gcc2.
  90.  
  91. QUESTION: What options can I use for gcc?
  92.  
  93. ANSWER: Read manual page, gcc.ps or gcc.man. -O3, -O4, -O5 or even
  94. higher should work with 2.xx. -O3 is said to be the best. Don't ask me
  95. why. Try it yourself. I was told you could manipulate those
  96. optimization flags to get the best performance. Also -static tells gcc
  97. to use the static libraries. The default is the shared libraries.
  98.  
  99. QUESTION: Where is the source code of the new libc.a?
  100.  
  101. ANSWER: The same place you find this file. It is called libc-2.xx.tar.Z.
  102.  
  103. QUESTION: Why does g++ complain, even die?
  104.  
  105. ANSWER: You need "expr", which is in GNU shell utilities 1.6, echo (?)
  106. and sed.
  107.  
  108. QUESTION: How do I generate code for 486?
  109.  
  110. ANSWER: Add -m486 to CFLAGS.
  111.  
  112. QUESTION: I heard malloc (0) wouldn't work with Linux, what should I
  113. do?
  114.  
  115. ANSWER: include <stdlib.h> and don't define NO_FIX_MALLOC.
  116.  
  117. QUESTION: Why does gcc say "xxxxx..h not found"?
  118.  
  119. ANSWER: see QUESTION: What are the contents of them?
  120.  
  121. QUESTION: I really followed every step in the documentation, but when
  122. I do "make", why does it say "don't how to make xxxxxx"?
  123.  
  124. ANSWER: The dependency in Makefile is dated, you need to make a new
  125. one. Please get some guide on make and read Makefile. For the kernel
  126. sources, please do
  127.  
  128. cd src/linux
  129. make dep
  130.  
  131. QUESTION: How do I compile programs under Linux?
  132.  
  133. ANSWER: The Linux C library is trying to be ANSI/POSIX compliant. It
  134. is also very compatible with SYSV and BSD. The C library is loaded
  135. with SYSV and BSD functions. There are three exceptions:
  136.  
  137. 1. signal in Linux is POSIX.
  138. 2. tty in Linux is POSIX.
  139. 3. time functions are POSIX, plus a few BSD and SYSV extensions.
  140. 4. setjmp/longjmp functions are POSIX. But you can use -D__FAVOR_BSD
  141.    to make it BSD or use sigsigjmp/siglongjmp.
  142.  
  143. When you compile a program under Linux, your best bet is include all
  144. the appropriate header files and use -Wall. All the usable functions
  145. and global variables are declared in the corresponding header files.
  146. YOU SHOULD NOT DEFINE ANY functions or global variables OF THE LINUX C
  147. LIBRARY IN YOUR CODE IF YOU WANT TO USE THE SHARED LIBRARIES.
  148.  
  149. After saying all those, you now should know you can compile a program
  150. with -D_POSIX_SOURCE or -D_GNU_SOURCE (read <features.h> for details).
  151. With a few modifications you can even use -DSYSV, -DUSG or -DBSD. Some
  152. codes need to define -DSTDC_HEADERS for ANSI C compiler like gcc here.
  153.  
  154. Please read the header files for details. Maybe you should get a book
  155. on POSIX. Any suggestion of the book list?
  156.  
  157. To use malloc () and calloc () safely under Linux, please include
  158. <stdlib.h> and don't define NO_FIX_MALLOC.
  159.  
  160. BTW, gcc -traditional should work with gcc 2.2.2d or above.
  161.