Makefile revision 5432
5432N/A#
5432N/A# CDDL HEADER START
5432N/A#
5432N/A# The contents of this file are subject to the terms of the
5432N/A# Common Development and Distribution License (the "License").
5432N/A# You may not use this file except in compliance with the License.
5432N/A#
5432N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5432N/A# or http://www.opensolaris.org/os/licensing.
5432N/A# See the License for the specific language governing permissions
5432N/A# and limitations under the License.
5432N/A#
5432N/A# When distributing Covered Code, include this CDDL HEADER in each
5432N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5432N/A# If applicable, add the following below this CDDL HEADER, with the
5432N/A# fields enclosed by brackets "[]" replaced with your own identifying
5432N/A# information: Portions Copyright [yyyy] [name of copyright owner]
5432N/A#
5432N/A# CDDL HEADER END
5432N/A#
5432N/A
5432N/A#
5432N/A# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
5432N/A#
5432N/Aexport PARFAIT_BUILD=no
5432N/ACOMPILER=gcc
5432N/A
5432N/Ainclude ../../make-rules/shared-macros.mk
5432N/A
5432N/ACOMPONENT_NAME= llvm
5432N/ACOMPONENT_VERSION= 3.6.2
5432N/ACOMPONENT_PROJECT_URL= http://llvm.org/
5432N/ACOMPONENT_SRC= $(COMPONENT_NAME)
5432N/ACOMPONENT_BUGDB= utility/llvm
5432N/A
5432N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
5432N/ACOMPONENT_SRC_NAME= $(COMPONENT_SRC).src
5432N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC_NAME).tar.xz
5432N/ACOMPONENT_ARCHIVE_HASH= \
5432N/A sha256:f60dc158bfda6822de167e87275848969f0558b3134892ff54fced87e4667b94
5432N/ACOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)/releases/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
5432N/A
5432N/ATPNO= 24358
5432N/A
5432N/ACOMPONENT_NAME_1 = clang
5432N/ACOMPONENT_SRC_1 = cfe-$(COMPONENT_VERSION).src
5432N/ACOMPONENT_ARCHIVE_1 = $(COMPONENT_SRC_1).tar.xz
5432N/ACOMPONENT_ARCHIVE_HASH_1 = \
5432N/A sha256:ae9180466a23acb426d12444d866b266ff2289b266064d362462e44f8d4699f3
5432N/ACOMPONENT_ARCHIVE_URL_1 = $(COMPONENT_PROJECT_URL)/releases/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_1)
5432N/A
5432N/ACOMPONENT_POST_UNPACK_ACTION = \
5432N/A ( $(MV) $(COMPONENT_SRC_NAME) $(COMPONENT_SRC) )
5432N/A
5432N/ACOMPONENT_POST_UNPACK_ACTION_1 = \
5432N/A ( $(RM) -rf $(COMPONENT_SRC)/tools/$(COMPONENT_NAME_1) ; \
5432N/A $(CP) -rp $(COMPONENT_SRC_1) \
5432N/A $(COMPONENT_SRC)/tools/$(COMPONENT_NAME_1) )
5432N/A
5432N/ACOMPONENT_PRE_CONFIGURE_ACTION = \
5432N/A ( cd $(SOURCE_DIR) ; \
5432N/A $(CHMOD) 0755 ./autoconf/AutoRegen.sh ; \
5432N/A ./autoconf/AutoRegen.sh )
5432N/A
5432N/ACOMPONENT_POST_BUILD_ACTION = \
5432N/A if test -d $(COMPONENT_DIR)/cxa_finalize ; then \
5432N/A $(GMAKE) -C $(COMPONENT_DIR)/cxa_finalize build ; \
5432N/A fi
5432N/A
5432N/ACOMPONENT_POST_INSTALL_ACTION = \
5432N/A if test -d $(COMPONENT_DIR)/cxa_finalize ; then \
5432N/A $(GMAKE) -C $(COMPONENT_DIR)/cxa_finalize install ; \
5432N/A fi;
5432N/A
5432N/Ainclude $(WS_MAKE_RULES)/prep.mk
5432N/Ainclude $(WS_MAKE_RULES)/configure.mk
5432N/Ainclude $(WS_MAKE_RULES)/ips.mk
5432N/A
5432N/APATCH_LEVEL := 0
5432N/ADEBUG_BUILD := 0
5432N/AGCC_VERSION := 4.9
5432N/A
5432N/A# We need GCC version 4.9, and not another version.
5432N/ACC=/usr/gcc/$(GCC_VERSION)/bin/gcc
5432N/ACXX=/usr/gcc/$(GCC_VERSION)/bin/g++
5432N/A
5432N/A# We need the specific C++ runtime that clang/llvm was built and
5432N/A# linked with, and not some random and incompatible stuff from
5432N/A# /usr/lib.
5432N/ALLVM_RUNPATH_32 = /usr/gcc/$(GCC_VERSION)/lib
5432N/ALLVM_RUNPATH_64 = /usr/gcc/$(GCC_VERSION)/lib/$(MACH64)
5432N/ALLVM_RUNPATH = $(LLVM_RUNPATH_$(BITS))
5432N/A
5432N/A# -O0 for now. Ideally we want -O2.
5432N/AOFLAG="-O0"
5432N/AGFLAG=""
5432N/A
5432N/Aifeq ($(DEBUG_BUILD), 1)
5432N/A OFLAG="-O0"
5432N/A GFLAG="-g3"
5432N/Aendif
5432N/A
5432N/Aexport PATH=/usr/gnu/bin:/usr/xpg4/bin:/usr/bin:/usr/perl5/5.16/bin
5432N/A
5432N/A# Because LLVM's install target doesn't install everything that
5432N/A# needs to be installed.
5432N/AEXTRA_INSTALL_BITS=llvm-lto arcmt-test c-arcmt-test c-index-test diagtool
5432N/ALLVM_BINDIR=$(BUILD_DIR_64)/Release/bin
5432N/A
5432N/Aifeq ($(DEBUG_BUILD), 1)
5432N/A LLVM_BINDIR=$(BUILD_DIR_64)/Debug+Asserts+Checks/bin
5432N/Aendif
5432N/A
5432N/ACOMPONENT_POST_INSTALL_ACTION += \
5432N/A list1='$(EXTRA_INSTALL_BITS)' ; for f in $$list1 ; do \
5432N/A $(INSTALL) --mode=755 $(LLVM_BINDIR)/$$f $(PROTOUSRBINDIR)/$$f ; \
5432N/A done;
5432N/A
5432N/A# No ASLR for compilers.
5432N/AASLR_MODE = $(ASLR_DISABLE)
5432N/A
5432N/A# GCC options used:
5432N/A# -ftree-vectorize | -fno-tree-vectorize:
5432N/A# Enable/disable loop vectorization in optimizations. For details:
5432N/A# https://gcc.gnu.org/projects/tree-ssa/vectorization.html
5432N/A# Disabled in debug builds, will be enabled in production/optimized
5432N/A# builds at some point in the future..
5432N/A#
5432N/A# -ftree-slp-vectorize | -fno-tree-slp-vectorize:
5432N/A# Enable/disable Basic Block tree vectorization.
5432N/A# Less aggressive vectorization than -ftree-vectorize, but useful
5432N/A# in case -ftree-slp-vectorize misses some vectorization opportunities.
5432N/A# Documentation at the same URL as above.
5432N/A# Disabled in debug builds, will be enabled in production/optimized
5432N/A# builds at some point in the future.
5432N/A#
5432N/A# -freorder-blocks | -fno-reorder-blocks
5432N/A# Enable/disable BasicBlock reordering as an optimization.
5432N/A# Disabled in debug builds, will be enabled in production/optimized
5432N/A# builds at some point in the future.
5432N/A# Documented here:
5432N/A# https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
5432N/A#
5432N/A# -ftoplevel-reorder | -fno-toplevel-reorder
5432N/A# Another BasiBlock depentent optimization option.
5432N/A# Disabled in debug builds, will be enabled in production/optimized
5432N/A# builds at some point in the future.
5432N/A# Documented here:
5432N/A# https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
5432N/A#
5432N/A# -fstack-protector-all:
5432N/A# Enable stack smashing (stack corruption) protection and detection.
5432N/A# This flag should always be used in conjunction with -Wstack-protector.
5432N/A# -Wstack-protector acts at compile-time, -fstack-protector-all acts
5432N/A# at runtime. -fstack-protector-all enables linking with libssp.so.
5432N/A# This flag carries significant runtime overhead, but is very useful.
5432N/A# Always enabled for now. May be removed in the future.
5432N/A#
5432N/A# -g3: Enable macro visibility in GDB. With just -g, debug builds will
5432N/A# not record the expanded values of macros. With -g3, the values of
5432N/A# expanded macros will be recorded, and macros will be observable in
5432N/A# GDB.
5432N/A#
5432N/A# -mno-unaligned-doubles:
5432N/A# Assume that the code does not make use of misaligned doubles on SPARC.
5432N/A# On SPARC, doubles must align on 8. This flag makes GCC assume that
5432N/A# there is no misaligned double use in the code, and GCC will not
5432N/A# attempt to correct such misaligned loads/stores. If, however, there
5432N/A# is such broken code when using this flag, the program will SIGBUS
5432N/A# at runtime. This is a very useful debugging flag.
5432N/A#
5432N/A# -mhard-float:
5432N/A# Use hardware floating-point operations when available. Compilers
5432N/A# generally make very little use of floating-point, but this is
5432N/A# a valuable/low-cost optimization for those rare cases where
5432N/A# floating-point operations are used. No-op for quad-floating-point
5432N/A# and UltraSPARC-1/2/3 because on those ISA's quad-floating-point
5432N/A# ops are always done in software. But quad-floating-point ops in a
5432N/A# compiler are virtually non-existent.
5432N/A#
5432N/A# -mptr32 | -mptr64:
5432N/A# Tell GCC the size of a pointer on SPARC.
5432N/A#
5432N/A# -mimpure-text:
5432N/A# When used in addition to -shared on SPARC, this tells GCC to not pass
5432N/A# -z text to the linker when linking a shared object.
5432N/A# There is some suspicious interaction happening here between GCC/GAS
5432N/A# and the Sun linker. Technically, and in theory, this flag should not
5432N/A# be needed when compiling -fPIC. However, extensive documented use
5432N/A# and practice has shown that it is indeed needed. The disadvantage
5432N/A# of using this flag is that it triggers copy-on-write relocations.
5432N/A#
5432N/A# -mno-sse3 -mno-ssse3:
5432N/A# Do not use SSE3/SSSE3 instructions on Intel. These might not be
5432N/A# available. Building for Opteron - which implies SSE2 - is adequate
5432N/A# for performance purposes.
5432N/A
5432N/ACFLAGS = -m$(BITS) $(GFLAG) $(OFLAG) -pthread -std=c99 -fno-strict-aliasing
5432N/ACFLAGS += -fno-tree-slp-vectorize -fno-tree-vectorize
5432N/ACFLAGS += -fno-reorder-blocks -fno-toplevel-reorder
5432N/ACFLAGS += -Wall -Wcast-align -Wno-long-long -Woverflow
5432N/ACFLAGS += -Wstack-protector -fdata-sections -fstack-protector-all
5432N/ACFLAGS += -fkeep-static-consts -ffunction-sections
5432N/ACFLAGS += -Wl,-z -Wl,relax=common -Wl,-z -Wl,relax=secadj
5432N/ACFLAGS += -Wl,-z -Wl,relax=transtls -Wl,-R -Wl,$(LLVM_RUNPATH)
5432N/ACFLAGS.i386 += -mtune=opteron -mno-sse3 -mno-ssse3 -fno-common
5432N/ACFLAGS.sparc += -mtune=ultrasparc -mcpu=ultrasparc -mvis -mhard-float
5432N/ACFLAGS.sparc += -mptr$(BITS) -fdata-sections -falign-functions=8
5432N/ACFLAGS.sparc += -mno-unaligned-doubles -mimpure-text
5432N/ACFLAGS += $(CFLAGS.$(MACH))
5432N/A
5432N/ACXXFLAGS = -m$(BITS) $(GFLAG) $(OFLAG) -pthread -fno-strict-aliasing
5432N/ACXXFLAGS += -fexceptions -frtti -fstack-protector-all
5432N/ACXXFLAGS += -fno-tree-vectorize -fno-tree-slp-vectorize
5432N/ACXXFLAGS += -fno-reorder-blocks -fno-toplevel-reorder
5432N/ACXXFLAGS += -Wall -Wcast-align -Wno-long-long -Woverflow
5432N/ACXXFLAGS += -Wstack-protector -fkeep-static-consts
5432N/ACXXFLAGS += -std=c++11 -fdata-sections -ffunction-sections
5432N/ACXXFLAGS += -Wl,-z -Wl,relax=common -Wl,-z -Wl,relax=secadj
5432N/ACXXFLAGS += -Wl,-z -Wl,relax=transtls -Wl,-R -Wl,$(LLVM_RUNPATH)
5432N/ACXXFLAGS.sparc += -mptr$(BITS)
5432N/ACXXFLAGS += $(CFLAGS.$(MACH))
5432N/A
5432N/ACPPFLAGS = -D_GNU_SOURCE -DLLVM_SOLARIS -I/usr/gnu/include
5432N/A
5432N/Aifeq ($(DEBUG_BUILD), 1)
5432N/A CPPFLAGS += -D_DEBUG
5432N/Aendif
5432N/A
5432N/ACPPFLAGS += -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
5432N/ACPPFLAGS += -D_FILE_OFFSET_BITS=64 -D__EXTENSIONS__=1
5432N/ACPPFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
5432N/ACPPFLAGS += -D__STDC_LIMIT_MACROS -DHAVE_POSIX_MEMALIGN
5432N/ACPPFLAGS += -D_GLIBCXX_FULLY_DYNAMIC_STRING=1
5432N/ACPPFLAGS.i386 = -DLLVM_INTEL
5432N/ACPPFLAGS.sparc = -DLLVM_SPARC
5432N/ACPPFLAGS += $(CPPFLAGS.$(MACH))
5432N/A
5432N/ALLVM_LIBDIR_32 = /usr/lib
5432N/ALLVM_LIBDIR_64 = /usr/lib/$(MACH64)
5432N/ALLVM_LIBDIR = $(LLVM_LIBDIR_$(BITS))
5432N/A
5432N/ALLVM_LIBEXECDIR_32 = /usr/libexec
5432N/ALLVM_LIBEXECDIR_64 = /usr/libexec/$(MACH64)
5432N/ALLVM_LIBEXECDIR = $(LLVM_LIBEXECDIR_$(BITS))
5432N/A
5432N/ACONFIGURE_SCRIPT = $(SOURCE_DIR)/configure
5432N/ACONFIGURE_OPTIONS += CC="$(CC)"
5432N/ACONFIGURE_OPTIONS += CXX="$(CXX)"
5432N/ACONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
5432N/ACONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)"
5432N/ACONFIGURE_OPTIONS += CXXFLAGS="$(CXXFLAGS)"
5432N/ACONFIGURE_OPTIONS += --libdir=$(LLVM_LIBDIR)
5432N/ACONFIGURE_OPTIONS += --libexecdir=$(LLVM_LIBEXECDIR)
5432N/ACONFIGURE_OPTIONS += --sharedstatedir=/tmp
5432N/ACONFIGURE_OPTIONS += --localstatedir=/var
5432N/ACONFIGURE_OPTIONS += --enable-compiler-version-checks=yes
5432N/ACONFIGURE_OPTIONS += --enable-clang-static-analyzer=yes
5432N/A
5432N/Aifeq ($(DEBUG_BUILD), 1)
5432N/A CONFIGURE_OPTIONS += --enable-assertions=yes
5432N/A CONFIGURE_OPTIONS += --enable-optimized=no
5432N/A CONFIGURE_OPTIONS += --enable-expensive-checks=yes
5432N/A CONFIGURE_OPTIONS += --enable-debug-runtime=yes
5432N/A CONFIGURE_OPTIONS += --enable-debug-symbols=yes
5432N/Aelse
5432N/A CONFIGURE_OPTIONS += --enable-assertions=no
5432N/A CONFIGURE_OPTIONS += --enable-optimized=yes
5432N/A CONFIGURE_OPTIONS += --enable-expensive-checks=no
5432N/A CONFIGURE_OPTIONS += --enable-debug-runtime=no
5432N/A CONFIGURE_OPTIONS += --enable-debug-symbols=no
5432N/Aendif
5432N/A
5432N/ACONFIGURE_OPTIONS += --enable-keep-symbols=yes
5432N/ACONFIGURE_OPTIONS += --enable-jit=yes
5432N/ACONFIGURE_OPTIONS += --disable-docs
5432N/ACONFIGURE_OPTIONS += --disable-doxygen
5432N/ACONFIGURE_OPTIONS += --enable-threads=yes
5432N/ACONFIGURE_OPTIONS += --enable-pthreads=yes
5432N/ACONFIGURE_OPTIONS += --enable-shared=yes
5432N/ACONFIGURE_OPTIONS += --enable-zlib=yes
5432N/ACONFIGURE_OPTIONS += --enable-pic=yes
5432N/ACONFIGURE_OPTIONS += --enable-timestamps
5432N/ACONFIGURE_OPTIONS += --enable-backtraces
5432N/ACONFIGURE_OPTIONS += --enable-bindings=auto
5432N/ACONFIGURE_OPTIONS += --enable-libffi=yes
5432N/ACONFIGURE_OPTIONS += --enable-terminfo=yes
5432N/ACONFIGURE_OPTIONS += --enable-ltdl-install=no
5432N/ACONFIGURE_OPTIONS += --with-python=$(PYTHON)
5432N/A
5432N/Aifeq ($(MACH),sparc)
5432N/A CONFIGURE_OPTIONS += --with-extra-ld-options='-lkstat'
5432N/Aendif
5432N/ACONFIGURE_OPTIONS += --with-gcc-toolchain=/usr/gcc/$(GCC_VERSION)
5432N/ACONFIGURE_OPTIONS += --with-optimize-option="$(OFLAG) $(GFLAG)"
5432N/A
5432N/A# Enable the cross-compiler in 3.8.X.
5432N/ACONFIGURE_OPTIONS.i386 += --enable-targets="x86"
5432N/ACONFIGURE_OPTIONS.sparc += --enable-targets="sparc"
5432N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH))
5432N/A
5432N/A# Put this here for now until the gpatch problems are resolved.
5432N/ACOMPONENT_BUILD_ARGS += -j8
5432N/A
5432N/A# use bash(1) to run the install recipes otherwise clang header installation
5432N/A# fails
5432N/ACOMPONENT_INSTALL_ARGS += SHELL=/bin/bash
5432N/A
5432N/A# common targets
5432N/Aconfigure: $(CONFIGURE_64)
5432N/A
5432N/Abuild: $(BUILD_64)
5432N/A
5432N/Ainstall: $(INSTALL_64)
5432N/A
5432N/A# There are no master test results yet. TBDL in 3.8.X.
5432N/Atest:
5432N/A @echo "Tests not yet implemented (wait for 3.8.X)."
5432N/A
5432N/Asystem-test: $(SYSTEM_TESTS_NOT_IMPLEMENTED)
5432N/A
5432N/AREQUIRED_PACKAGES += developer/gcc-4/gcc-common-49
5432N/AREQUIRED_PACKAGES += developer/gnu-binutils
5432N/AREQUIRED_PACKAGES += library/libedit
5432N/AREQUIRED_PACKAGES += library/libffi
5432N/AREQUIRED_PACKAGES += library/libxml2
5432N/AREQUIRED_PACKAGES += library/zlib
5432N/AREQUIRED_PACKAGES += runtime/python-27
5432N/AREQUIRED_PACKAGES += system/core-os
5432N/AREQUIRED_PACKAGES += system/header
5432N/AREQUIRED_PACKAGES += system/library
5432N/AREQUIRED_PACKAGES += system/library/gcc/gcc-c++-runtime-49
5432N/AREQUIRED_PACKAGES += system/library/gcc/gcc-gobjcc-runtime-49
5432N/AREQUIRED_PACKAGES += system/library/math
5432N/AREQUIRED_PACKAGES += system/linker
5432N/A