[commit: ghc] master: hschooks.c: Ensure correct header file is included (795f8bd)

git at git.haskell.org git at git.haskell.org
Tue Nov 29 22:19:33 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/795f8bd460d604c792a5df8cfec937b2a74c3956/ghc

>---------------------------------------------------------------

commit 795f8bd460d604c792a5df8cfec937b2a74c3956
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Tue Nov 29 16:50:04 2016 -0500

    hschooks.c: Ensure correct header file is included
    
    Consider the case of building a stage1 compiler. `hschooks.c` will be
    built by stage0 `ghc` and linked against the `stage0` RTS. Despite this
    it was #including the stage1 `Rts.h`. There is, of course, no guarantee
    that this is ABI-compatible with the stage0 RTS and when they diverge
    Bad Things happen (e.g. bells ringing at inappropriate times in D2699).
    
    Test Plan: Validate
    
    Reviewers: simonmar, austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2763


>---------------------------------------------------------------

795f8bd460d604c792a5df8cfec937b2a74c3956
 ghc/hschooks.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ghc/hschooks.c b/ghc/hschooks.c
index 3a42801..9b1be56 100644
--- a/ghc/hschooks.c
+++ b/ghc/hschooks.c
@@ -5,11 +5,18 @@ in instead of the defaults.
 */
 
 #include "../rts/PosixSource.h"
-#include "../includes/Rts.h"
+
+/*
+ * This should be linked against Rts.h from the compiler which is compiling us.
+ * For instance, if we are compiling this file to produce the stage1 compiler,
+ * we should use Rts.h from stage0.
+ */
+#include "Rts.h"
 
 #include "HsFFI.h"
 
 #include <string.h>
+#include <stdbool.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>



More information about the ghc-commits mailing list