Commit 1345c7cc authored by Moritz Angermann's avatar Moritz Angermann

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
parent 418bcf73
......@@ -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)
......
......@@ -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" >> $@
......
......@@ -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@_HOST = 1
@TargetPlatform_CPP@_TARGET = 1
......@@ -118,7 +119,7 @@ BuildVendor_CPP = @BuildVendor_CPP@
################################################################################
#
# Global configuration options
# Global configuration options
#
################################################################################
......
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