Ticket #8748: ghc-7.8.1_rc1-fix-UNREG-prof.patch

File ghc-7.8.1_rc1-fix-UNREG-prof.patch, 2.2 KB (added by slyfox, 4 years ago)

ghc-7.8.1_rc1-fix-UNREG-prof.patch

  • includes/Stg.h

    commit 9d3cb388944704f37e41f7a87270541327197334
    Author: Sergei Trofimovich <slyfox@gentoo.org>
    Date:   Mon Feb 10 17:27:29 2014 +0300
    
        includes/Stg.h: add declarations for hs_popcnt and frinds
        
        This fixes most of implicit function declarations emitted
        C codegen in UNREG mode. Found by adding the following to
        mk/build.mk:
        
            SRC_CC_OPTS += -Werror=implicit-function-declaration
            SRC_HC_OPTS += -optc-Werror=implicit-function-declaration
        
        Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
    
    diff --git a/includes/Stg.h b/includes/Stg.h
    index 09de8d4..be966aa 100644
    a b typedef StgFunPtr F_; 
    240240#include "stg/MiscClosures.h"
    241241#endif
    242242
     243#include "stg/Prim.h" /* ghc-prim fallbacks */
    243244#include "stg/SMP.h" // write_barrier() inline is required
    244245
    245246/* -----------------------------------------------------------------------------
  • new file includes/stg/Prim.h

    diff --git a/includes/stg/Prim.h b/includes/stg/Prim.h
    new file mode 100644
    index 0000000..2b23c3d
    - +  
     1/* ----------------------------------------------------------------------------
     2 *
     3 * (c) The GHC Team, 2014-2014
     4 *
     5 * Declarations for C fallback primitives implemented by 'ghc-prim' package.
     6 *
     7 * Do not #include this file directly: #include "Rts.h" instead.
     8 *
     9 * To understand the structure of the RTS headers, see the wiki:
     10 *   http://ghc.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
     11 *
     12 * -------------------------------------------------------------------------- */
     13
     14#ifndef PRIM_H
     15#define PRIM_H
     16
     17/* libraries/ghc-prim/cbits/bswap.c */
     18StgWord16 hs_bswap16(StgWord16 x);
     19StgWord32 hs_bswap32(StgWord32 x);
     20StgWord64 hs_bswap64(StgWord64 x);
     21
     22/* TODO: longlong.c */
     23
     24/* libraries/ghc-prim/cbits/popcnt.c */
     25StgWord hs_popcnt8(StgWord8 x);
     26StgWord hs_popcnt16(StgWord16 x);
     27StgWord hs_popcnt32(StgWord32 x);
     28StgWord hs_popcnt64(StgWord64 x);
     29#ifdef i386_HOST_ARCH
     30StgWord hs_popcnt(StgWord32 x);
     31#else
     32StgWord hs_popcnt(StgWord64 x);
     33#endif
     34
     35/* libraries/ghc-prim/cbits/word2float.c */
     36StgFloat hs_word2float32(StgWord x);
     37StgDouble hs_word2float64(StgWord x);
     38
     39#endif /* PRIM_H */