snowleopard / hadrian

Hadrian: a new build system for the Glasgow Haskell Compiler. Now merged into the GHC tree!
https://gitlab.haskell.org/ghc/ghc/tree/master/hadrian
MIT License
208 stars 37 forks source link

Build fails on `sm/Sanity.c` #483

Closed michalt closed 6 years ago

michalt commented 6 years ago

Error:

Command: inplace/bin/ghc-stage1 -Wall -hisuf debug_hi -osuf debug_o -hcsuf debug_hc -static -optc-DDEBUG -ticky -DTICKY_TICKY -i -i_build/stage1/rts -i_build/stage1/rts/build/autogen -Iincludes -I_build/generated -I_build/stage1/rts -I_build/generated -optc-I_build/generated -optc-fno-stack-protector -odir _build/stage1/rts -hidir _build/stage1/rts -stubdir _build/stage1/rts -optc-I_build/generated -optc-fno-stack-protector -optc-Iincludes -optc-I_build/generated -optc-I_build/stage1/rts -Werror -Wnoncanonical-monad-instances -optc-Werror=unused-but-set-variable -optc-Wno-error=inline -c rts/sm/Sanity.c -o _build/stage1/rts/c/sm/Sanity.debug_o -O0 -H64m -O -optc-Irts -optc-Wall -optc-Werror -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-Wundef -optc-fno-strict-aliasing -optc-I_build/stage1/rts '-optc-DRtsWay="rts_debug"' -optc-O2 -optc-DDEBUG -optc-DTICKY_TICKY -Irts -Wno-deprecated-flags -Wcpp-undef

In file included from rts/sm/Sanity.c:17:0: error: 
rts/sm/Sanity.c: In function ‘checkSanity’:

includes/Rts.h:101:12: error:
     error: ‘last’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
             if (predicate)                          \
                ^
    |
101 |         if (predicate)                          \
    |            ^

rts/sm/Sanity.c:484:40: error:
     note: ‘last’ was declared here
             StgCompactNFDataBlock *block, *last;
                                            ^~~~
    |
484 |         StgCompactNFDataBlock *block, *last;
    |                                        ^
cc1: all warnings being treated as errors
`gcc' failed in phase `C Compiler'. (Exit code: 1)
)

Output of configure:

Configure completed successfully.

   Building GHC version  : 8.3.20171201
          Git commit id  : bc761ad9c65c7aa62d38db39c59a6c0ae59c8ab8

   Build platform        : x86_64-unknown-linux
   Host platform         : x86_64-unknown-linux
   Target platform       : x86_64-unknown-linux

   Bootstrapping using   : /home/michal/local/bin/ghc
      which is version   : 8.2.1

   Using (for bootstrapping) : gcc
   Using gcc                 : gcc
      which is version       : 7.2.1
   Building a cross compiler : NO
   Unregisterised            : NO
   hs-cpp       : gcc
   hs-cpp-flags : -E -undef -traditional
   ar           : ar
   ld           : ld.gold
   nm           : nm
   libtool      :
   objdump      :
   ranlib       : ranlib
   windres      :
   dllwrap      :
   genlib       :
   Happy        : /home/michal/local/bin/happy (1.19.7)
   Alex         : /home/michal/local/bin/alex (3.2.3)
   Perl         : /usr/bin/perl
   sphinx-build : /usr/libexec/python2-sphinx/sphinx-build
   xelatex      :

Hadrian invocation:

> ./hadrian/build.sh --flavour=quick -j

The build with make works with the quick flavor, ./validate also finishes successfully. This it at https://github.com/ghc/ghc/commit/bc761ad9c6

snowleopard commented 6 years ago

@michalt Thanks! Looks like a missing warning suppression flag to me.

Let me try to reproduce on my machine and CI bots.

snowleopard commented 6 years ago

@michalt Sorry, can't reproduce locally or on CI. Could be gcc version specific?

snowleopard commented 6 years ago

@michalt Should be fixed by #487. Please reopen if not.