Annotation of gcc/README.X11, revision 1.1.1.3

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: 
                     41: *** mit/config/Imake.tmpl.ORIG Tue Dec 31 11:07:56 1991
                     42: --- mit/config/Imake.tmpl      Tue Dec 31 12:30:47 1991
                     43: ***************
                     44: *** 499,508 ****
                     45: --- 499,512 ----
                     46:   #define HasGcc NO
                     47:   #endif
                     48:   #ifndef CcCmd
                     49: + #if HasGcc2
                     50: + #define CcCmd gcc -fpcc-struct-return
                     51: + #else
                     52:   #if HasGcc
                     53:   #define CcCmd gcc -fstrength-reduce -fpcc-struct-return 
                     54:   #else
                     55:   #define CcCmd cc
                     56: + #endif
                     57:   #endif
                     58:   #endif
                     59:   #if HasFortran
                     60: *** mit/config/sunLib.rules.ORIG       Tue Dec 31 11:11:24 1991
1.1.1.3 ! root       61: --- mit/config/sunLib.rules    Tue May  5 12:26:12 1992
1.1       root       62: ***************
1.1.1.3 ! root       63: *** 23,30 ****
        !            64: --- 23,34 ----
1.1       root       65:   #define SharedLibraryLoadFlags -assert pure-text
                     66:   #endif
                     67:   #ifndef PositionIndependentCFlags
1.1.1.3 ! root       68: + #if defined(HasGcc2) && defined (Gcc2BuildLibs)
1.1       root       69: + #define PositionIndependentCFlags -fpic
                     70: + #else
                     71:   #define PositionIndependentCFlags -pic
                     72:   #endif
1.1.1.3 ! root       73: + #endif
1.1       root       74:   
                     75:   /*
1.1.1.3 ! root       76:    * InstallSharedLibrary - generate rules to install the shared library.
1.1       root       77: *** mit/config/site.def.ORIG   Tue Dec 31 11:13:49 1991
                     78: --- mit/config/site.def        Tue Dec 31 12:02:59 1991
                     79: ***************
                     80: *** 25,31 ****
                     81:   
                     82:   #ifdef BeforeVendorCF
                     83:   
                     84: ! /* #define HasGcc YES */
                     85:   
                     86:   #endif /* BeforeVendorCF */
                     87:   
1.1.1.3 ! root       88: --- 25,33 ----
1.1       root       89:   
                     90:   #ifdef BeforeVendorCF
                     91:   
                     92: ! #define HasGcc YES 
                     93: ! #define HasGcc2 YES
1.1.1.3 ! root       94: ! /* #define Gcc2BuildLibs YES */
1.1       root       95:   
                     96:   #endif /* BeforeVendorCF */
                     97:   
                     98: *** mit/config/sun.cf.ORIG     Tue Dec 31 11:13:57 1991
1.1.1.3 ! root       99: --- mit/config/sun.cf  Tue May  5 12:29:50 1992
1.1       root      100: ***************
                    101: *** 34,42 ****
1.1.1.3 ! root      102: --- 41,61 ----
1.1       root      103:   
                    104:   #if HasGcc
                    105:   
                    106: + #if defined(HasGcc2) 
1.1.1.3 ! root      107: + #define OptimizedCDebugFlags -O2 
        !           108: + /* Leave Alone XXX */
        !           109: + #else 
        !           110: + #define OptimizedCDebugFlags -O
1.1       root      111:   #define SharedLibraryCcCmd cc
                    112:   #define ExtraLoadFlags -B/usr/bin/
                    113:   #define AllocateLocalDefines /**/
                    114: + #endif
1.1.1.3 ! root      115: + 
        !           116: + #if !defined(Gcc2BuildLibs)
        !           117: + #define SharedLibraryCcCmd cc
        !           118: + #define ExtraLoadFlags -B/usr/bin/
        !           119: + #define AllocateLocalDefines /**/
        !           120: + #endif
1.1       root      121:   
                    122:   .c.o:
                    123:        $(CC) -c $(CFLAGS) $*.c
                    124: *** mit/rgb/Imakefile.ORIG     Wed Jan 15 16:43:18 1992
                    125: --- mit/rgb/Imakefile  Thu Jan  2 13:34:09 1992
                    126: ***************
                    127: *** 17,23 ****
                    128:   #if !(defined(SGIArchitecture) || SystemV4)
                    129:          DBMLIB = -ldbm
                    130:   #endif
                    131: ! #if defined(SparcArchitecture) && HasGcc
                    132:              CC = cc
                    133:       CCOPTIONS = /**/
                    134:       EXTRA_LOAD_FLAGS = /**/
                    135: --- 17,23 ----
                    136:   #if !(defined(SGIArchitecture) || SystemV4)
                    137:          DBMLIB = -ldbm
                    138:   #endif
                    139: ! #if defined(SparcArchitecture) && HasGcc && !defined(HasGcc2)
                    140:              CC = cc
                    141:       CCOPTIONS = /**/
                    142:       EXTRA_LOAD_FLAGS = /**/
                    143: *** mit/server/os/Imakefile.ORIG       Wed Jan 15 16:46:23 1992
                    144: --- mit/server/os/Imakefile    Wed Jan 15 16:46:48 1992
                    145: ***************
                    146: *** 132,138 ****
                    147:   SpecialObjectRule(osinit.o,$(ICONFIGFILES),$(ADM_DEFINES))
                    148:   SpecialObjectRule(WaitFor.o,$(ICONFIGFILES),$(EXT_DEFINES))
                    149:   SpecialObjectRule(fonttype.o,$(ICONFIGFILES),$(FONT_DEFINES))
                    150: ! #if defined(SparcArchitecture) && HasGcc
                    151:   oscolor.o: $(ICONFIGFILES)
                    152:        $(RM) $@
                    153:        cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c
                    154: --- 132,138 ----
                    155:   SpecialObjectRule(osinit.o,$(ICONFIGFILES),$(ADM_DEFINES))
                    156:   SpecialObjectRule(WaitFor.o,$(ICONFIGFILES),$(EXT_DEFINES))
                    157:   SpecialObjectRule(fonttype.o,$(ICONFIGFILES),$(FONT_DEFINES))
                    158: ! #if defined(SparcArchitecture) && HasGcc && !defined(HasGcc2)
                    159:   oscolor.o: $(ICONFIGFILES)
                    160:        $(RM) $@
                    161:        cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c

unix.superglobalmegacorp.com

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