home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / gnu / gcc / bug / 2019 < prev    next >
Encoding:
Text File  |  1992-07-29  |  13.7 KB  |  421 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!intellicorp.com!TRANLE
  3. From: TRANLE@intellicorp.com (Minh Tran-Le)
  4. Subject: Re: AIX PS/2 implementation
  5. Message-ID: <9207291849.AA12503@life.ai.mit.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Reply-To: tranle@intellicorp.com
  8. Organization: GNUs Not Usenet
  9. References: <1hGKOC#3NVy8Z=big@broue.rot.qc.ca>
  10. Distribution: gnu
  11. Date: Wed, 29 Jul 1992 18:44:50 GMT
  12. Approved: bug-gcc@prep.ai.mit.edu
  13. Lines: 406
  14.  
  15. big@broue.rot.qc.ca (Patrick Drolet) wrote:
  16. |Did anyone of you guys compiled gcc-2.2.2 under AIX PS/2 ?  (I know, I know,
  17. |AIX PS/2 is not Sun OS, but I'm stuck with it).
  18. |Anyways, I have a problem wich I cannot solve.
  19. |
  20.  
  21. To compile gcc-2.2.2 under AIX PS/2 you need a patch for gcc (include at
  22. the end of this message) and a modified version of gas-1.92.3 (alpha).
  23. I can put somewhere for anonymous ftp my whole gas-1.92.3 compiled if 
  24. somebody has space.  Or I can mail the diff for gas-1.92.3 to whoever 
  25. wants it.
  26.  
  27. Minh Tran-Le.
  28.  
  29. note: if you have aix ps/2 up to the latest patch you can enable linking
  30.       gcc with shared libraries by uncommenting BOOT_LDFLAGS in:
  31.       config/t-aix386.
  32.  
  33. ---------------------------------------------------------------------------
  34. *** ./config/t-aix386-    Mon Jun 15 00:24:13 1992
  35. --- ./config/t-aix386    Mon Jun 15 00:24:13 1992
  36. ***************
  37. *** 0 ****
  38. --- 1,12 ----
  39. + # The one that comes with the system is POSIX-compliant.
  40. + LIMITS_H =
  41. + # For svr3 we build crtbegin.o and crtend.o which serve to add begin and
  42. + # end labels to the .ctors and .dtors section when we link using gcc.
  43. + EXTRA_PARTS=crtbegin.o crtend.o
  44. + CC = gcc
  45. + BOOT_CFLAGS = -O2 -fno-strength-reduce $(CFLAGS)
  46. + #BOOT_LDFLAGS = -shlib
  47. + CFLAGS = 
  48. *** ./config/aix386.h-    Thu Mar 19 12:42:02 1992
  49. --- ./config/aix386.h    Mon Jun 15 00:24:14 1992
  50. ***************
  51. *** 1,5 ****
  52.   /* Definitions for IBM PS2 running AIX/386.
  53. !    From: Minh Tran-Le <TRANLE@intellicorp.com>
  54. !    Copyright (C) 1988 Free Software Foundation, Inc.
  55.   
  56.   This file is part of GNU CC.
  57. --- 1,5 ----
  58.   /* Definitions for IBM PS2 running AIX/386.
  59. !    From: Minh Tran-Le <tranle@intellicorp.com>
  60. !    Copyright (C) 1988-1992 Free Software Foundation, Inc.
  61.   
  62.   This file is part of GNU CC.
  63. ***************
  64. *** 19,22 ****
  65. --- 19,30 ----
  66.   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  67.   
  68. + /* Define USE_GAS if you have the new version of gas that can handle
  69. +  * multiple segments and .section pseudo op.  This will allow gcc to
  70. +  * use the .init section for g++ ctor/dtor.
  71. +  *
  72. +  * If you don't have gas then undefined USE_GAS.  You will also have
  73. +  * to use collect if you want to use g++
  74. +  */
  75. + #define USE_GAS
  76.   
  77.   #include "i386.h"
  78. ***************
  79. *** 35,54 ****
  80.   #define TARGET_DEFAULT 1
  81.   
  82. ! /* Use crt1.o as a startup file and crtn.o as a closing file.  */
  83. ! #define STARTFILE_SPEC  \
  84. !   "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} crtbegin.o%s"
  85.   
  86. ! #define LIB_SPEC "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} -lc \
  87. !   crtend.o%s crtn.o%s"
  88.   
  89. ! /* Special flags for the linker.  I don't know what they do.  */
  90.   
  91. ! #define LINK_SPEC "%{K} %{!K:-K} %{T*} %{z:-lm}"
  92.   
  93.   /* Specify predefined symbols in preprocessor.  */
  94.   
  95. ! #define CPP_PREDEFINES "-D_I386 -Di386 -DAIX -D_AIX"
  96.   
  97.   /* special flags for the aix assembler to generate the short form for all
  98.      qualifying forward reference */
  99. --- 43,85 ----
  100.   #define TARGET_DEFAULT 1
  101.   
  102. ! #define LIB_SPEC \
  103. !   "%{shlib:-lc_s} -lc"
  104.   
  105. ! /* Use crt1.o as a startup file and crtn.o as a closing file.  */
  106. ! #ifdef USE_GAS
  107. ! # define STARTFILE_SPEC  \
  108. !   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} crtbegin.o%s"
  109. ! # define ENDFILE_SPEC \
  110. !   "crtend.o%s crtn.o%s"
  111. ! #else
  112. ! # define STARTFILE_SPEC  \
  113. !   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
  114. ! # define ENDFILE_SPEC \
  115. !   "crtn.o%s"
  116. ! #endif
  117.   
  118. ! /* Special flags for the linker:
  119. !  * -K       Loads the a.out header into the first bytes of the text segment,
  120. !  *       followed by the text segments from the object modules.  This flag
  121. !  *       is required on the PS/2.
  122. !  * -Tnum   Makes num the starting address for the text segment of the output
  123. !  *         file.  If not specified, the text segment begins at location zero.
  124. !  * -elabel Makes label the entry point of the executable output file.
  125. !  * -N      Makes the text writeable.
  126. !  * -s      Strips the symbol table, line number information, and relocation
  127. !  *         information from the output.
  128. !  * -x      Does not enter local symbols in the output symbol table; enters only
  129. !  *         external and static symbols.
  130. !  */
  131.   
  132. ! #define LINK_SPEC "%{K}%{!K:-K} %{T*} %{e*} %{N} %{s} %{x}"
  133.   
  134.   /* Specify predefined symbols in preprocessor.  */
  135.   
  136. ! #define CPP_PREDEFINES "-Dps2 -Di386"
  137.   
  138. + #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}%{!posix:-DAIX} -D_I386 -D_AIX -D_MBCS"
  139.   /* special flags for the aix assembler to generate the short form for all
  140.      qualifying forward reference */
  141. ***************
  142. *** 56,67 ****
  143.   #define ASM_SPEC "-s2"
  144.   
  145.   #undef ASM_FILE_START
  146.   #define ASM_FILE_START(FILE)                     \
  147. !   do { fprintf (FILE, "\t.file\t\"%s\"\n", dump_base_name);    \
  148. !        if (optimize)                        \
  149. !           ASM_FILE_START_1 (FILE);                 \
  150. !        else                            \
  151. !           fprintf (FILE, "\t.noopt\n");                \
  152. !      } while (0)
  153.   
  154.   /* This was suggested, but it shouldn't be right for DBX output. -- RMS
  155. --- 87,102 ----
  156.   #define ASM_SPEC "-s2"
  157.   
  158. + /* The .file pseudo op can only handle 14 characters filenames */
  159.   #undef ASM_FILE_START
  160.   #define ASM_FILE_START(FILE)                     \
  161. !   do {                                \
  162. !     char *p = (char *) strrchr (dump_base_name, '/');        \
  163. !     if (!p)                            \
  164. !       p = dump_base_name;                    \
  165. !     else p++;                            \
  166. !     fprintf ((FILE), "\t.file\t\"%s\"\n", p);            \
  167. !     if (!optimize)                        \
  168. !       fprintf (FILE, "\t.noopt\n");                \
  169. !   } while (0)
  170.   
  171.   /* This was suggested, but it shouldn't be right for DBX output. -- RMS
  172. ***************
  173. *** 109,112 ****
  174. --- 144,148 ----
  175.      ASM_OUTPUT_LABEL ((FILE), (NAME)),            \
  176.      fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED)))
  177.   
  178.   /* Define a few machine-specific details of the implementation of
  179. ***************
  180. *** 114,125 ****
  181.   
  182.   #undef INIT_SECTION_ASM_OP
  183. ! #define INIT_SECTION_ASM_OP     ".section .init,\"x\""
  184.   
  185. ! #define CTOR_LIST_BEGIN                \
  186.     asm (INIT_SECTION_ASM_OP);            \
  187.     asm ("pushl $0")
  188. ! #define CTOR_LIST_END CTOR_LIST_BEGIN
  189.   
  190. ! #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)    \
  191.     do {                        \
  192.       init_section ();                \
  193. --- 150,182 ----
  194.   
  195.   #undef INIT_SECTION_ASM_OP
  196. ! #undef CTORS_SECTION_ASM_OP
  197. ! #undef DTORS_SECTION_ASM_OP
  198. ! #ifdef USE_GAS
  199. ! # define INIT_SECTION_ASM_OP     ".section .init,\"x\""
  200. ! # define CTORS_SECTION_ASM_OP    INIT_SECTION_ASM_OP
  201. ! # define DTORS_SECTION_ASM_OP    INIT_SECTION_ASM_OP
  202.   
  203. ! # define CTOR_LIST_BEGIN            \
  204.     asm (INIT_SECTION_ASM_OP);            \
  205.     asm ("pushl $0")
  206. ! # define CTOR_LIST_END CTOR_LIST_BEGIN
  207.   
  208. ! # define DTOR_LIST_BEGIN             \
  209. !   extern int __global_ctors_done
  210. ! # define DTOR_LIST_END                \
  211. !   asm(".data");                    \
  212. !   int __global_ctors_done = 0
  213. ! /* We use the same __CTOR_LIST__ stack for both the ctors and dtors.
  214. !  * We push the ctor function followed by 1 and
  215. !  * we push the dtor function followed by 2.
  216. !  * This is because AIX PS/2 ld can handle only 1 .init section
  217. !  */
  218. ! /* A C statement (sans semicolon) to output an element in the table of
  219. !    global constructors.  */
  220. ! # undef ASM_OUTPUT_CONSTRUCTOR
  221. ! # define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)    \
  222.     do {                        \
  223.       init_section ();                \
  224. ***************
  225. *** 126,129 ****
  226.       fprintf (FILE, "\tpushl $");        \
  227.       assemble_name (FILE, NAME);            \
  228. !     fprintf (FILE, "\n");            \
  229.     } while (0)
  230. --- 183,232 ----
  231.       fprintf (FILE, "\tpushl $");        \
  232.       assemble_name (FILE, NAME);            \
  233. !     fprintf (FILE, "\n\tpushl $1\n");        \
  234.     } while (0)
  235. + /* A C statement (sans semicolon) to output an element in the table of
  236. +    global destructors.  */
  237. + # undef ASM_OUTPUT_DESTRUCTOR
  238. + # define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)    \
  239. +   do {                        \
  240. +     init_section ();                \
  241. +     fprintf (FILE, "\tpushl $");        \
  242. +     assemble_name (FILE, NAME);            \
  243. +     fprintf (FILE, "\n\tpushl $2\n");        \
  244. +   } while (0)
  245. + /* We can handle only ctors for now */
  246. + # undef DO_GLOBAL_CTORS_BODY
  247. + # define DO_GLOBAL_CTORS_BODY                \
  248. + do {                            \
  249. +   func_ptr *__CTOR_LIST__ = __builtin_alloca (0), *p;    \
  250. +   int fn_type;                        \
  251. +   extern int __global_ctors_done;            \
  252. +   if (__global_ctors_done)                \
  253. +     {                            \
  254. +       for (p = __CTOR_LIST__; *p; p++)            \
  255. +     if (*p++ == (func_ptr)2)            \
  256. +       (*p) ();                    \
  257. +     }                            \
  258. +   else                            \
  259. +     {                            \
  260. +        for (p = __CTOR_LIST__; *p; p += 2)        \
  261. +          ;                        \
  262. +        while (p != __CTOR_LIST__)            \
  263. +      {                        \
  264. +        func_ptr *fn = --p;                \
  265. +        if (*--p == (func_ptr)1)            \
  266. +          (*fn) ();                    \
  267. +      }                        \
  268. +        __global_ctors_done = 1;                \
  269. +     }                            \
  270. + } while (0)
  271. + # ifdef CRT_BEGIN
  272. + #  define INVOKE__main
  273. + # endif /* CRT_BEGIN */
  274. + # undef DO_GLOBAL_DTORS_BODY
  275. + # define DO_GLOBAL_DTORS_BODY __do_global_ctors ()
  276. + #endif /* USE_GAS */
  277. *** ./config/x-aix386-    Fri Jan 17 23:42:17 1992
  278. --- ./config/x-aix386    Mon Jun 15 00:24:14 1992
  279. ***************
  280. *** 2,5 ****
  281.   ALLOCA = alloca.o
  282.   
  283. ! # Is this right?
  284. ! # INSTALL=cp
  285. --- 2,5 ----
  286.   ALLOCA = alloca.o
  287.   
  288. ! INSTALL = /usr/ucb/install -c
  289. ! RANLIB = /bin/true
  290. *** ./configure-    Thu Jun 11 12:46:42 1992
  291. --- ./configure    Mon Jun 15 00:24:15 1992
  292. ***************
  293. *** 275,279 ****
  294.           xm_file=xm-aix386.h
  295.           xmake_file=x-aix386
  296. !         broken_install=yes
  297.           ;;
  298.       i386-sun-sunos*)        # Sun i386 roadrunner
  299. --- 275,279 ----
  300.           xm_file=xm-aix386.h
  301.           xmake_file=x-aix386
  302. !         tmake_file=t-aix386
  303.           ;;
  304.       i386-sun-sunos*)        # Sun i386 roadrunner
  305. *** ./Makefile.in-    Sun Jun 14 14:40:34 1992
  306. --- ./Makefile.in    Mon Jun 15 00:24:16 1992
  307. ***************
  308. *** 1629,1643 ****
  309.   # because alloca.o is newer, we permit these recursive makes to compile
  310.   # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
  311. !     $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  312.       $(MAKE) stage2
  313. !     $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  314.   
  315.   bootstrap2: force
  316. !     $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  317.       $(MAKE) stage2
  318. !     $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  319.   
  320.   bootstrap3: force
  321. !     $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  322.   
  323.   # Compare the object files in the current directory with those in the
  324. --- 1629,1643 ----
  325.   # because alloca.o is newer, we permit these recursive makes to compile
  326.   # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
  327. !     $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  328.       $(MAKE) stage2
  329. !     $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  330.   
  331.   bootstrap2: force
  332. !     $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  333.       $(MAKE) stage2
  334. !     $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  335.   
  336.   bootstrap3: force
  337. !     $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
  338.   
  339.   # Compare the object files in the current directory with those in the
  340. *** ./limits.h-    Tue May 26 21:36:59 1992
  341. --- ./limits.h    Mon Jun 15 08:40:16 1992
  342. ***************
  343. *** 80,83 ****
  344. --- 80,119 ----
  345.   #endif
  346.   
  347. + /* POSIX limit values  */
  348. + /* pathconf() specific constants...    */
  349. + #define LINK_MAX    32767    /* Max value of file's link count    */
  350. + #define MAX_INPUT    255    /* Max no of bytes in term input queue    */
  351. + #define MAX_CANON    255    /* Max no of bytes in canonical input    */
  352. + #define NAME_MAX    255    /* Max no of bytes in file name        */
  353. + #define PATH_MAX    1023    /* Max no of bytes in pathname        */
  354. + #define PIPE_BUF    40960    /* Max no of bytes written to pipe    */
  355. + /* sysconf() specific constants...  */
  356. + #define NGROUPS_MAX    32    /* Max no of group ID's per process    */
  357. + #define OPEN_MAX    200    /* Max no of open files per process    */
  358. + #define ARG_MAX        16384    /* Max length of args for exec        */
  359. + #define _POSIX_ARG_MAX        4096
  360. + #define _POSIX_CHILD_MAX    6
  361. + #define _POSIX_LINK_MAX        8
  362. + #define _POSIX_MAX_CANON    255
  363. + #define _POSIX_MAX_INPUT    255
  364. + #define _POSIX_NAME_MAX        14
  365. + #define _POSIX_NGROUPS_MAX    0
  366. + #define _POSIX_OPEN_MAX        16
  367. + #define _POSIX_PATH_MAX        255
  368. + #define _POSIX_PIPE_BUF        512
  369. + #ifndef _POSIX_SOURCE
  370. + /* defines for message catalog usage */
  371. + #define NL_ARGMAX       9               /* max number of printf args */
  372. + #define NL_MSGMAX       65535           /* max number of messages per set */
  373. + #define NL_SETMAX       65535           /* max number of set per catalog */
  374. + #define NL_TEXTMAX      4096            /* max message length in bytes */
  375. + #endif /* NOT _POSIX_SOURCE */
  376.   #endif /* _MACH_MACHLIMITS_H_ */
  377.   #endif /* _LIMITS_H___ */
  378. *** ./ChangeLog-    Sun Jun 14 15:14:35 1992
  379. --- ./ChangeLog    Mon Jun 15 00:43:49 1992
  380. ***************
  381. *** 1,2 ****
  382. --- 1,15 ----
  383. + Mon Jun 15 00:42:56 1992  Minh Tran-Le  (mtranle@paris)
  384. +     * Makefile.in: changed bootstrap to use LDFLAGS="$(BOOT_LDFLAGS)".
  385. +     * config/aix386.h: added handling of -posix and -shlib.
  386. +     Conditionalize the code not to use .init section if USE_GAS is
  387. +     not defined.
  388. +     changed for aix386 ld which can only 1 additional .init section.
  389. +     * configure: for aix386 added tmake_file and removed broken_install
  390. +     * config/t-aix386: new file for aix386.
  391.   Sun Jun 14 16:30:07 1992  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
  392.   
  393. -------
  394.  
  395.