Annotation of gcc/README.X11, revision 1.1.1.4

1.1.1.3   root        1: How to compile X11R5 (patch level 11) with GCC version 2:
1.1       root        2: 
                      3: The patches include support for building the shared libraries with GCC 2 on 
1.1.1.3   root        4: the Sparc and 68k machines.  NOTE: Such shared libraries DO NOT WORK
                      5: with executables previously linked using Sun CC!  This is because
                      6: neither those executables nor the gcc-compiled shared libraries contain
                      7: libgcc.a.  The shared libraries do work with executables linked using
                      8: GCC (running the Sun linker, of course) because GCC tells the linker to
                      9: link in libgcc.a.  Because of these limitations the default behavior is
                     10: to NOT build the shared libraries with gcc.  If you want the gcc-compiled
                     11: shared libraries turn on "Gcc2BuildLibs" in site.def
                     12: 
                     13: If you want to build a shared library that works with executables
                     14: linked with Sun CC, you will have to arrange to include libgcc.a in
                     15: the shared libraries.  The instructions below do not handle this.
1.1       root       16: 
1.1.1.2   root       17: Sun forgot to include a static version of libdl.a with some versions
                     18: of SunOS (4.1 mainly).  If you see undefined symbols _dlopen, _dlsym,
                     19: or _dlclose when linking with -lX11, compile and link against the file
                     20: mit/util/misc/dlsym.c in the MIT X11R5 distribution.
                     21: 
1.1       root       22: mit/config/Imake.tmpl -- Do not set -fstrength-reduce if we have GCC 2.  If
                     23: -fstrength-reduce (or any other -f option) is a major win, then it will
                     24: most likely be turned on by -O2 optimization.
                     25: 
1.1.1.3   root       26: mit/config/sunLib.rules -- If HasGcc2 and Gcc2BuildLibs are defined, then 
                     27: use gcc -fpic to generate PIC code.  Make sure that gcc does not use gas (the 
                     28: GNU assembler) when compiling PIC code; gas does not assemble it correctly.  
                     29: If you have gas installed where gcc uses it by default, you might have to add
1.1.1.2   root       30: -B/bin/ to the PositionIndependentCFlags.
1.1       root       31: 
                     32: mit/config/site.def -- Define HasGcc2 to be YES.
                     33: 
                     34: mit/config/sun.cf -- When compiling with GCC 2, use -O2 optimization.
                     35: 
                     36: mit/rgb/Imakefile -- No longer need to compile some modules with 
                     37: cc on the Sparc since GCC 2 produces proper -fpcc-struct-return code.
                     38: 
                     39: mit/server/os/Imakefile -- Likewise.
                     40: 
1.1.1.4 ! root       41: mit/clients/twm/Imakefile -- fix bad decls of malloc, realloc in gram.c.
        !            42: 
1.1       root       43: *** mit/config/Imake.tmpl.ORIG Tue Dec 31 11:07:56 1991
                     44: --- mit/config/Imake.tmpl      Tue Dec 31 12:30:47 1991
                     45: ***************
                     46: *** 499,508 ****
                     47: --- 499,512 ----
                     48:   #define HasGcc NO
                     49:   #endif
                     50:   #ifndef CcCmd
                     51: + #if HasGcc2
                     52: + #define CcCmd gcc -fpcc-struct-return
                     53: + #else
                     54:   #if HasGcc
                     55:   #define CcCmd gcc -fstrength-reduce -fpcc-struct-return 
                     56:   #else
                     57:   #define CcCmd cc
                     58: + #endif
                     59:   #endif
                     60:   #endif
                     61:   #if HasFortran
                     62: *** mit/config/sunLib.rules.ORIG       Tue Dec 31 11:11:24 1991
1.1.1.3   root       63: --- mit/config/sunLib.rules    Tue May  5 12:26:12 1992
1.1       root       64: ***************
1.1.1.3   root       65: *** 23,30 ****
                     66: --- 23,34 ----
1.1       root       67:   #define SharedLibraryLoadFlags -assert pure-text
                     68:   #endif
                     69:   #ifndef PositionIndependentCFlags
1.1.1.3   root       70: + #if defined(HasGcc2) && defined (Gcc2BuildLibs)
1.1       root       71: + #define PositionIndependentCFlags -fpic
                     72: + #else
                     73:   #define PositionIndependentCFlags -pic
                     74:   #endif
1.1.1.3   root       75: + #endif
1.1       root       76:   
                     77:   /*
1.1.1.3   root       78:    * InstallSharedLibrary - generate rules to install the shared library.
1.1       root       79: *** mit/config/site.def.ORIG   Tue Dec 31 11:13:49 1991
                     80: --- mit/config/site.def        Tue Dec 31 12:02:59 1991
                     81: ***************
                     82: *** 25,31 ****
                     83:   
                     84:   #ifdef BeforeVendorCF
                     85:   
                     86: ! /* #define HasGcc YES */
                     87:   
                     88:   #endif /* BeforeVendorCF */
                     89:   
1.1.1.3   root       90: --- 25,33 ----
1.1       root       91:   
                     92:   #ifdef BeforeVendorCF
                     93:   
                     94: ! #define HasGcc YES 
                     95: ! #define HasGcc2 YES
1.1.1.3   root       96: ! /* #define Gcc2BuildLibs YES */
1.1       root       97:   
                     98:   #endif /* BeforeVendorCF */
                     99:   
                    100: *** mit/config/sun.cf.ORIG     Tue Dec 31 11:13:57 1991
1.1.1.3   root      101: --- mit/config/sun.cf  Tue May  5 12:29:50 1992
1.1       root      102: ***************
                    103: *** 34,42 ****
1.1.1.3   root      104: --- 41,61 ----
1.1       root      105:   
                    106:   #if HasGcc
                    107:   
                    108: + #if defined(HasGcc2) 
1.1.1.3   root      109: + #define OptimizedCDebugFlags -O2 
                    110: + /* Leave Alone XXX */
                    111: + #else 
                    112: + #define OptimizedCDebugFlags -O
1.1       root      113:   #define SharedLibraryCcCmd cc
                    114:   #define ExtraLoadFlags -B/usr/bin/
                    115:   #define AllocateLocalDefines /**/
                    116: + #endif
1.1.1.3   root      117: + 
                    118: + #if !defined(Gcc2BuildLibs)
                    119: + #define SharedLibraryCcCmd cc
                    120: + #define ExtraLoadFlags -B/usr/bin/
                    121: + #define AllocateLocalDefines /**/
                    122: + #endif
1.1       root      123:   
                    124:   .c.o:
                    125:        $(CC) -c $(CFLAGS) $*.c
                    126: *** mit/rgb/Imakefile.ORIG     Wed Jan 15 16:43:18 1992
                    127: --- mit/rgb/Imakefile  Thu Jan  2 13:34:09 1992
                    128: ***************
                    129: *** 17,23 ****
                    130:   #if !(defined(SGIArchitecture) || SystemV4)
                    131:          DBMLIB = -ldbm
                    132:   #endif
                    133: ! #if defined(SparcArchitecture) && HasGcc
                    134:              CC = cc
                    135:       CCOPTIONS = /**/
                    136:       EXTRA_LOAD_FLAGS = /**/
                    137: --- 17,23 ----
                    138:   #if !(defined(SGIArchitecture) || SystemV4)
                    139:          DBMLIB = -ldbm
                    140:   #endif
                    141: ! #if defined(SparcArchitecture) && HasGcc && !defined(HasGcc2)
                    142:              CC = cc
                    143:       CCOPTIONS = /**/
                    144:       EXTRA_LOAD_FLAGS = /**/
                    145: *** mit/server/os/Imakefile.ORIG       Wed Jan 15 16:46:23 1992
                    146: --- mit/server/os/Imakefile    Wed Jan 15 16:46:48 1992
                    147: ***************
                    148: *** 132,138 ****
                    149:   SpecialObjectRule(osinit.o,$(ICONFIGFILES),$(ADM_DEFINES))
                    150:   SpecialObjectRule(WaitFor.o,$(ICONFIGFILES),$(EXT_DEFINES))
                    151:   SpecialObjectRule(fonttype.o,$(ICONFIGFILES),$(FONT_DEFINES))
                    152: ! #if defined(SparcArchitecture) && HasGcc
                    153:   oscolor.o: $(ICONFIGFILES)
                    154:        $(RM) $@
                    155:        cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c
                    156: --- 132,138 ----
                    157:   SpecialObjectRule(osinit.o,$(ICONFIGFILES),$(ADM_DEFINES))
                    158:   SpecialObjectRule(WaitFor.o,$(ICONFIGFILES),$(EXT_DEFINES))
                    159:   SpecialObjectRule(fonttype.o,$(ICONFIGFILES),$(FONT_DEFINES))
                    160: ! #if defined(SparcArchitecture) && HasGcc && !defined(HasGcc2)
                    161:   oscolor.o: $(ICONFIGFILES)
                    162:        $(RM) $@
                    163:        cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c
1.1.1.4 ! root      164: *** 1.1 1992/09/08 19:52:07
        !           165: --- mit/server/ddx/sun/Imakefile        1992/09/08 21:10:22
        !           166: ***************
        !           167: *** 43,48 ****
        !           168: --- 43,53 ----
        !           169:   LinkFile(sunGX.o,sunGX.o.dist)
        !           170:   #endif
        !           171: 
        !           172: + #if HasGcc2
        !           173: + SpecialObjectRule(sunCG2C.o,sunCG2C.c,-fvolatile)
        !           174: + SpecialObjectRule(sunCG2M.o,sunCG2M.c,-fvolatile)
        !           175: + #endif
        !           176: + 
        !           177:   sunInitExtMono.o: $(ICONFIGFILES)
        !           178:   ObjectFromSpecialSource(sunInitExtMono,../mi/miinitext,-UPEXEXT)
        !           179:   ObjectFromSpecialSource(sunInitMono,sunInit,-DMONO_ONLY)
        !           180: 
        !           181: *** /tmp/RCSAa24446     Tue Sep 15 12:23:32 1992
        !           182: --- mit/clients/twm/Imakefile   Thu Aug 13 18:18:07 1992
        !           183: ***************
        !           184: *** 32,41 ****
        !           185: --- 32,48 ----
        !           186:   ComplexProgramTarget(twm)
        !           187:   InstallNonExecFile(system.twmrc,$(TWMDIR))
        !           188:   
        !           189: + #if HasGcc2 && defined (SunArchitecture)
        !           190:   gram.h gram.c: gram.y
        !           191:         yacc $(YFLAGS) gram.y
        !           192: +       sed -e 's/^extern char \*malloc(), \*realloc();//g' y.tab.c >gram.c
        !           193: +       $(MV) y.tab.h gram.h
        !           194: + #else
        !           195: + gram.h gram.c: gram.y
        !           196: +       yacc $(YFLAGS) gram.y
        !           197:         $(MV) y.tab.c gram.c
        !           198:         $(MV) y.tab.h gram.h
        !           199: + #endif
        !           200:   
        !           201:   clean::
        !           202:         $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c 
        !           203: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.