Skip to content

theres some "this is a hack" pieces in the ghc driver pipleline that are over 5 years old, driver pipeline maybe needs some love

Summary

in the compiler driver pipleline, theres a number of lines that say "temporary hack", they're all >= 5 years old and should get looked at

code

compiler/main/DriverPipeline.hs:

....
1332          -- This is a temporary hack. See #2872, commit
1333          -- 5bd3072ac30216a505151601884ac88bf404c9f2
1334:                        ++ (if platformArch platform == ArchSPARC
1335                             then ["-mcpu=v9"]
1336                             else [])
1337  
1338:                        -- GCC 4.6+ doesn't like -Wimplicit when compiling C++.
1339:                        ++ (if (cc_phase /= Ccxx && cc_phase /= Cobjcxx)
1340                               then ["-Wimplicit"]
1341                               else [])
1342  
1343:                        ++ (if hcc
1344:                              then gcc_extra_viac_flags ++ more_hcc_opts
1345                               else [])
1346:                        ++ verbFlags
1347:                        ++ [ "-S" ]
1348:                        ++ cc_opt
1349:                        ++ [ "-include", ghcVersionH ]
1350:                        ++ framework_paths
1351:                        ++ include_paths
1352:                        ++ more_preprocessor_opts
1353:                        ++ pkg_extra_cc_opts
1354                         ))
1355  
....
1380  
1381          ccInfo <- liftIO $ getCompilerInfo dflags
1382:         let global_includes = [ SysTools.Option ("-I" ++ p)
1383                                | p <- includePathsGlobal cmdline_include_paths ]
1384:         let local_includes = [ SysTools.Option ("-iquote" ++ p)
1385                               | p <- includePathsQuote cmdline_include_paths ]
1386          let runAssembler inputFilename outputFilename
....
1389                      as_prog
1390                         dflags
1391:                        (local_includes ++ global_includes
1392                         -- See Note [-fPIC for assembler]
1393:                        ++ map SysTools.Option pic_c_flags
1394                         -- See Note [Produce big objects on Windows]
1395:                        ++ [ SysTools.Option "-Wa,-mbig-obj"
1396                            | platformOS (targetPlatform dflags) == OSMinGW32
1397                            , not $ target32Bit (targetPlatform dflags)
....
1405          --
1406          -- This is a temporary hack.
1407:                        ++ (if platformArch (targetPlatform dflags) == ArchSPARC
1408                             then [SysTools.Option "-mcpu=v9"]
1409                             else [])
1410:                        ++ (if any (ccInfo ==) [Clang, AppleClang, AppleClang51]
1411                              then [SysTools.Option "-Qunused-arguments"]
1412                              else [])
1413:                        ++ [ SysTools.Option "-x"
1414                            , if with_cpp
1415                                then SysTools.Option "assembler-with-cpp"
....

to be clear: these aren't bugs as such, but probably need some thought!

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information