Commit dc392652 authored by Clemens Fruhwirth's avatar Clemens Fruhwirth

Add hardwire-lib-paths option and make it default for inplace invocations

parent d55027c9
......@@ -725,7 +725,7 @@ endif
$(INPLACE_HS): Makefile $(FPTOOLS_TOP)/mk/config.mk
echo "import System.Cmd; import $(EnvImport); import System.Exit" > $@
echo "main = do args <- $(GetArgs); rawSystem \"$(TOP_ABS)/$(GHC_COMPILER_DIR_REL)/$(GHC_PROG)\" (\"-B$(TOP_ABS)\":args) >>= exitWith" >> $@
echo "main = do args <- $(GetArgs); rawSystem \"$(TOP_ABS)/$(GHC_COMPILER_DIR_REL)/$(GHC_PROG)\" (\"-B$(TOP_ABS)\":\"-fhardwire-lib-paths\":args) >>= exitWith" >> $@
$(INPLACE_PROG): $(INPLACE_HS)
$(HC) --make $< -o $@
......
......@@ -35,7 +35,7 @@ import Module
import UniqFM ( eltsUFM )
import ErrUtils
import DynFlags
import StaticFlags ( v_Ld_inputs, opt_Static, WayName(..) )
import StaticFlags ( v_Ld_inputs, opt_Static, opt_HardwireLibPaths, WayName(..) )
import Config
import Panic
import Util
......@@ -1173,7 +1173,9 @@ linkBinary dflags o_files dep_packages = do
-- dependencies, and eliminating duplicates.
pkg_lib_paths <- getPackageLibraryPath dflags dep_packages
let pkg_lib_path_opts = map ("-L"++) pkg_lib_paths
let pkg_lib_path_opts = concat (map get_pkg_lib_path_opts pkg_lib_paths)
get_pkg_lib_path_opts l | opt_HardwireLibPaths = ["-L" ++ l, "-Wl,-rpath", "-Wl," ++ l]
| otherwise = ["-L" ++ l]
let lib_paths = libraryPaths dflags
let lib_path_opts = map ("-L"++) lib_paths
......
......@@ -57,6 +57,7 @@ module StaticFlags (
-- Related to linking
opt_PIC,
opt_Static,
opt_HardwireLibPaths,
-- misc opts
opt_IgnoreDotGhci,
......@@ -328,6 +329,7 @@ opt_PIC = True
opt_PIC = lookUp FSLIT("-fPIC")
#endif
opt_Static = lookUp FSLIT("-static")
opt_HardwireLibPaths = lookUp FSLIT("-fhardwire-lib-paths")
opt_Unregisterised = lookUp FSLIT("-funregisterised")
-- Derived, not a real option. Determines whether we will be compiling
......@@ -368,6 +370,7 @@ isStaticFlag f =
"fexcess-precision",
"funfolding-update-in-place",
"static",
"fhardwire-lib-paths",
"funregisterised",
"fext-core",
"fcpr-off",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment