root/mk/project.mk.in

Revision 6247b59e5d31de58ee51273916bc44ac2118240a, 5.2 KB (checked in by David M Peixotto <dmp@…>, 8 months ago)

Add autoconf support to detect an LLVM-based C compiler

This patch adds support to the autoconf scripts to detect
when we are using a C compiler that uses an LLVM back end.
An LLVM back end does not support all of the extensions use
by GCC, so we need to perform some conditional compilation
in the runtime, particularly for handling thread local
storage and global register variables.

The changes here will set the CC_LLVM_BACKEND in the
autoconf scripts if we detect an llvm-based compiler. We use
this variable to define the llvm_CC_FLAVOR variable that we
can use in the runtime code to conditionally compile for
LLVM.

  • Property mode set to 100644
Line 
1# WARNING: mk/project.mk is automatically generated from mk/project.mk.in by
2# ./configure.  Make sure you are editing mk/project.mk.in, not mk/project.mk.
3
4################################################################################
5#
6# GHC Version
7#
8
9# ProjectVersion    is treated as a *string*
10# ProjectVersionInt is treated as an *integer* (for cpp defines)
11
12# Versioning scheme: A.B.C
13#         A: major version, decimal, any number of digits
14#         B: minor version, decimal, any number of digits
15#         C: patchlevel, one digit, omitted if zero.
16#
17# ProjectVersionInt does *not* contain the patchlevel (rationale: this
18# figure is used for conditional compilations, and library interfaces
19# etc. are not supposed to change between patchlevels).
20#
21# The ProjectVersionInt is included in interface files, and GHC
22# checks that it's reading interface generated by the same ProjectVersion
23# as itself. It does this even though interface file syntax may not
24# change between versions.  Rationale: calling conventions or other
25# random .o-file stuff might change even if the .hi syntax doesn't
26
27ProjectName       = @ProjectName@
28ProjectTags       =
29ProjectVersion    = @ProjectVersion@$(ProjectTags)
30ProjectVersionInt = @ProjectVersionInt@
31ProjectPatchLevel = @ProjectPatchLevel@
32
33################################################################################
34#
35#               Platform variables
36#
37################################################################################
38
39# A "platform" is the GNU cpu-type/manufacturer/operating-system target machine
40# specifier.  E.g. sparc-sun-solaris2
41#
42# Build  platform: the platform on which we are doing this build
43# Host   platform: the platform on which these binaries will run
44# Target platform: the platform for which this compiler will generate code
45#
46# We don't support build & host being different, because the build
47# process creates binaries that are run during the build, and also
48# installed.
49#
50# If host & target are different, then we are building a compiler
51# which will generate intermediate .hc files to port to the target
52# architecture for bootstrapping.  The libraries and stage 2 compiler
53# will be built as HC files for the target system, and likely won't
54# build on this host platform.
55#
56# An important invariant is that for any piece of source code, the
57# platform on which the code is going to run is the HOST platform,
58# and the platform on which we are building is the BUILD platform.
59# Additionally for the compiler, the platform this compiler will
60# generate code for is the TARGET.  TARGET is not meaningful outside
61# the compiler sources.
62#
63# Guidelines for when to use HOST vs. TARGET:
64#
65#  - In the build system (Makefile, foo.mk), normally we should test
66#    $(HOSTPLATFORM).  There are some cases (eg. installation), where
67#    we expect $(HOSTPLATFORM)==$(TARGETPLATFORM), so in those cases it
68#    doesn't matter which is used.
69#
70#  - In the compiler itself, we should test HOST or TARGET depending
71#    on whether the conditional relates to the code being generated, or
72#    the platform on which the compiler is running.  See the section
73#    on "Coding Style" in the commentary for more details.
74#
75#  - In all other code, we should be testing HOST only.
76#
77# NOTE: cross-compiling is not well supported by the build system.
78# You have to do a lot of work by hand to cross compile: see the
79# section on "Porting GHC" in the Building Guide.
80
81HOSTPLATFORM                    = @HostPlatform@
82TARGETPLATFORM                  = @TargetPlatform@
83BUILDPLATFORM                   = @BuildPlatform@
84
85HostPlatform_CPP                = @HostPlatform_CPP@
86HostArch_CPP                    = @HostArch_CPP@
87HostOS_CPP                      = @HostOS_CPP@
88HostVendor_CPP                  = @HostVendor_CPP@
89
90TargetPlatform_CPP              = @TargetPlatform_CPP@
91TargetArch_CPP                  = @TargetArch_CPP@
92TargetOS_CPP                    = @TargetOS_CPP@
93TargetVendor_CPP                = @TargetVendor_CPP@
94
95BuildPlatform_CPP               = @BuildPlatform_CPP@
96BuildArch_CPP                   = @BuildArch_CPP@
97BuildOS_CPP                     = @BuildOS_CPP@
98BuildVendor_CPP                 = @BuildVendor_CPP@
99
100@HostPlatform_CPP@_HOST           = 1
101@TargetPlatform_CPP@_TARGET       = 1
102@BuildPlatform_CPP@_BUILD         = 1
103
104@HostArch_CPP@_HOST_ARCH          = 1
105@TargetArch_CPP@_TARGET_ARCH      = 1
106@BuildArch_CPP@_BUILD_ARCH        = 1
107
108@HostOS_CPP@_HOST_OS              = 1
109@TargetOS_CPP@_TARGET_OS          = 1
110@BuildOS_CPP@_BUILD_OS            = 1
111
112@HostVendor_CPP@_HOST_VENDOR      = 1
113@TargetVendor_CPP@_TARGET_VENDOR  = 1
114@BuildVendor_CPP@_BUILD_VENDOR    = 1
115
116################################################################################
117#
118#               Global configuration options
119#
120################################################################################
121
122# Leading underscores on symbol names in object files
123# Valid options: YES/NO
124#
125LeadingUnderscore=@LeadingUnderscore@
126
127# Pin a suffix on executables? If so, what (Windows only).
128exeext=@exeext@
129soext=@soext@
130
131# Windows=YES if on a Windows platform
132ifneq "$(findstring $(HostOS_CPP), mingw32 cygwin32)" ""
133Windows=YES
134else
135Windows=NO
136endif
137
138# Tell the build system what the host operating system is
139# This distinguishes "msys" and "cygwin", which are not
140# not distinguished by HOST_OS_CPP
141OSTYPE=@OSTYPE@
142
143# In case of Solaris OS, does it provide broken shared libs
144# linker or not?
145SOLARIS_BROKEN_SHLD=@SOLARIS_BROKEN_SHLD@
146
147# Do we have a C compiler using an LLVM back end?
148CC_LLVM_BACKEND = @CC_LLVM_BACKEND@
Note: See TracBrowser for help on using the browser.