[commit: ghc] ghc-8.2: Pass LLVMTarget (identical to --target) (64d0dac)

git at git.haskell.org git at git.haskell.org
Sun Dec 23 18:46:36 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/64d0daca7fb425fbdfa2a00e425a04ae246108a8/ghc

>---------------------------------------------------------------

commit 64d0daca7fb425fbdfa2a00e425a04ae246108a8
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Thu May 11 18:17:02 2017 +0800

    Pass LLVMTarget (identical to --target)
    
    Sometimes it might be of interest to
    have access to the raw target value when calling
    subcommands (e.g. llvm tools with --target), as
    such we forward the specified (or inferred)
    --target for later consumption.
    
    Reviewers: austin, hvr, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, erikd
    
    Differential Revision: https://phabricator.haskell.org/D3559
    
    (cherry picked from commit 1345c7cc42c45e63ab1726a8fd24a7e4d4222467)


>---------------------------------------------------------------

64d0daca7fb425fbdfa2a00e425a04ae246108a8
 aclocal.m4       |  5 +++++
 compiler/ghc.mk  |  2 ++
 mk/project.mk.in | 37 +++++++++++++++++++------------------
 3 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index ba178e2..7f58547 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -136,9 +136,13 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS],
     TargetVendor_CPP=`  echo "$TargetVendor"   | sed -e 's/\./_/g' -e 's/-/_/g'`
     TargetOS_CPP=`      echo "$TargetOS"       | sed -e 's/\./_/g' -e 's/-/_/g'`
 
+    # we intend to pass trough --targets to llvm as is.
+    LLVMTarget_CPP=`    echo "$target"`
+
     echo "GHC build  : $BuildPlatform"
     echo "GHC host   : $HostPlatform"
     echo "GHC target : $TargetPlatform"
+    echo "LLVM target: $target"
 
     AC_SUBST(BuildPlatform)
     AC_SUBST(HostPlatform)
@@ -154,6 +158,7 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS],
     AC_SUBST(HostOS_CPP)
     AC_SUBST(BuildOS_CPP)
     AC_SUBST(TargetOS_CPP)
+    AC_SUBST(LLVMTarget_CPP)
 
     AC_SUBST(HostVendor_CPP)
     AC_SUBST(BuildVendor_CPP)
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 614d193..e5b3d20 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -170,6 +170,7 @@ compiler/stage1/$(PLATFORM_H) : mk/config.mk mk/project.mk | $$(dir $$@)/.
 	@echo "#define BUILD_ARCH \"$(BuildArch_CPP)\""           >> $@
 	@echo "#define HOST_ARCH \"$(HostArch_CPP)\""             >> $@
 	@echo "#define TARGET_ARCH \"$(TargetArch_CPP)\""         >> $@
+	@echo "#define LLVM_TARGET \"$(LLVMTarget_CPP)\""         >> $@
 	@echo                                                     >> $@
 	@echo "#define $(BuildOS_CPP)_BUILD_OS 1"                 >> $@
 	@echo "#define $(HostOS_CPP)_HOST_OS 1"                   >> $@
@@ -211,6 +212,7 @@ compiler/stage2/$(PLATFORM_H) : mk/config.mk mk/project.mk | $$(dir $$@)/.
 	@echo "#define BUILD_ARCH \"$(HostArch_CPP)\""            >> $@
 	@echo "#define HOST_ARCH \"$(TargetArch_CPP)\""           >> $@
 	@echo "#define TARGET_ARCH \"$(TargetArch_CPP)\""         >> $@
+	@echo "#define LLVM_TARGET \"$(LLVMTarget_CPP)\""         >> $@
 	@echo                                                     >> $@
 	@echo "#define $(HostOS_CPP)_BUILD_OS 1"                  >> $@
 	@echo "#define $(TargetOS_CPP)_HOST_OS 1"                 >> $@
diff --git a/mk/project.mk.in b/mk/project.mk.in
index 03bd744..d620ed5 100644
--- a/mk/project.mk.in
+++ b/mk/project.mk.in
@@ -12,7 +12,7 @@
 # Versioning scheme: A.B.C
 #         A: major version, decimal, any number of digits
 #         B: minor version, decimal, any number of digits
-#	  C: patchlevel, one digit, omitted if zero.
+#     C: patchlevel, one digit, omitted if zero.
 #
 # ProjectVersionInt does *not* contain the patchlevel (rationale: this
 # figure is used for conditional compilations, and library interfaces
@@ -35,7 +35,7 @@ ProjectGitCommitId = @ProjectGitCommitId@
 
 ################################################################################
 #
-#		Platform variables
+#       Platform variables
 #
 ################################################################################
 
@@ -81,24 +81,25 @@ ProjectGitCommitId = @ProjectGitCommitId@
 # You have to do a lot of work by hand to cross compile: see the
 # section on "Porting GHC" in the Building Guide.
 
-HOSTPLATFORM			= @HostPlatform@
-TARGETPLATFORM			= @TargetPlatform@
-BUILDPLATFORM			= @BuildPlatform@
+HOSTPLATFORM            = @HostPlatform@
+TARGETPLATFORM          = @TargetPlatform@
+BUILDPLATFORM           = @BuildPlatform@
 
-HostPlatform_CPP		= @HostPlatform_CPP@
-HostArch_CPP			= @HostArch_CPP@
-HostOS_CPP			= @HostOS_CPP@
-HostVendor_CPP	                = @HostVendor_CPP@
+HostPlatform_CPP        = @HostPlatform_CPP@
+HostArch_CPP            = @HostArch_CPP@
+HostOS_CPP              = @HostOS_CPP@
+HostVendor_CPP          = @HostVendor_CPP@
 
-TargetPlatform_CPP		= @TargetPlatform_CPP@
-TargetArch_CPP			= @TargetArch_CPP@
-TargetOS_CPP			= @TargetOS_CPP@
-TargetVendor_CPP                = @TargetVendor_CPP@
+TargetPlatform_CPP      = @TargetPlatform_CPP@
+TargetArch_CPP          = @TargetArch_CPP@
+TargetOS_CPP            = @TargetOS_CPP@
+TargetVendor_CPP        = @TargetVendor_CPP@
+LLVMTarget_CPP          = @LLVMTarget_CPP@
 
-BuildPlatform_CPP		= @BuildPlatform_CPP@
-BuildArch_CPP			= @BuildArch_CPP@
-BuildOS_CPP			= @BuildOS_CPP@
-BuildVendor_CPP                 = @BuildVendor_CPP@
+BuildPlatform_CPP       = @BuildPlatform_CPP@
+BuildArch_CPP           = @BuildArch_CPP@
+BuildOS_CPP             = @BuildOS_CPP@
+BuildVendor_CPP         = @BuildVendor_CPP@
 
 @HostPlatform_CPP at _HOST           = 1
 @TargetPlatform_CPP at _TARGET       = 1
@@ -118,7 +119,7 @@ BuildVendor_CPP                 = @BuildVendor_CPP@
 
 ################################################################################
 #
-#		Global configuration options
+#       Global configuration options
 #
 ################################################################################
 



More information about the ghc-commits mailing list