[GHC] #5136: linkerscript fix from #2615 breaks Darwin

GHC cvs-ghc at haskell.org
Tue Apr 19 10:39:04 CEST 2011


#5136: linkerscript fix from #2615 breaks Darwin
---------------------------------+------------------------------------------
    Reporter:  guest             |       Owner:                     
        Type:  bug               |      Status:  new                
    Priority:  normal            |   Component:  Compiler           
     Version:  6.12.3            |    Keywords:                     
    Testcase:                    |   Blockedby:                     
          Os:  MacOS X           |    Blocking:                     
Architecture:  Unknown/Multiple  |     Failure:  Building GHC failed
---------------------------------+------------------------------------------
 The fix from ticket #2615 breaks compilation on Darwin as follows:

 {{{
 "inplace/bin/ghc-stage1" -optc-m32 -optc-Wall -optc-Wextra -optc-Wstrict-
 prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-
 Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-
 noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Iincludes
 -optc-Irts -optc-DCOMPILING_RTS -optc-DUSE_LIBFFI_FOR_ADJUSTORS -optc-fno-
 strict-aliasing -optc-fno-common -optc-Ilibffi/build/include -optc-fomit-
 frame-pointer -optc-DRtsWay=\"rts_v\"   -H32m -O -optc-mcpu=G5 -opta-
 mcpu=G5 -optc-mtune=G5 -opta-mtune=G5 -w -Iincludes -Irts -DCOMPILING_RTS
 -package-name rts -static  -optc-fno-stack-protector -dcmm-lint
 -Ilibffi/build/include     -i -irts -irts/dist/build
 -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen
 -optc-O2   -c rts/Linker.c -o rts/dist/build/Linker.o

 rts/Linker.c:997:0:  error: conflicting types for '__eprintf'

 /usr/include/assert.h:77:0:
      error: previous declaration of '__eprintf' was here

 rts/Linker.c:1087:0:
      error: expected '=', ',', ';', 'asm' or '__attribute__' before
 're_invalid'

 rts/Linker.c:1088:0:
      error: expected '=', ',', ';', 'asm' or '__attribute__' before
 're_realso'
 rts/Linker.c: In function 'initLinker':

 rts/Linker.c:1130:0:
      warning: implicit declaration of function 'regcomp'

 rts/Linker.c:1130:0:
      error: 're_invalid' undeclared (first use in this function)

 rts/Linker.c:1130:0:
      error: (Each undeclared identifier is reported only once

 rts/Linker.c:1130:0:  error: for each function it appears in.)

 rts/Linker.c:1132:0:
      error: 'REG_EXTENDED' undeclared (first use in this function)

 rts/Linker.c:1134:0:
      error: 're_realso' undeclared (first use in this function)
 rts/Linker.c: In function 'exitLinker':

 rts/Linker.c:1162:0:
      warning: implicit declaration of function 'regfree'

 rts/Linker.c:1162:0:
      warning: nested extern declaration of 'regfree'

 rts/Linker.c:1162:0:
      error: 're_invalid' undeclared (first use in this function)

 rts/Linker.c:1163:0:
      error: 're_realso' undeclared (first use in this function)
 rts/Linker.c: In function 'addDLL':

 rts/Linker.c:1251:0:
      error: 'regmatch_t' undeclared (first use in this function)

 rts/Linker.c:1251:0:  error: expected ';' before 'match'

 rts/Linker.c:1284:0:
      warning: implicit declaration of function 'regexec'

 rts/Linker.c:1284:0:
      warning: nested extern declaration of 'regexec'

 rts/Linker.c:1284:0:
      error: 're_invalid' undeclared (first use in this function)

 rts/Linker.c:1284:0:
      error: 'match' undeclared (first use in this function)

 rts/Linker.c:1288:0:
      warning: type defaults to 'int' in declaration of '_a'

 rts/Linker.c:1288:0:
      warning: type defaults to 'int' in declaration of '_b'

 rts/Linker.c:1299:0:
      error: 're_realso' undeclared (first use in this function)
 rts/Linker.c: In function 'machoInitSymbolsWithoutUnderscore':

 rts/Linker.c:4743:0:
      warning: nested extern declaration of 'symbolsWithoutUnderscore'
 make[1]: *** [rts/dist/build/Linker.o] Error 1
 make[1]: *** Waiting for unfinished jobs....
 }}}

 The particular system here is Darwin 8/PPC, but the same happens on Darwin
 9/x86.

 GNU linker scripts don't exist on Darwin (Mach-O) targets, hence testing
 for them on this platform is pointless.  Perhaps the code to check can be
 conditionalised for ELF-platforms only, which would leave the assert
 problem.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5136>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list