Cross Reference: /solaris-userland/components/llvm/Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
#
export PARFAIT_BUILD=no
BUILD_BITS=64
COMPILER=gcc
include ../../make-rules/shared-macros.mk
# We use GCC version 4.9.3, and not another version for now.
GCC_ROOT=/usr/gcc/4.9
COMPONENT_NAME= llvm
COMPONENT_VERSION= 3.8.1
COMPONENT_PROJECT_URL= http://llvm.org/
COMPONENT_SRC= $(COMPONENT_NAME)
COMPONENT_BUGDB= utility/llvm
COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_SRC_NAME= $(COMPONENT_SRC).src
COMPONENT_ARCHIVE= $(COMPONENT_SRC_NAME).tar.xz
COMPONENT_ARCHIVE_HASH= \
sha256:6e82ce4adb54ff3afc18053d6981b6aed1406751b8742582ed50f04b5ab475f9
COMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)/releases/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
TPNO= 28049
COMPONENT_NAME_1 = clang
COMPONENT_SRC_1 = cfe-$(COMPONENT_VERSION).src
COMPONENT_ARCHIVE_1 = $(COMPONENT_SRC_1).tar.xz
COMPONENT_ARCHIVE_HASH_1 = \
sha256:4cd3836dfb4b88b597e075341cae86d61c63ce3963e45c7fe6a8bf59bb382cdf
COMPONENT_ARCHIVE_URL_1 = $(COMPONENT_PROJECT_URL)/releases/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_1)
COMPONENT_POST_UNPACK_ACTION = \
( $(MV) $(COMPONENT_SRC_NAME) $(COMPONENT_SRC) )
COMPONENT_POST_UNPACK_ACTION_1 = \
( $(RM) -rf $(COMPONENT_SRC)/tools/$(COMPONENT_NAME_1) ; \
$(CP) -rp $(COMPONENT_SRC_1) \
$(COMPONENT_SRC)/tools/$(COMPONENT_NAME_1) )
# Depends on S12-only changes in gcc; might be able to deal with later,
# but avoid publishing while this is under investigation.
ifeq ($(BUILD_TYPE), evaluation)
BUILD_64=
INSTALL_64=
PUBLISH_STAMP=
endif
BUILD_STYLE = cmake
CLONEY = echo
GNUCP = /usr/gnu/bin/cp
include $(WS_MAKE_RULES)/common.mk
PATCH_LEVEL := 0
DEBUG_BUILD := 0
HAVE_SPHINX := 0
export PATH=/usr/gnu/bin:/usr/bin:/usr/perl5/$(PERL_VERSION)/bin
# We're building with CMake
CMAKE=/usr/bin/cmake
CMAKE_VERSION := $(shell $(CMAKE) --version 2>&1 | head -n1 \
| $(GSED) 's/cmake version \{1,\}//g')
CMAKE_MAJOR_VERSION := $(shell echo $(CMAKE_VERSION) | cut -f1 -d'.')
CMAKE_MINOR_VERSION := $(shell echo $(CMAKE_VERSION) | cut -f2 -d'.')
CMAKE_MICRO_VERSION := $(shell echo $(CMAKE_VERSION) | cut -f3 -d'.')
# CMake prior to 3.6.0 does not define CMAKE_HOST_SOLARIS.
# In that case, we pass it in CMAKE_OPTIONS.
CMAKE_NEEDS_SOLARIS_HOST := 0
ifeq ($(shell expr $(CMAKE_MAJOR_VERSION) \<= 3 \& \
$(CMAKE_MINOR_VERSION) \<= 5),1)
CMAKE_NEEDS_SOLARIS_HOST = 1
endif
# All of these shoujld probably be in shared-macros.mk
CMAKE_INSTALL_BINDIR.32 = bin
CMAKE_INSTALL_BINDIR.64 = bin/$(MACH64)
CMAKE_INSTALL_BINDIR = $(CMAKE_INSTALL_BINDIR.$(BITS))
CMAKE_INSTALL_LIBDIR.32 = lib
CMAKE_INSTALL_LIBDIR.64 = lib/$(MACH64)
CMAKE_INSTALL_LIBDIR = $(CMAKE_INSTALL_LIBDIR.$(BITS))
CMAKE_INSTALL_LIBEXECDIR.32 = libexec
CMAKE_INSTALL_LIBEXECDIR.64 = libexec/$(MACH64)
CMAKE_INSTALL_LIBEXECDIR = $(CMAKE_INSTALL_LIBEXECDIR.$(BITS))
CMAKE_INSTALL_INCLUDEDIR = include
CMAKE_INSTALL_DATADIR = share
CMAKE_INSTALL_DATAROOTDIR = share
# We need the specific C++ runtime that clang/llvm was built and
# linked with, and not some random and incompatible stuff from
# /usr/lib.
LLVM_RUNPATH_32 = $(GCC_ROOT)/lib
LLVM_RUNPATH_64 = $(GCC_ROOT)/lib/$(MACH64)
LLVM_RUNPATH = $(LLVM_RUNPATH_$(BITS))
# -O0. GCC on SPARC dies with an out-memory error in cc1plus when
# building with either -O1 or -O2 (32-bit). If it manages to get
# through with -O1 or -O2 (64-bit), the resulting bits are unusable.
OFLAG="-O0"
GFLAG=""
ifeq ($(DEBUG_BUILD), 1)
OFLAG="-O0"
GFLAG="-g3"
endif
# Because LLVM's install target doesn't install everything that
# needs to be installed.
EXTRA_INSTALL_BITS=llvm-lto arcmt-test c-arcmt-test c-index-test diagtool
LLVM_INSTALL_BINDIR.32=$(PROTOUSRBINDIR)
LLVM_INSTALL_BINDIR.64=$(PROTOUSRBINDIR64)
LLVM_INSTALL_BINDIR=$(LLVM_INSTALL_BINDIR.$(BITS))
LLVM_BINDIR=$(BUILD_DIR_$(BITS))/bin
INSTALL_CXA_FINALIZE := 0
ifeq ($(SOLARIS_11_ONLY),)
INSTALL_CXA_FINALIZE = 1
endif
SCAN_VIEW_FILES=Reporter.py ScanView.py
CLANG_FORMAT_FILES=clang-format-diff.py clang-format-sublime.py \
clang-format.py
LLVM_MAN_FILES=FileCheck.1 bugpoint.1 clang.1 lit.1 llc.1 lli.1 \
llvm-ar.1 llvm-as.1 llvm-bcanalyzer.1 llvm-build.1 \
llvm-config.1 llvm-cov.1 llvm-diff.1 llvm-dis.1 \
llvm-dwarfdump.1 llvm-extract.1 llvm-lib.1 llvm-link.1 \
llvm-nm.1 llvm-profdata.1 llvm-readobj.1 llvm-stress.1 \
llvm-symbolizer.1 opt.1 tblgen.1
COMPONENT_POST_BUILD_ACTION = \
if test -d $(COMPONENT_DIR)/cxa_finalize ; then \
/usr/gnu/bin/touch $(COMPONENT_DIR)/cxa_finalize/.patched ; \
/usr/gnu/bin/touch $(COMPONENT_DIR)/cxa_finalize/.prep ; \
$(GMAKE) -C $(COMPONENT_DIR)/cxa_finalize build ; \
/usr/gnu/bin/touch $(COMPONENT_DIR)/cxa_finalize/.built ; \
fi
COMPONENT_POST_INSTALL_ACTION = \
if test -d $(COMPONENT_DIR)/cxa_finalize ; then \
$(GMAKE) -C $(COMPONENT_DIR)/cxa_finalize install ; \
/usr/gnu/bin/touch $(COMPONENT_DIR)/cxa_finalize/.installed ; \
fi;
COMPONENT_POST_INSTALL_ACTION += \
list1='$(EXTRA_INSTALL_BITS)' ; for f in $$list1 ; do \
$(INSTALL) --mode=755 $(LLVM_BINDIR)/$$f \
$(LLVM_INSTALL_BINDIR)/$$f ; \
done ;
COMPONENT_POST_INSTALL_ACTION += \
$(MKDIR) \
$(PROTOUSRLIBDIR)/python$(PYTHON_VERSION)/vendor-packages ; \
list2='$(SCAN_VIEW_FILES)' ; for f in $$list2 ; do \
$(INSTALL) --mode=644 $(PROTOUSRSHAREDIR)/scan-view/$$f \
$(PROTOUSRLIBDIR)/python$(PYTHON_VERSION)/vendor-packages/$$f ; \
done ;
COMPONENT_POST_INSTALL_ACTION += \
list3='$(CLANG_FORMAT_FILES)' ; for f in $$list3 ; do \
$(INSTALL) --mode=644 $(PROTOUSRSHAREDIR)/clang/$$f \
$(PROTOUSRLIBDIR)/python$(PYTHON_VERSION)/vendor-packages/$$f ; \
done ;
COMPONENT_POST_INSTALL_ACTION += \
cd $(COMPONENT_DIR) ; \
$(GNUCP) -rpd $(PROTOUSRLIBDIR64)/clang $(PROTOUSRLIBDIR)/ ;
COMPONENT_POST_INSTALL_ACTION += \
cd $(PROTOUSRLIBDIR) ; \
$(PYTHON) -m compileall . ;
COMPONENT_POST_INSTALL_ACTION += \
cd $(COMPONENT_DIR) ; \
$(MKDIR) $(PROTOUSRSHAREMAN1DIR) ; \
list4='$(LLVM_MAN_FILES)' ; for f in $$list4 ; do \
$(INSTALL) --mode=644 $(COMPONENT_DIR)/Solaris/man1/$$f \
$(PROTOUSRSHAREMAN1DIR)/$$f ; \
done ;
ifeq ($(INSTALL_CXA_FINALIZE),1)
COMPONENT_POST_INSTALL_ACTION += \
$(INSTALL) --mode=644 \
$(COMPONENT_DIR)/cxa_finalize/cxa_finalize-32.o \
$(PROTOUSRLIBDIR)/clang/cxa_finalize.o ; \
$(INSTALL) --mode=644 \
$(COMPONENT_DIR)/cxa_finalize/cxa_finalize_pic-32.o \
$(PROTOUSRLIBDIR)/clang/cxa_finalize_pic.o ; \
$(INSTALL) --mode=644 \
$(COMPONENT_DIR)/cxa_finalize/cxa_finalize-64.o \
$(PROTOUSRLIBDIR)/clang/$(MACH64)/cxa_finalize.o ; \
$(INSTALL) --mode=644 \
$(COMPONENT_DIR)/cxa_finalize/cxa_finalize_pic-64.o \
$(PROTOUSRLIBDIR)/clang/$(MACH64)/cxa_finalize_pic.o ;
endif
# Results output is slightly different on Intel vs. SPARC.
# Not enabled just yet because of problems with the way opt
# and FileCheck emit and parse the test case results.
COMPONENT_TEST_MASTER = \
$(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH).master
# Do not change the order of these regexp transforms.
COMPONENT_TEST_TRANSFORMS += \
'-e "/gmake -f/d"' \
'-e "/gmake/d"' \
'-e "/--color=/d"' \
'-e "/Entering/d"' \
'-e "/Leaving/d"' \
'-e "/Built target/d"' \
'-e "/Nothing to be done/d"'
# GCC options used:
# -ftree-vectorize | -fno-tree-vectorize:
# Enable/disable loop vectorization in optimizations. For details:
# https://gcc.gnu.org/projects/tree-ssa/vectorization.html
# Disabled in debug builds, will be enabled in production/optimized
# builds at some point in the future..
#
# -ftree-slp-vectorize | -fno-tree-slp-vectorize:
# Enable/disable Basic Block tree vectorization.
# Less aggressive vectorization than -ftree-vectorize, but useful
# in case -ftree-slp-vectorize misses some vectorization opportunities.
# Documentation at the same URL as above.
# Disabled in debug builds, will be enabled in production/optimized
# builds at some point in the future.
#
# -freorder-blocks | -fno-reorder-blocks
# Enable/disable BasicBlock reordering as an optimization.
# Disabled in debug builds, will be enabled in production/optimized
# builds at some point in the future.
# Documented here:
# https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
#
# -ftoplevel-reorder | -fno-toplevel-reorder
# Another BasiBlock depentent optimization option.
# Disabled in debug builds, will be enabled in production/optimized
# builds at some point in the future.
# Documented here:
# https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
#
# -fstack-protector-all:
# Enable stack smashing (stack corruption) protection and detection.
# This flag should always be used in conjunction with -Wstack-protector.
# -Wstack-protector acts at compile-time, -fstack-protector-all acts
# at runtime. -fstack-protector-all enables linking with libssp.so.
# This flag carries significant runtime overhead, but is very useful.
# Always enabled for now. May be removed in the future.
#
# -g3: Enable macro visibility in GDB. With just -g, debug builds will
# not record the expanded values of macros. With -g3, the values of
# expanded macros will be recorded, and macros will be observable in
# GDB.
#
# -mno-unaligned-doubles:
# Assume that the code does not make use of misaligned doubles on SPARC.
# On SPARC, doubles must align on 8. This flag makes GCC assume that
# there is no misaligned double use in the code, and GCC will not
# attempt to correct such misaligned loads/stores. If, however, there
# is such broken code when using this flag, the program will SIGBUS
# at runtime. This is a very useful debugging flag.
#
# -mhard-float:
# Use hardware floating-point operations when available. Compilers
# generally make very little use of floating-point, but this is
# a valuable/low-cost optimization for those rare cases where
# floating-point operations are used. No-op for quad-floating-point
# and UltraSPARC-1/2/3 because on those ISA's quad-floating-point
# ops are always done in software. But quad-floating-point ops in a
# compiler are virtually non-existent.
#
# -mptr32 | -mptr64:
# Tell GCC the size of a pointer on SPARC.
#
# -mimpure-text:
# When used in addition to -shared on SPARC, this tells GCC to not pass
# -z text to the linker when linking a shared object.
# There is some suspicious interaction happening here between GCC/GAS
# and the Sun linker. Technically, and in theory, this flag should not
# be needed when compiling -fPIC. However, extensive documented use
# and practice has shown that it is indeed needed. The disadvantage
# of using this flag is that it triggers copy-on-write relocations.
#
# -mno-sse3 -mno-ssse3:
# Do not use SSE3/SSSE3 instructions on Intel. These might not be
# available and they always come with side-effects.
# Building for Opteron - which implies SSE2 - is adequate for
# performance purposes.
CFLAGS = -m$(BITS) $(GFLAG) $(OFLAG) -pthread -std=c99 -fno-strict-aliasing
CFLAGS += -fno-tree-slp-vectorize -fno-tree-vectorize
CFLAGS += -fno-reorder-blocks -fno-toplevel-reorder
CFLAGS += -Wall -Wcast-align -Wno-long-long -Woverflow
CFLAGS += -Wstack-protector -fdata-sections -fstack-protector-all
CFLAGS += -fkeep-static-consts -ffunction-sections
CFLAGS += -Wl,-z -Wl,relax=common
CFLAGS += -Wl,-z -Wl,relax=secadj
CFLAGS += -Wl,-z -Wl,relax=transtls
CFLAGS += -Wl,-z -Wl,relax=symbound
CFLAGS += -Wl,-R -Wl,$(LLVM_RUNPATH)
CFLAGS.i386 += -mtune=opteron -mno-sse3 -mno-ssse3 -fno-common
ifeq ($(DEBUG_BUILD),1)
CFLAGS.i386 += -fno-omit-frame-pointer
endif
CFLAGS.sparc += -mtune=ultrasparc -mcpu=ultrasparc -mvis -mhard-float
CFLAGS.sparc += -mptr$(BITS) -fdata-sections -falign-functions=8
CFLAGS.sparc += -mno-unaligned-doubles -mimpure-text
CFLAGS += $(CFLAGS.$(MACH))
CXXFLAGS = -m$(BITS) $(GFLAG) $(OFLAG) -pthread -fno-strict-aliasing
CXXFLAGS += -fexceptions -frtti -fstack-protector-all
CXXFLAGS += -fno-tree-vectorize -fno-tree-slp-vectorize
CXXFLAGS += -fno-reorder-blocks -fno-toplevel-reorder
CXXFLAGS += -Wall -Wcast-align -Wno-long-long -Woverflow
CXXFLAGS += -Wstack-protector -fkeep-static-consts
CXXFLAGS += -std=c++11 -fdata-sections -ffunction-sections
CXXFLAGS += -Wl,-z -Wl,relax=common
CXXFLAGS += -Wl,-z -Wl,relax=secadj
CXXFLAGS += -Wl,-z -Wl,relax=transtls
CXXFLAGS += -Wl,-z -Wl,relax=symbound
CXXFLAGS += -Wl,-z -Wl,relax=comdat
CXXFLAGS += -Wl,-R -Wl,$(LLVM_RUNPATH)
CXXFLAGS.sparc += -mptr$(BITS)
CXXFLAGS += $(CFLAGS.$(MACH))
CPPFLAGS = -D_GNU_SOURCE -DLLVM_SOLARIS -I/usr/gnu/include
ifeq ($(DEBUG_BUILD),1)
CPPFLAGS += -D_DEBUG
endif
CPPFLAGS += -D_REENTRANT -D_LARGEFILE64_SOURCE
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D__EXTENSIONS__=1
CPPFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
CPPFLAGS += -D__STDC_LIMIT_MACROS -DHAVE_POSIX_MEMALIGN
CPPFLAGS += -D_GLIBCXX_FULLY_DYNAMIC_STRING=1
CPPFLAGS.i386 = -DLLVM_INTEL
CPPFLAGS.sparc = -DLLVM_SPARC
CPPFLAGS += $(CPPFLAGS.$(MACH))
LLVM_LIBEXECDIR_32 = /usr/libexec
LLVM_LIBEXECDIR_64 = /usr/libexec/$(MACH64)
LLVM_LIBEXECDIR = $(LLVM_LIBEXECDIR_$(BITS))
LIBFFI_INCDIR_32 = $(shell pkg-config --cflags libffi | sed -e s,-I,,)
LIBFFI_INCDIR_64 = $(shell env PKG_CONFIG_PATH=$(PKG_CONFIG_PATH.64) pkg-config --cflags libffi | sed -e s,-I,,)
LIBFFI_INCDIR = $(LIBFFI_INCDIR_$(BITS))
LIBFFI_LIBDIR_32 = /usr/lib
LIBFFI_LIBDIR_64 = /usr/lib/$(MACH64)
LIBFFI_LIBDIR = $(LIBFFI_LIBDIR_$(BITS))
# -Bdirect and -M /usr/lib/ld/map.noexbss break SPARC builds.
LD_B_DIRECT =
LD_OPTIONS = -M /usr/lib/ld/map.noexstk
LD_OPTIONS += -M /usr/lib/ld/map.pagealign
LD_OPTIONS_SO = $(LD_Z_DEFS) $(LD_DEF_LIBS)
CMAKE_OPTIONS = -DCMAKE_C_COMPILER:FILEPATH=$(CC)
CMAKE_OPTIONS += -DCMAKE_CXX_COMPILER:FILEPATH=$(CXX)
CMAKE_OPTIONS += -DCMAKE_C_CFLAGS:STRING="$(CPPFLAGS) $(CFLAGS)"
CMAKE_OPTIONS += -DCMAKE_CXX_FLAGS:STRING="$(CPPFLAGS) $(CXXFLAGS)"
CMAKE_OPTIONS += -DCMAKE_EXE_LINKER_FLAGS:STRING="$(LDFLAGS)"
CMAKE_OPTIONS += -DCMAKE_INSTALL_PREFIX:FILEPATH=$(CMAKE_PREFIX)
CMAKE_OPTIONS += -DCMAKE_AR:FILEPATH=/usr/bin/ar
CMAKE_OPTIONS += -DCMAKE_INSTALL_BINDIR:STRING="$(CMAKE_INSTALL_BINDIR)"
CMAKE_OPTIONS += -DCMAKE_INSTALL_LIBDIR:STRING="$(CMAKE_INSTALL_LIBDIR)"
CMAKE_OPTIONS += -DCMAKE_INSTALL_LIBEXECDIR:STRING="$(CMAKE_INSTALL_LIBEXECDIR)"
CMAKE_OPTIONS += -DCMAKE_INSTALL_INCLUDEDIR:STRING="$(CMAKE_INSTALL_INCLUDEDIR)"
CMAKE_OPTIONS += -DCMAKE_INSTALL_DATADIR:STRING="$(CMAKE_INSTALL_DATADIR)"
CMAKE_OPTIONS += -DCMAKE_INSTALL_DATAROOTDIR:STRING="$(CMAKE_INSTALL_DATAROOTDIR)"
ifeq ($(MACH),sparc)
CMAKE_OPTIONS += -DLLVM_TARGETS_TO_BUILD:STRING="Sparc"
endif
ifeq ($(MACH),i386)
CMAKE_OPTIONS += -DLLVM_TARGETS_TO_BUILD:STRING="X86"
endif
CMAKE_OPTIONS += -DCMAKE_MAKE_PROGRAM:STRING="/usr/bin/gmake"
CMAKE_OPTIONS += -DCMAKE_ASM_COMPILER:STRING="/usr/gnu/bin/as"
CMAKE_OPTIONS += -DCMAKE_INSTALL_RPATH:STRING="$(LLVM_RUNPATH)"
CMAKE_OPTIONS += -DLLVM_BUILD_TOOLS:BOOL=ON
CMAKE_OPTIONS += -DLLVM_INCLUDE_TOOLS:BOOL=ON
CMAKE_OPTIONS += -DLLVM_BUILD_TESTS:BOOL=ON
CMAKE_OPTIONS += -DLLVM_INCLUDE_TESTS:BOOL=ON
CMAKE_OPTIONS += -DLLVM_ENABLE_THREADS:BOOL=ON
CMAKE_OPTIONS += -DLLVM_BUILD_32_BITS:BOOL=OFF
# CMake tries really hard to be too smart for its own good.
ifeq ($(DEBUG_BUILD),1)
CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE:STRING=Debug
CMAKE_OPTIONS += -DCMAKE_C_FLAGS_DEBUG:STRING="$(OFLAG) $(GFLAG)"
CMAKE_OPTIONS += -DCMAKE_CXX_FLAGS_DEBUG:STRING="$(OFLAG) $(GFLAG)"
CMAKE_OPTIONS += -DCMAKE_ASM_FLAGS_DEBUG:STRING="$(OFLAG) $(GFLAG)"
CMAKE_OPTIONS += -DCMAKE_ASM_FLAGS_RELWITHDEBINFO:STRING="$(OFLAG) $(GFLAG)"
CMAKE_OPTIONS += -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="$(OFLAG) $(GFLAG)"
CMAKE_OPTIONS += -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="$(OFLAG) $(GFLAG)"
CMAKE_OPTIONS += -DLLVM_BUILD_EXAMPLES:BOOL=ON
CMAKE_OPTIONS += -DLLVM_INCLUDE_EXAMPLES:BOOL=ON
CMAKE_OPTIONS += -DLLVM_ENABLE_ASSERTIONS:BOOL=ON
CMAKE_OPTIONS += -DLLVM_ENABLE_EXPENSIVE_CHECKS:BOOL=ON
else
CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE:STRING=Release
CMAKE_OPTIONS += -DCMAKE_C_FLAGS_DEBUG:STRING="$(OFLAG)"
CMAKE_OPTIONS += -DCMAKE_CXX_FLAGS_DEBUG:STRING="$(OFLAG)"
CMAKE_OPTIONS += -DCMAKE_ASM_FLAGS_DEBUG:STRING="$(OFLAG)"
CMAKE_OPTIONS += -DCMAKE_ASM_FLAGS_RELWITHDEBINFO:STRING="$(OFLAG)"
CMAKE_OPTIONS += -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="$(OFLAG)"
CMAKE_OPTIONS += -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="$(OFLAG)"
CMAKE_OPTIONS += -DLLVM_BUILD_EXAMPLES:BOOL=OFF
CMAKE_OPTIONS += -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF
CMAKE_OPTIONS += -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF
CMAKE_OPTIONS += -DLLVM_ENABLE_EXPENSIVE_CHECKS:BOOL=OFF
endif
CMAKE_OPTIONS += -DLLVM_ENABLE_EH:BOOL=ON
CMAKE_OPTIONS += -DLLVM_ENABLE_PIC:BOOL=ON
CMAKE_OPTIONS += -DLLVM_ENABLE_RTTI:BOOL=ON
CMAKE_OPTIONS += -DLLVM_ENABLE_WARNINGS:BOOL=ON
CMAKE_OPTIONS += -DLLVM_ENABLE_PEDANTIC:BOOL=ON
CMAKE_OPTIONS += -DLLVM_ABI_BREAKING_CHECKS:STRING="FORCE_OFF"
CMAKE_OPTIONS += -DLLVM_ENABLE_ZLIB:BOOL=ON
CMAKE_OPTIONS += -DLLVM_ENABLE_FFI:BOOL=ON
CMAKE_OPTIONS += -DFFI_INCLUDE_DIR:STRING=$(LIBFFI_INCDIR)
CMAKE_OPTIONS += -DFFI_LIBRARY_DIR:STRING=$(LIBFFI_LIBDIR)
ifeq ($(HAVE_SPHINX),1)
CMAKE_OPTIONS += -DSPHINX_EXECUTABLE:STRING="/usr/bin/sphinx-build"
CMAKE_OPTIONS += -DLLVM_ENABLE_SPHINX:BOOL=ON
CMAKE_OPTIONS += -DLLVM_BUILD_DOCS:BOOL=ON
CMAKE_OPTIONS += -DSPHINX_OUTPUT_HTML:BOOL=ON
CMAKE_OPTIONS += -DSPHINX_OUTPUT_MAN:BOOL=ON
endif
# Always build the libLLVM and libclang shared libraries
CMAKE_OPTIONS += -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON
CMAKE_OPTIONS += -DLLVM_LINK_LLVM_DYLIB:BOOL=ON
CMAKE_OPTIONS += -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
CMAKE_OPTIONS += -DLLVM_COMPILER_IS_GCC_COMPATIBLE:BOOL=ON
ifeq ($(CMAKE_NEEDS_SOLARIS_HOST),1)
CMAKE_OPTIONS += -DCMAKE_HOST_SOLARIS:BOOL=TRUE
endif
COMPONENT_BUILD_ENV = CC="$(CC)"
COMPONENT_BUILD_ENV += CXX="$(CXX)"
COMPONENT_BUILD_ENV += CFLAGS="$(CFLAGS)"
COMPONENT_BUILD_ENV += CXXFLAGS="$(CXXFLAGS)"
COMPONENT_BUILD_ENV += LDFLAGS="$(LDFLAGS)"
COMPONENT_BUILD_ENV += LD_OPTIONS="$(LD_OPTIONS)"
COMPONENT_BUILD_ENV += PATH="$(PATH)"
COMPONENT_BUILD_ENV += LANG="C"
COMPONENT_BUILD_ENV += LC_ALL="C"
COMPONENT_BUILD_ENV += LD_EXEC_OPTIONS="-zaslr=disable"
# Put this here for now until the gpatch problems are resolved.
COMPONENT_BUILD_ARGS += -j4
# use bash(1) to run the install recipes otherwise clang header installation
# fails
COMPONENT_INSTALL_ARGS += SHELL=/bin/bash
COMPONENT_PRE_BUILD_ACTION += cd $(@D) ;
COMPONENT_PRE_BUILD_ACTION += echo BITS: $(BITS) ;
COMPONENT_PRE_BUILD_ACTION += echo Running cmake with $(CMAKE_OPTIONS) ;
COMPONENT_PRE_BUILD_ACTION += /usr/bin/env - $(COMPONENT_BUILD_ENV) \
$(CMAKE) $(CMAKE_OPTIONS) \
$(COMPONENT_DIR)/$(COMPONENT_SRC) ;
# There are no master test results just yet. But there will be
# very soon.
test:
@echo "Tests not yet implemented - coming soon in LLVM 3.8.1."
system-test: $(SYSTEM_TESTS_NOT_IMPLEMENTED)
REQUIRED_PACKAGES += developer/gcc-4/gcc-common-49
REQUIRED_PACKAGES += developer/gnu-binutils
REQUIRED_PACKAGES += library/libedit
REQUIRED_PACKAGES += library/libffi
REQUIRED_PACKAGES += library/libiomp5
REQUIRED_PACKAGES += library/libxml2
REQUIRED_PACKAGES += library/zlib
REQUIRED_PACKAGES += runtime/perl-522
REQUIRED_PACKAGES += library/perl-5/xml-libxml
REQUIRED_PACKAGES += library/perl-5/xml-namespacesupport
REQUIRED_PACKAGES += library/perl-5/xml-parser
REQUIRED_PACKAGES += library/perl-5/xml-sax
REQUIRED_PACKAGES += library/perl-5/xml-sax-base
REQUIRED_PACKAGES += library/perl-5/xml-simple
REQUIRED_PACKAGES += runtime/python-27
REQUIRED_PACKAGES += system/core-os
REQUIRED_PACKAGES += system/header
REQUIRED_PACKAGES += system/library/gcc/gcc-runtime-49
REQUIRED_PACKAGES += system/library/gcc/gcc-c++-runtime-49
REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime-49
REQUIRED_PACKAGES += system/library/gcc/gcc-gobjc-runtime-49
REQUIRED_PACKAGES += system/library/math
REQUIRED_PACKAGES += system/linker