Ticket #7769: 0001-Enable-Opt_PIC-for-the-dyn-way-regardless-of-OSes.patch

File 0001-Enable-Opt_PIC-for-the-dyn-way-regardless-of-OSes.patch, 1.8 KB (added by PHO, 2 years ago)
  • compiler/main/DynFlags.hs

    From ed6fefded43d0c086960430a4bc904fc21507e56 Mon Sep 17 00:00:00 2001
    From: PHO <[email protected]>
    Date: Thu, 14 Mar 2013 00:22:34 +0900
    Subject: [PATCH] Enable Opt_PIC for the dyn way regardless of OSes.
    
    We were previously enabling Opt_PIC on certain OSes namely Windows,
    Darwin and Linux, but it should always be enabled for the dyn way
    because it makes no sense to try to generate non-PIC dynamic
    libraries, which is usually impossible.
    ---
     compiler/main/DynFlags.hs | 16 ++--------------
     1 file changed, 2 insertions(+), 14 deletions(-)
    
    diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
    index 060619d..55b6fe9 100644
    a b wayDesc WayNDP = "Nested data parallelism" 
    10521052
    10531053wayGeneralFlags :: Platform -> Way -> [GeneralFlag]
    10541054wayGeneralFlags _ WayThreaded = []
    1055 wayGeneralFlags _ WayDebug = []
    1056 wayGeneralFlags platform WayDyn =
    1057         case platformOS platform of
    1058             -- On Windows, code that is to be linked into a dynamic
    1059             -- library must be compiled with -fPIC. Labels not in
    1060             -- the current package are assumed to be in a DLL
    1061             -- different from the current one.
    1062             OSMinGW32 -> [Opt_PIC]
    1063             OSDarwin  -> [Opt_PIC]
    1064             OSLinux   -> [Opt_PIC] -- This needs to be here for GHCi to work:
    1065                                    -- GHCi links objects into a .so before
    1066                                    -- loading the .so using the system linker.
    1067                                    -- Only PIC objects can be linked into a .so.
    1068             _         -> []
     1055wayGeneralFlags _ WayDebug    = []
     1056wayGeneralFlags _ WayDyn      = [Opt_PIC]
    10691057wayGeneralFlags _ WayProf     = [Opt_SccProfilingOn]
    10701058wayGeneralFlags _ WayEventLog = []
    10711059wayGeneralFlags _ WayPar      = [Opt_Parallel]