|
| 1 | +diff --git a/utils/genapply/Main.hs b/utils/genapply/Main.hs |
| 2 | +index 74351ee..8a6513c 100644 |
| 3 | +--- a/utils/genapply/Main.hs |
| 4 | ++++ b/utils/genapply/Main.hs |
| 5 | +@@ -12,6 +12,17 @@ |
| 6 | + -- for details |
| 7 | + module Main(main) where |
| 8 | + |
| 9 | ++-- GHC will helpfully pass |
| 10 | ++-- -Dlinux_BUILD_OS -Dx86_64_BUILD_ARCH -Dlinux_HOST_OS -Dx86_64_HOST_ARCH -D__GLASGOW_HASKELL_TH__ -D__SSE__ -D__SSE2__ '-D__IO_MANAGER_MIO__=1' |
| 11 | ++-- to cc -E when running the CPP phase. :-/ So we have to undefine them. |
| 12 | ++#if defined(linux_BUILD_OS) || defined(x86_64_BUILD_ARCH) || defined(linux_HOST_OS) || defined(x86_64_HOST_ARCH) |
| 13 | ++#warning "Undefining macros that GHC passes to CPP" |
| 14 | ++#undef linux_BUILD_OS |
| 15 | ++#undef x86_64_BUILD_ARCH |
| 16 | ++#undef linux_HOST_OS |
| 17 | ++#undef x86_64_HOST_ARCH |
| 18 | ++#endif |
| 19 | ++ |
| 20 | + -- Note [Genapply target as host for RTS macros] |
| 21 | + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 22 | + -- We improperly include *HOST* macros for our target... |
| 23 | +@@ -957,6 +968,12 @@ main = do |
| 24 | + text "// DO NOT EDIT!", |
| 25 | + text "// Automatically generated by utils/genapply/Main.hs", |
| 26 | + text "", |
| 27 | ++ text "// DEBUG: SIZEOF_VOID_P " <> int SIZEOF_VOID_P, |
| 28 | ++ text "// DEBUG: HOST_ARCH " <> text HOST_ARCH, |
| 29 | ++ text "// DEBUG: HOST_OS " <> text HOST_OS, |
| 30 | ++ text "// DEBUG: BUILD_ARCH " <> text BUILD_ARCH, |
| 31 | ++ text "// DEBUG: BUILD_OS " <> text BUILD_OS, |
| 32 | ++ text "", |
| 33 | + text "#include \"Cmm.h\"", |
| 34 | + text "#include \"AutoApply.h\"", |
| 35 | + text "#if !defined(UnregisterisedCompiler)", |
0 commit comments