Add $(GhcDynamic) knob, set to YES to get stage2 linked with -dynamic
authorSimon Marlow <marlowsd@gmail.com>
Wed, 28 Apr 2010 20:52:41 +0000 (20:52 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 28 Apr 2010 20:52:41 +0000 (20:52 +0000)
Default currently NO.

Validate passed with GhcDynamic=YES on x86/Linux here.

The compiler is currently slower on x86 when linked -dynamic,
because the GC inner loop has been adversely affected by -fPIC, I'm
looking into how to fix it.

ghc/ghc.mk
mk/config.mk.in

index 0203344..a1edb17 100644 (file)
@@ -35,6 +35,11 @@ ifeq "$(GhcDebugged)" "YES"
 ghc_HC_OPTS += -debug
 endif
 
+ifeq "$(GhcDynamic)" "YES"
+ghc_stage2_HC_OPTS += -dynamic
+ghc_stage3_HC_OPTS += -dynamic
+endif
+
 ifeq "$(GhcThreaded)" "YES"
 # Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
 ghc_stage2_HC_OPTS += -threaded
index d12cbff..fcf7e0d 100644 (file)
@@ -99,14 +99,12 @@ GhcStage3HcOpts=-O2
 
 GhcProfiled=NO
 GhcDebugged=NO
+GhcDynamic=NO
 GhcLibProfiled=$(if $(filter p,$(GhcLibWays)),YES,NO)
 
 # Do we support shared libs?
 PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),i386-unknown-linux x86_64-unknown-linux i386-unknown-freebsd x86_64-unknown-freebsd i386-unknown-mingw32 i386-apple-darwin),YES,NO)
 
-# ToDo later:
-# BuildStaticLibs=@BuildStaticLibs@
-
 # Build a compiler that will build *unregisterised* libraries and
 # binaries by default.  Unregisterised code is supposed to compile and
 # run without any support for architecture-specific assembly mangling,