diff options
author | John Ericson <git@JohnEricson.me> | 2019-04-07 22:33:21 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-07-24 16:49:53 -0400 |
commit | b95b63806b5a9764902d3ae556ba31d17ecd1ec3 (patch) | |
tree | 00434c0677600df9d5e35ebcfc9e7466cdc688d5 /hadrian | |
parent | 3dbcc3682066450b0fe1e74f9d82472d5c603d3b (diff) | |
download | haskell-b95b63806b5a9764902d3ae556ba31d17ecd1ec3.tar.gz |
Make stage 1 GHC target independent
Now that the target macros are not being used, we remove them. This
prevents target hardcoding regressions.
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/src/Rules/Generate.hs | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs index 7a584130f5..b14bccc09c 100644 --- a/hadrian/src/Rules/Generate.hs +++ b/hadrian/src/Rules/Generate.hs @@ -258,18 +258,13 @@ generateGhcPlatformH = do , "#define BUILD_VENDOR " ++ show hostVendor , "#define HOST_VENDOR " ++ show targetVendor , "" - , "/* These TARGET macros are for backwards compatibility... DO NOT USE! */" - , "#define TargetPlatform_TYPE " ++ cppify targetPlatform - , "#define " ++ cppify targetPlatform ++ "_TARGET 1" - , "#define " ++ targetArch ++ "_TARGET_ARCH 1" - , "#define TARGET_ARCH " ++ show targetArch - , "#define " ++ targetOs ++ "_TARGET_OS 1" - , "#define TARGET_OS " ++ show targetOs - , "#define " ++ targetVendor ++ "_TARGET_VENDOR 1" ] + ] ++ [ "#define UnregisterisedCompiler 1" | ghcUnreg ] ++ - [ "\n#endif /* __GHCPLATFORM_H__ */" ] + [ "" + , "#endif /* __GHCPLATFORM_H__ */" + ] generateSettings :: Expr String generateSettings = do @@ -413,10 +408,6 @@ generateGhcBootPlatformH = do hostArch <- chooseSetting HostArch TargetArch hostOs <- chooseSetting HostOs TargetOs hostVendor <- chooseSetting HostVendor TargetVendor - targetPlatform <- getSetting TargetPlatform - targetArch <- getSetting TargetArch - targetOs <- getSetting TargetOs - targetVendor <- getSetting TargetVendor return $ unlines [ "#if !defined(__PLATFORM_H__)" , "#define __PLATFORM_H__" @@ -426,28 +417,21 @@ generateGhcBootPlatformH = do , "" , "#define " ++ cppify buildPlatform ++ "_BUILD 1" , "#define " ++ cppify hostPlatform ++ "_HOST 1" - , "#define " ++ cppify targetPlatform ++ "_TARGET 1" , "" , "#define " ++ buildArch ++ "_BUILD_ARCH 1" , "#define " ++ hostArch ++ "_HOST_ARCH 1" - , "#define " ++ targetArch ++ "_TARGET_ARCH 1" , "#define BUILD_ARCH " ++ show buildArch , "#define HOST_ARCH " ++ show hostArch - , "#define TARGET_ARCH " ++ show targetArch , "" , "#define " ++ buildOs ++ "_BUILD_OS 1" , "#define " ++ hostOs ++ "_HOST_OS 1" - , "#define " ++ targetOs ++ "_TARGET_OS 1" , "#define BUILD_OS " ++ show buildOs , "#define HOST_OS " ++ show hostOs - , "#define TARGET_OS " ++ show targetOs , "" , "#define " ++ buildVendor ++ "_BUILD_VENDOR 1" , "#define " ++ hostVendor ++ "_HOST_VENDOR 1" - , "#define " ++ targetVendor ++ "_TARGET_VENDOR 1" , "#define BUILD_VENDOR " ++ show buildVendor , "#define HOST_VENDOR " ++ show hostVendor - , "#define TARGET_VENDOR " ++ show targetVendor , "" , "#endif /* __PLATFORM_H__ */" ] |