head	1.66;
access;
symbols
	pkgsrc-2026Q1:1.65.0.8
	pkgsrc-2026Q1-base:1.65
	pkgsrc-2025Q4:1.65.0.6
	pkgsrc-2025Q4-base:1.65
	pkgsrc-2025Q3:1.65.0.4
	pkgsrc-2025Q3-base:1.65
	pkgsrc-2025Q2:1.65.0.2
	pkgsrc-2025Q2-base:1.65
	pkgsrc-2025Q1:1.63.0.6
	pkgsrc-2025Q1-base:1.63
	pkgsrc-2024Q4:1.63.0.4
	pkgsrc-2024Q4-base:1.63
	pkgsrc-2024Q3:1.63.0.2
	pkgsrc-2024Q3-base:1.63
	pkgsrc-2024Q2:1.58.0.2
	pkgsrc-2024Q2-base:1.58
	pkgsrc-2024Q1:1.55.0.4
	pkgsrc-2024Q1-base:1.55
	pkgsrc-2023Q4:1.55.0.2
	pkgsrc-2023Q4-base:1.55
	pkgsrc-2023Q3:1.54.0.6
	pkgsrc-2023Q3-base:1.54
	pkgsrc-2023Q2:1.54.0.4
	pkgsrc-2023Q2-base:1.54
	pkgsrc-2023Q1:1.54.0.2
	pkgsrc-2023Q1-base:1.54
	pkgsrc-2022Q4:1.52.0.4
	pkgsrc-2022Q4-base:1.52
	pkgsrc-2022Q3:1.52.0.2
	pkgsrc-2022Q3-base:1.52
	pkgsrc-2022Q2:1.49.0.2
	pkgsrc-2022Q2-base:1.49
	pkgsrc-2022Q1:1.47.0.4
	pkgsrc-2022Q1-base:1.47
	pkgsrc-2021Q4:1.47.0.2
	pkgsrc-2021Q4-base:1.47
	pkgsrc-2021Q3:1.46.0.10
	pkgsrc-2021Q3-base:1.46
	pkgsrc-2021Q2:1.46.0.8
	pkgsrc-2021Q2-base:1.46
	pkgsrc-2021Q1:1.46.0.6
	pkgsrc-2021Q1-base:1.46
	pkgsrc-2020Q4:1.46.0.4
	pkgsrc-2020Q4-base:1.46
	pkgsrc-2020Q3:1.46.0.2
	pkgsrc-2020Q3-base:1.46
	pkgsrc-2020Q2:1.44.0.2
	pkgsrc-2020Q2-base:1.44
	pkgsrc-2020Q1:1.41.0.2
	pkgsrc-2020Q1-base:1.41
	pkgsrc-2019Q4:1.37.0.4
	pkgsrc-2019Q4-base:1.37
	pkgsrc-2019Q3:1.34.0.2
	pkgsrc-2019Q3-base:1.34
	pkgsrc-2019Q2:1.32.0.2
	pkgsrc-2019Q2-base:1.32
	pkgsrc-2019Q1:1.31.0.2
	pkgsrc-2019Q1-base:1.31
	pkgsrc-2018Q4:1.30.0.2
	pkgsrc-2018Q4-base:1.30
	pkgsrc-2018Q3:1.28.0.2
	pkgsrc-2018Q3-base:1.28
	pkgsrc-2018Q2:1.26.0.2
	pkgsrc-2018Q2-base:1.26
	pkgsrc-2018Q1:1.25.0.2
	pkgsrc-2018Q1-base:1.25
	pkgsrc-2017Q4:1.24.0.2
	pkgsrc-2017Q4-base:1.24
	pkgsrc-2017Q3:1.23.0.4
	pkgsrc-2017Q3-base:1.23
	pkgsrc-2017Q2:1.22.0.2
	pkgsrc-2017Q2-base:1.22
	pkgsrc-2017Q1:1.19.0.2
	pkgsrc-2017Q1-base:1.19
	pkgsrc-2016Q4:1.16.0.2
	pkgsrc-2016Q4-base:1.16
	pkgsrc-2016Q3:1.14.0.2
	pkgsrc-2016Q3-base:1.14
	pkgsrc-2016Q2:1.13.0.4
	pkgsrc-2016Q2-base:1.13
	pkgsrc-2016Q1:1.13.0.2
	pkgsrc-2016Q1-base:1.13
	pkgsrc-2015Q4:1.10.0.2
	pkgsrc-2015Q4-base:1.10
	pkgsrc-2015Q3:1.7.0.2
	pkgsrc-2015Q3-base:1.7
	pkgsrc-2015Q2:1.6.0.2
	pkgsrc-2015Q2-base:1.6
	pkgsrc-2015Q1:1.4.0.2
	pkgsrc-2015Q1-base:1.4;
locks; strict;
comment	@# @;


1.66
date	2026.03.25.22.56.25;	author wiz;	state Exp;
branches;
next	1.65;
commitid	29BuEbar9GuKtpzG;

1.65
date	2025.05.09.05.51.24;	author adam;	state Exp;
branches;
next	1.64;
commitid	gd9WBpmGiiwY5cUF;

1.64
date	2025.05.06.12.07.32;	author wiz;	state Exp;
branches;
next	1.63;
commitid	XKZsX38e3wO0hQTF;

1.63
date	2024.08.25.06.18.55;	author wiz;	state Exp;
branches;
next	1.62;
commitid	BcrSL94SO85mvanF;

1.62
date	2024.07.07.14.00.38;	author wiz;	state Exp;
branches;
next	1.61;
commitid	Dnux9Fk2G1eIDUgF;

1.61
date	2024.07.07.14.00.21;	author wiz;	state Exp;
branches;
next	1.60;
commitid	7D3yOyJILV2DDUgF;

1.60
date	2024.07.07.07.36.08;	author jperkin;	state Exp;
branches;
next	1.59;
commitid	q6aBIiXZWuO7vSgF;

1.59
date	2024.07.06.15.45.07;	author adam;	state Exp;
branches;
next	1.58;
commitid	9KpFpYTi5zNpfNgF;

1.58
date	2024.06.17.11.27.02;	author jperkin;	state Exp;
branches;
next	1.57;
commitid	0P9QpSXr6dZOqkeF;

1.57
date	2024.05.09.14.15.51;	author jperkin;	state Exp;
branches;
next	1.56;
commitid	QjAbpX1uks8AAk9F;

1.56
date	2024.04.22.07.03.35;	author adam;	state Exp;
branches;
next	1.55;
commitid	tEZ1Jw1nhrb3M67F;

1.55
date	2023.10.06.19.15.20;	author adam;	state Exp;
branches;
next	1.54;
commitid	AfeawfMstncfdBHE;

1.54
date	2023.01.25.16.45.40;	author wiz;	state Exp;
branches;
next	1.53;
commitid	FbRonujT6dfuyWaE;

1.53
date	2023.01.24.18.36.28;	author wiz;	state Exp;
branches;
next	1.52;
commitid	ve7xOYU4T11xcPaE;

1.52
date	2022.08.14.12.13.03;	author tnn;	state Exp;
branches;
next	1.51;
commitid	XAX1ECP6mDTQjQPD;

1.51
date	2022.08.13.09.58.03;	author tnn;	state Exp;
branches;
next	1.50;
commitid	FV29IOLWd3cxBHPD;

1.50
date	2022.08.12.08.45.44;	author pin;	state Exp;
branches;
next	1.49;
commitid	iMkgZ4gu8BRIezPD;

1.49
date	2022.06.11.13.45.44;	author fcambus;	state Exp;
branches;
next	1.48;
commitid	Ur5ax14JahyeTCHD;

1.48
date	2022.05.05.08.24.41;	author nia;	state Exp;
branches;
next	1.47;
commitid	3xcooroah9NOiQCD;

1.47
date	2021.11.23.20.55.43;	author wiz;	state Exp;
branches;
next	1.46;
commitid	1fDG4kXskvkoGXhD;

1.46
date	2020.07.02.10.45.38;	author wiz;	state Exp;
branches;
next	1.45;
commitid	HYVGHMbJy7CdGueC;

1.45
date	2020.07.01.14.46.37;	author adam;	state Exp;
branches;
next	1.44;
commitid	FKS6Ml8dlQ573oeC;

1.44
date	2020.05.07.20.21.41;	author rillig;	state Exp;
branches;
next	1.43;
commitid	P4Fl9qFRSy2YEl7C;

1.43
date	2020.04.26.10.19.26;	author rillig;	state Exp;
branches;
next	1.42;
commitid	upauIULcYQXDGS5C;

1.42
date	2020.04.18.07.53.38;	author adam;	state Exp;
branches;
next	1.41;
commitid	h5G4cU6vfspF8Q4C;

1.41
date	2020.03.26.14.47.46;	author nia;	state Exp;
branches;
next	1.40;
commitid	xtkzSlNm1t5PaV1C;

1.40
date	2020.03.24.05.58.48;	author rillig;	state Exp;
branches;
next	1.39;
commitid	DvC53PKBWi1TiC1C;

1.39
date	2020.01.26.17.31.27;	author rillig;	state Exp;
branches;
next	1.38;
commitid	4fBBvoSLJaGd0eUB;

1.38
date	2019.12.29.15.31.22;	author adam;	state Exp;
branches;
next	1.37;
commitid	kHfM83YmbIyZeCQB;

1.37
date	2019.11.03.19.03.56;	author rillig;	state Exp;
branches;
next	1.36;
commitid	puQpdVbj8afCdrJB;

1.36
date	2019.10.24.11.40.00;	author tnn;	state Exp;
branches;
next	1.35;
commitid	j0nYnFkq63Qc57IB;

1.35
date	2019.10.19.13.54.29;	author adam;	state Exp;
branches;
next	1.34;
commitid	hNpp818q3gV0ZtHB;

1.34
date	2019.08.26.14.56.21;	author adam;	state Exp;
branches;
next	1.33;
commitid	PNSvAEXmDzNf4yAB;

1.33
date	2019.08.05.19.06.49;	author adam;	state Exp;
branches;
next	1.32;
commitid	Te8YYre57VhQ7SxB;

1.32
date	2019.06.02.08.39.28;	author adam;	state Exp;
branches;
next	1.31;
commitid	TiVS2COsk5CSHApB;

1.31
date	2019.03.27.06.24.22;	author adam;	state Exp;
branches;
next	1.30;
commitid	H2HEMKXYprYs7YgB;

1.30
date	2018.12.23.00.11.39;	author adam;	state Exp;
branches;
next	1.29;
commitid	LZlXz18vTvns4R4B;

1.29
date	2018.12.09.20.04.38;	author adam;	state Exp;
branches;
next	1.28;
commitid	8fsHP9rfypST7a3B;

1.28
date	2018.08.09.14.56.41;	author jperkin;	state Exp;
branches;
next	1.27;
commitid	fGib1ZyKvo0YksNA;

1.27
date	2018.08.07.10.44.50;	author adam;	state Exp;
branches;
next	1.26;
commitid	NGqrXyHN8pMy0bNA;

1.26
date	2018.05.22.12.39.23;	author adam;	state Exp;
branches;
next	1.25;
commitid	aFOAU1zu3AEU7iDA;

1.25
date	2017.12.30.10.39.24;	author adam;	state Exp;
branches;
next	1.24;
commitid	Kg5jdxtHCuqI3UkA;

1.24
date	2017.12.01.19.22.12;	author adam;	state Exp;
branches;
next	1.23;
commitid	RNNRTudpzr1HSdhA;

1.23
date	2017.07.11.19.47.37;	author adam;	state Exp;
branches;
next	1.22;
commitid	jomTEuZ9pugBCQYz;

1.22
date	2017.06.01.13.30.25;	author jlam;	state Exp;
branches;
next	1.21;
commitid	kJ7LgYlPHhSYOFTz;

1.21
date	2017.05.05.22.47.00;	author kamil;	state Exp;
branches;
next	1.20;
commitid	8zsAK2SdDeSvLfQz;

1.20
date	2017.05.03.08.38.43;	author jperkin;	state Exp;
branches;
next	1.19;
commitid	oXB1pxkPDlAs8VPz;

1.19
date	2017.03.17.22.38.17;	author adam;	state Exp;
branches;
next	1.18;
commitid	RtC8EMbuGmoliXJz;

1.18
date	2017.01.16.17.26.47;	author brook;	state Exp;
branches;
next	1.17;
commitid	VRycrXoUWSdqtdCz;

1.17
date	2017.01.05.11.54.32;	author adam;	state Exp;
branches;
next	1.16;
commitid	g3BpmooUhq1Z0MAz;

1.16
date	2016.12.17.23.28.34;	author joerg;	state Exp;
branches;
next	1.15;
commitid	omRiVAl760BQsoyz;

1.15
date	2016.11.14.20.15.33;	author ryoon;	state Exp;
branches;
next	1.14;
commitid	QLKL3BrgVJGvs8uz;

1.14
date	2016.07.26.12.43.51;	author wiz;	state Exp;
branches;
next	1.13;
commitid	pgFk5j1XgeLCwPfz;

1.13
date	2016.03.10.15.01.52;	author tnn;	state Exp;
branches;
next	1.12;
commitid	qrZrTwuOnTLSH6Yy;

1.12
date	2016.03.08.21.11.44;	author tnn;	state Exp;
branches;
next	1.11;
commitid	E8KCaXl7PRh0QSXy;

1.11
date	2016.01.11.19.16.08;	author ryoon;	state Exp;
branches;
next	1.10;
commitid	dVWleVkiAVXW1yQy;

1.10
date	2015.11.06.13.51.18;	author wiz;	state Exp;
branches;
next	1.9;
commitid	9aDjm2qDuAH2m2Iy;

1.9
date	2015.09.26.08.42.19;	author tnn;	state Exp;
branches;
next	1.8;
commitid	W3dXY3uXSl6EXJCy;

1.8
date	2015.09.25.15.59.19;	author tnn;	state Exp;
branches;
next	1.7;
commitid	qVK1ZuXfEzhBpECy;

1.7
date	2015.07.20.05.49.53;	author adam;	state Exp;
branches;
next	1.6;
commitid	CeIKdzSzsRk6cZty;

1.6
date	2015.05.28.13.25.59;	author adam;	state Exp;
branches;
next	1.5;
commitid	hqvrIlYdbSUApdny;

1.5
date	2015.04.07.22.05.36;	author tnn;	state Exp;
branches;
next	1.4;
commitid	Y2Rf1qUKcK8YVHgy;

1.4
date	2015.03.22.16.07.59;	author tnn;	state Exp;
branches;
next	1.3;
commitid	jaXpqoCv9vFhtCey;

1.3
date	2015.03.13.18.00.33;	author tnn;	state Exp;
branches;
next	1.2;
commitid	NUwL03On4mKQntdy;

1.2
date	2015.03.04.13.57.42;	author tnn;	state Exp;
branches;
next	1.1;
commitid	gx0PwtnepCS9kicy;

1.1
date	2015.03.04.09.59.57;	author tnn;	state Exp;
branches;
next	;
commitid	c20iwGz8ujVl0hcy;


desc
@@


1.66
log
@llvm and friends: update to to 20.1.8

Based on the wip packages and help from adam@@
@
text
@# $NetBSD: Makefile.common,v 1.65 2025/05/09 05:51:24 adam Exp $
# used by lang/clang/Makefile
# used by lang/clang-tools-extra/Makefile

.include "../../lang/llvm/version.mk"

CATEGORIES=	lang devel

MAINTAINER=	pkgsrc-users@@NetBSD.org
HOMEPAGE=	https://clang.llvm.org/
LICENSE=	apache-2.0

USE_CXX_FEATURES=	c++17
USE_LANGUAGES=		c c++
GCC_REQD+=		7

CMAKE_CONFIGURE_ARGS+=	-DLLVM_CONFIG=${LLVM_CONFIG_PATH:Q}
CMAKE_CONFIGURE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
CMAKE_CONFIGURE_ARGS+=	-DCMAKE_C_COMPILER=${CC:Q}
CMAKE_CONFIGURE_ARGS+=	-DCMAKE_CXX_COMPILER=${CXX:Q}

.include "../../mk/compiler.mk"

CMAKE_CONFIGURE_ARGS.Darwin+=	-DCMAKE_LIBTOOL=/usr/bin/libtool
.if defined(OSX_SDK_PATH)
CMAKE_CONFIGURE_ARGS.Darwin+=	-DDEFAULT_SYSROOT=${OSX_SDK_PATH:Q}
.endif

# NetBSD < 10 did not provide ENOTRECOVERABLE
# https://bugs.llvm.org/show_bug.cgi?id=52587
.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099949
CXXFLAGS+=	-D_GLIBCXX_HAVE_ENOTRECOVERABLE=1
CXXFLAGS+=	-DENOTRECOVERABLE=98
.endif

REPLACE_PERL+=		test/make_test_dirs.pl
REPLACE_PERL+=		tools/scan-build/bin/scan-build
REPLACE_PERL+=		tools/scan-build/libexec/c++-analyzer
REPLACE_PERL+=		tools/scan-build/libexec/ccc-analyzer
REPLACE_PERL+=		utils/TestUtils/pch-test.pl
REPLACE_PERL+=		utils/analyzer/reducer.pl
REPLACE_PERL+=		utils/analyzer/update_plist_test.pl
REPLACE_PERL+=		www/demo/index.cgi

REPLACE_PYTHON+=	bindings/python/examples/cindex/cindex-dump.py
REPLACE_PYTHON+=	bindings/python/examples/cindex/cindex-includes.py
REPLACE_PYTHON+=	docs/tools/dump_ast_matchers.py
REPLACE_PYTHON+=	docs/tools/dump_format_style.py
REPLACE_PYTHON+=	docs/tools/generate_formatted_state.py
REPLACE_PYTHON+=	lib/Tooling/DumpTool/generate_cxx_src_locs.py
REPLACE_PYTHON+=	test/AST/gen_ast_dump_json_test.py
REPLACE_PYTHON+=	test/Analysis/check-analyzer-fixit.py
REPLACE_PYTHON+=	test/Driver/check-time-trace-sections.py
REPLACE_PYTHON+=	tools/clang-format/clang-format-diff.py
REPLACE_PYTHON+=	tools/clang-format/git-clang-format
REPLACE_PYTHON+=	tools/scan-build-py/bin/analyze-build
REPLACE_PYTHON+=	tools/scan-build-py/bin/intercept-build
REPLACE_PYTHON+=	tools/scan-build-py/bin/scan-build
REPLACE_PYTHON+=	tools/scan-build-py/libexec/analyze-c++
REPLACE_PYTHON+=	tools/scan-build-py/libexec/analyze-cc
REPLACE_PYTHON+=	tools/scan-build-py/libexec/intercept-c++
REPLACE_PYTHON+=	tools/scan-build-py/libexec/intercept-cc
REPLACE_PYTHON+=	tools/scan-build/bin/set-xcode-analyzer
REPLACE_PYTHON+=	tools/scan-view/bin/scan-view
REPLACE_PYTHON+=	tools/scan-view/share/Reporter.py
REPLACE_PYTHON+=	tools/scan-view/share/startfile.py
REPLACE_PYTHON+=	utils/ABITest/ABITestGen.py
REPLACE_PYTHON+=	utils/CIndex/completion_logger_server.py
REPLACE_PYTHON+=	utils/CaptureCmd
REPLACE_PYTHON+=	utils/CmpDriver
REPLACE_PYTHON+=	utils/FindSpecRefs
REPLACE_PYTHON+=	utils/FuzzTest
REPLACE_PYTHON+=	utils/TestUtils/deep-stack.py
REPLACE_PYTHON+=	utils/analyzer/CmpRuns.py
REPLACE_PYTHON+=	utils/analyzer/SATest.py
REPLACE_PYTHON+=	utils/analyzer/SATestAdd.py
REPLACE_PYTHON+=	utils/analyzer/SATestBuild.py
REPLACE_PYTHON+=	utils/analyzer/SATestUpdateDiffs.py
REPLACE_PYTHON+=	utils/analyzer/SumTimerInfo.py
REPLACE_PYTHON+=	utils/analyzer/exploded-graph-rewriter.py
REPLACE_PYTHON+=	utils/check_cfc/check_cfc.py
REPLACE_PYTHON+=	utils/check_cfc/obj_diff.py
REPLACE_PYTHON+=	utils/check_cfc/test_check_cfc.py
REPLACE_PYTHON+=	utils/clangdiag.py
REPLACE_PYTHON+=	utils/convert_arm_neon.py
REPLACE_PYTHON+=	utils/creduce-clang-crash.py
REPLACE_PYTHON+=	utils/hmaptool/hmaptool
REPLACE_PYTHON+=	utils/modfuzz.py
REPLACE_PYTHON+=	utils/module-deps-to-rsp.py
REPLACE_PYTHON+=	utils/token-delta.py
REPLACE_PYTHON+=	www/builtins.py
REPLACE_PYTHON+=	www/make_cxx_dr_status

.if ${OPSYS} == "NetBSD" && ${PKGSRC_COMPILER:Mclang}
# command to check if clang is using libc++ or libstdc++
LIBCPP_CHECK!=	\
	printf '%s\n' \
		'\#include <ciso646>' \
		'\#ifdef _LIBCPP_VERSION' \
		'YES' \
		'\#endif' \
	| ${CLANGBASE}/bin/clang++ -x c++ -E - 2>&1 \
	| grep YES || true
.else
LIBCPP_CHECK=	NO
.endif

.if ${OPSYS} == "NetBSD" && ${LIBCPP_CHECK} != YES
CMAKE_CONFIGURE_ARGS+=			-DCLANG_DEFAULT_CXX_STDLIB:STRING="libstdc++"
.endif

# On SunOS use the libraries from the GCC used to build clang rather than
# aimlessly searching the file system for ones that might be incompatible.
#
SUBST_CLASSES.SunOS+=	sunos-gcc
SUBST_STAGE.sunos-gcc=	pre-configure
SUBST_FILES.sunos-gcc=	lib/Driver/ToolChains/Gnu.cpp
SUBST_SED.sunos-gcc=	-e 's,@@GCCBASEDIR@@,${CCPATH:H:H},'

# Not perfect, but should catch most common cases.  We can't simply use
# gcc-libs as that doesn't ship the headers.
#
.if ${OPSYS} == "SunOS" && ${PKGSRC_COMPILER:Mgcc}
BUILDLINK_DEPMETHOD.${_GCC_PKGBASE}=	full
.endif

PLIST_VARS+=	notdylib
.if ${SHLIB_TYPE} != "dylib"
PLIST.notdylib=	yes
.endif

PKG_OPTIONS_VAR=	PKG_OPTIONS.clang
PKG_SUPPORTED_OPTIONS=	tests z3

.include "../../mk/bsd.options.mk"

.if !empty(PKG_OPTIONS:Mtests)
CMAKE_CONFIGURE_ARGS+=		-DLLVM_INCLUDE_TESTS=ON
CMAKE_CONFIGURE_ARGS+=		-DCLANG_INCLUDE_TESTS=ON
TEST_TARGET=		clang-test
TEST_ENV+=		LD_LIBRARY_PATH=${WRKDIR}/build/lib
.  include "../../devel/googletest/buildlink3.mk"
.else
CMAKE_CONFIGURE_ARGS+=		-DLLVM_INCLUDE_TESTS=OFF
CMAKE_CONFIGURE_ARGS+=		-DCLANG_INCLUDE_TESTS=OFF
.endif

.include "../../lang/llvm/buildlink3.mk"

.if !empty(PKG_OPTIONS:Mz3)
.  if empty(PKG_BUILD_OPTIONS.llvm:Mz3)
PKG_FAIL_REASON+=	"z3 PKG_OPTION must be enabled in lang/llvm"
.  endif
.  include "../../math/z3/buildlink3.mk"
CMAKE_CONFIGURE_ARGS+=		-DLLVM_ENABLE_Z3_SOLVER=ON
.endif

.include "../../devel/cmake/build.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../lang/python/application.mk"
.include "../../lang/python/tool.mk"
DEPENDS+=	llvm-${PKGVERSION_NOREV}{,nb*}:../../lang/llvm
.include "../../textproc/libxml2/buildlink3.mk"
@


1.65
log
@llvm: updated to 19.1.7

19.1.7
https://releases.llvm.org/19.1.0/docs/ReleaseNotes.html
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.64 2025/05/06 12:07:32 wiz Exp $
a6 1
DISTNAME=	clang-${LLVM_VERSION}.src
a10 1
COMMENT=	C language family frontend for LLVM
d13 1
a13 1
USE_CXX_FEATURES=	c++14
@


1.64
log
@*: SOEXT -> SHLIB_EXT
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.63 2024/08/25 06:18:55 wiz Exp $
a14 3
CONFIGURE_DIRS=		build
CMAKE_ARG_PATH=		${WRKSRC}

a16 1
USE_CMAKE=		yes
d38 1
d45 1
d55 1
a128 7
# 3.8.0 -> 3.8
LLVM_MAJOR=	${PKGVERSION_NOREV:C/^([0-9]+\.[0-9]+)\..*$/\1/}
PLIST_SUBST+=	LLVM_MAJOR=${LLVM_MAJOR}

PKGVERSION_MAJOR=	18
PLIST_SUBST+=		PKGVERSION_MAJOR=${PKGVERSION_MAJOR}

d160 1
a160 4
post-extract:
	${MKDIR} ${WRKSRC}/build

.include "../../textproc/libxml2/buildlink3.mk"
d165 1
@


1.63
log
@*: replace CMAKE_ARGS with CMAKE_CONFIGURE_ARGS
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.62 2024/07/07 14:00:38 wiz Exp $
d138 1
a138 4
.if ${SHLIB_TYPE} == "dylib"
SOEXT=		dylib
.else
SOEXT=		so
a140 1
PLIST_SUBST+=	SOEXT=${SOEXT}
@


1.62
log
@clang: remove references to non-existent files
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.61 2024/07/07 14:00:21 wiz Exp $
d23 4
a26 4
CMAKE_ARGS+=	-DLLVM_CONFIG=${LLVM_CONFIG_PATH:Q}
CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Release
CMAKE_ARGS+=	-DCMAKE_C_COMPILER=${CC:Q}
CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER=${CXX:Q}
d30 1
a30 1
CMAKE_ARGS.Darwin+=	-DCMAKE_LIBTOOL=/usr/bin/libtool
d32 1
a32 1
CMAKE_ARGS.Darwin+=	-DDEFAULT_SYSROOT=${OSX_SDK_PATH:Q}
d112 1
a112 1
CMAKE_ARGS+=			-DCLANG_DEFAULT_CXX_STDLIB:STRING="libstdc++"
d152 2
a153 2
CMAKE_ARGS+=		-DLLVM_INCLUDE_TESTS=ON
CMAKE_ARGS+=		-DCLANG_INCLUDE_TESTS=ON
d158 2
a159 2
CMAKE_ARGS+=		-DLLVM_INCLUDE_TESTS=OFF
CMAKE_ARGS+=		-DCLANG_INCLUDE_TESTS=OFF
d169 1
a169 1
CMAKE_ARGS+=		-DLLVM_ENABLE_Z3_SOLVER=ON
@


1.61
log
@clang: try merging Solaris patches
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.60 2024/07/07 07:36:08 jperkin Exp $
a41 1
REPLACE_PERL+=		test/make_test_dirs.pl
a47 1
REPLACE_PERL+=		www/demo/index.cgi
a56 1
REPLACE_PYTHON+=	test/Driver/check-time-trace-sections.py
@


1.60
log
@clang: Remove SunOS patches.

These are from an older version of clang and do not work.  The working
patches that replaced these that were removed in the previous update
will be maintained elsewhere.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.59 2024/07/06 15:45:07 adam Exp $
d118 15
@


1.59
log
@llvm: updated to 18.1.8

https://releases.llvm.org
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.54 2023/01/25 16:45:40 wiz Exp $
a117 10
# Enable full LLVM suite on SunOS
.if ${OPSYS} == "SunOS"
.include "../../lang/compiler-rt/buildlink3.mk"
.include "../../lang/libcxx/buildlink3.mk"
.include "../../lang/libcxxabi/buildlink3.mk"
.include "../../lang/libunwind/buildlink3.mk"
CMAKE_ARGS+=    -DCLANG_DEFAULT_RTLIB:STRING="compiler-rt"
CMAKE_ARGS+=    -DCLANG_DEFAULT_CXX_STDLIB:STRING="libc++"
.endif

@


1.58
log
@clang: Add full dependency on GCC on SunOS.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.57 2024/05/09 14:15:51 jperkin Exp $
d118 8
a125 13
# On SunOS use the libraries from the GCC used to build clang rather than
# aimlessly searching the file system for ones that might be incompatible.
#
SUBST_CLASSES.SunOS+=	sunos-gcc
SUBST_STAGE.sunos-gcc=	pre-configure
SUBST_FILES.sunos-gcc=	lib/Driver/ToolChains/Gnu.cpp
SUBST_SED.sunos-gcc=	-e 's,@@GCCBASEDIR@@,${CCPATH:H:H},'

# Not perfect, but should catch most common cases.  We can't simply use
# gcc-libs as that doesn't ship the headers.
#
.if ${OPSYS} == "SunOS" && ${PKGSRC_COMPILER:Mgcc}
BUILDLINK_DEPMETHOD.${_GCC_PKGBASE}=	full
d132 1
a132 1
PKGVERSION_MAJOR=	17
@


1.57
log
@clang: Switch SunOS back to using the GCC runtime.

Upstream LLVM have removed the SunOS code from libcxx et al, despite us
offering to support it and it working fine, and so we're left with no
choice but to go back to using the GCC libraries and headers, which is a
shame.

Tested to compile at least a few different C/C++ files, and is able to
complete the builds of lang/wasi-*.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.56 2024/04/22 07:03:35 adam Exp $
d126 7
@


1.56
log
@clang: updated to 17.0.6

17.0.6
https://releases.llvm.org/17.0.1/tools/clang/docs/ReleaseNotes.html
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.55 2023/10/06 19:15:20 adam Exp $
d118 7
a124 9
# Enable full LLVM suite on SunOS
.if ${OPSYS} == "SunOS"
.include "../../lang/compiler-rt/buildlink3.mk"
.include "../../lang/libcxx/buildlink3.mk"
.include "../../lang/libcxxabi/buildlink3.mk"
.include "../../lang/libunwind/buildlink3.mk"
CMAKE_ARGS+=    -DCLANG_DEFAULT_RTLIB:STRING="compiler-rt"
CMAKE_ARGS+=    -DCLANG_DEFAULT_CXX_STDLIB:STRING="libc++"
.endif
@


1.55
log
@llvm: updated to 16.0.6

https://releases.llvm.org/16.0.0/docs/ReleaseNotes.html
https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html
https://releases.llvm.org/16.0.0/tools/clang/tools/extra/docs/ReleaseNotes.html
https://releases.llvm.org/16.0.0/tools/lld/docs/ReleaseNotes.html
https://releases.llvm.org/16.0.0/projects/libcxx/docs/ReleaseNotes.html
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.54 2023/01/25 16:45:40 wiz Exp $
d18 1
a18 1
USE_CXX_FEATURES+=	c++14
d132 1
a132 1
PKGVERSION_MAJOR=	16
@


1.54
log
@clang: revert previous

causes weird breakage in clang-tools-extra
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.53 2023/01/24 18:36:28 wiz Exp $
d18 2
a19 1
USE_LANGUAGES=		c c++14
d132 3
@


1.53
log
@*: convert to cmake/build.mk
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.52 2022/08/14 12:13:03 tnn Exp $
d15 3
d19 1
a116 1
.include "../../devel/cmake/build.mk"
d166 3
@


1.52
log
@llvm ecosystem: bump up some GCC_REQD

GCC 7 is the lowest common denominator for the parts needed to get Firefox
build going again on NetBSD 8.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.51 2022/08/13 09:58:03 tnn Exp $
a14 3
CONFIGURE_DIRS=		build
CMAKE_ARG_PATH=		${WRKSRC}

a15 1
USE_CMAKE=		yes
d113 1
a162 3
post-extract:
	${MKDIR} ${WRKSRC}/build

@


1.51
log
@clang: de-lint, repair broken patch distinfo, restore SunOS patch. Untested
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.50 2022/08/12 08:45:44 pin Exp $
d20 1
a20 1
GCC_REQD+=		5
@


1.50
log
@lang/clang: llvm update
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.49 2022/06/11 13:45:44 fcambus Exp $
d15 1
a15 1
CONFIGURE_DIRS=		${WRKDIR}/build
d150 1
a150 1
.include "../../devel/googletest/buildlink3.mk"
d159 1
a159 1
.if empty(PKG_BUILD_OPTIONS.llvm:Mz3)
d161 2
a162 2
.endif
.include "../../math/z3/buildlink3.mk"
d167 1
a167 1
	${MKDIR} ${WRKDIR}/build
@


1.49
log
@clang: add a z3 option to allow building against the Z3 constraint solver.

When both lang/llvm and lang/clang are built with the z3 option enabled,
the Z3 constraint solver is activated for the Clang static analyzer.

This option is not enabled by default.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.48 2022/05/05 08:24:41 nia Exp $
a112 1
# patch NetBSD::GetCXXStdlibType
a113 6
SUBST_CLASSES+=			libcxx
SUBST_STAGE.libcxx=		pre-configure
SUBST_MESSAGE.libcxx=		Patching toolchain to use libstdc++ (matching the host compiler)
SUBST_FILES.libcxx=		lib/Driver/ToolChains/NetBSD.cpp
SUBST_SED.libcxx=		-e 's,(Major >= 7 || Major == 0),(false),'

@


1.48
log
@clang: Use OPSYS_VERSION to numerically compare NetBSD versions
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.47 2021/11/23 20:55:43 wiz Exp $
d148 1
a148 1
PKG_SUPPORTED_OPTIONS=	tests
d163 10
a180 1
.include "../../lang/llvm/buildlink3.mk"
@


1.47
log
@llvm: update llvm and friends to 13.0.0

Tested on NetBSD-current and 9.1/amd64.

Also update packages tightly coupled to llvm, if new versions are
available.

Mark creduce, include-what-you-use, and zig broken (waiting for a
new release).

Changes:

Non-comprehensive list of changes in this release

    Windows Control-flow Enforcement Technology: the -ehcontguard
    option now emits valid unwind entrypoints which are validated
    when the context is being set during exception handling.

    Flang is now included in the binary packages released by LLVM.

    The debuginfo-test project has been renamed cross-project-tests
    and is now intended for testing components from multiple
    projects, not just debug information. The new “cross-project-tests”
    name replaces “debuginfo-test” in LLVM_ENABLE_PROJECTS, and a
    new check-cross-project-tests target has been added for running
    all tests in the project. The pre-existing check-debuginfo-
    test target remains for running just the debug information
    tests. (D95339 and D96513)

Changes to the LLVM IR

    The inalloca attribute now has a mandatory type field, similar
    to byval and sret.

    The opaque pointer type ptr has been introduced. It is still
    in the process of being worked on and should not be used yet.

    Using the legacy pass manager for the optimization pipeline is
    deprecated and will be removed after LLVM 14. In the meantime,
    only minimal effort will be made to maintain the legacy pass
    manager for the optimization pipeline.

Changes to building LLVM

    The build system now supports building multiple distributions,
    so that you can e.g. have one distribution containing just
    tools and another for libraries (to enable development). See
    Multi-distribution configurations for details.

Changes to the AArch64 Backend

    Introduced assembly support for Armv9-A’s Realm Management
    Extension (RME) and Scalable Matrix Extension (SME).

    Produce proper cross-section relative relocations on COFF

    Fixed the calling convention on Windows for variadic functions
    involving floats in the fixed arguments

Changes to the ARM Backend

    Produce proper cross-section relative relocations on COFF

Changes to the Hexagon Target

    The Hexagon target now supports V68/HVX ISA.

Changes to the C API

    The C API functions LLVMGetAlignment and LLVMSetAlignment now
    allow changing alignment on atomicrmw and cmpxchg instructions

    A new entry LLVMDIArgListMetadataKind was added to the
    LLVMMetadataKind enum, representing DIArgLists (D88175)

    Type attributes have been added to LLVM-C, introducing
    LLVMCreateTypeAttribute, LLVMGetTypeAttributeValue and
    LLVMIsTypeAttribute. (D977763’)

    The LTO_API_VERSION was bumped to 28, introducing a new function
    lto_set_debug_options for parsing LTO debug options (D92611)

    LLVMJITTargetSymbolFlags was renamed to LLVMJITSymbolTargetFlags
    (rG8d718a0bff73af066675a6258c01307937c33cf9)

    The C API received support for creating custom ORCv2
    MaterializationUnits and APIs to retrieve an LLJIT instance’s
    linking layers. An ABI breaking change for LLVMOrcAbsoluteSymbols
    was introduced to make it consistent with
    LLVMOrcCreateCustomMaterializationUnit.
    (rGc8fc5e3ba942057d6c4cdcd1faeae69a28e7b671)

    The C API received support for adding ORCv2 object buffers
    directly to an object layer.
    (rG7b73cd684a8d5fb44d34064200f10e2723085c33)

    A breaking change to LLVMGetInlineAsm was introduced, adding
    a ninth argument LLVMBool CanThrow (D95745)

    The C API received support for calling into the new pass manager.
    (D102136)

    The C API function LLVMIntrinsicCopyOverloadedName has been
    deprecated. Please migrate to LLVMIntrinsicCopyOverloadedName2
    which takes an extra module argument and which also handles
    unnamed types. (D99173)

    The C API received support for dumping objects from ORCv2
    (rGcec8e69f01c3374cb38c6683058381b96fab8f89)

    A breaking change to LLVMOrcObjectTransformLayerTransformFunction
    was introduced, changing the order of the function pointer’s
    arguments. (rG8962c68ad007a525f9daa987c99eda57e0d0069a)

    The C API received support for accessing utilities from the
    LLJIT IRTransformLayer and ThreadSafeModule classes. (D103855)

    The C API received support for creating lazy-export
    MaterializationUnits (D104672)

    The C API function LLVMPassBuilderOptionsSetCoroutines was
    removed because couroutine passes have been enabled by default.
    (D105877)

    comdat noduplicates was renamed to comdat nodeduplicate and as
    a result, LLVMNoDuplicatesComdatSelectionKind was renamed to
    LLVMNoDeduplicateComdatSelectionKind. (D106319)

Changes to the FastISel infrastructure

    FastISel no longer tracks killed registers, and instead leaves
    this to the register allocator. This means that hasTrivialKill()
    is removed, as well as the OpNIsKill parameters to the fastEmit_*()
    family of functions.

Changes to the LLVM tools

    The options --build-id-link-{dir,input,output} have been deleted.
    (D96310)

    Support for in-order processors has been added to llvm-mca.
    (D94928)

    llvm-objdump supports -M {att,intel} now. --x86-asm-syntax is
    a deprecated internal option which will be removed in LLVM
    14.0.0. (D101695)

    The llvm-readobj short aliases -s (previously --sections) and
    -t (previously --syms) have been changed to --syms and
    --section-details respectively, to match llvm-readelf. (D105055)

    The llvm-nm short aliases -M (--print-armap), -U (--defined-only),
    and -W (--no-weak) are now deprecated. Use the long form versions
    instead. The alias --just-symbol-name is now deprecated in
    favor of --format=just-symbols and -j. (D105330)

    In lli the default JIT engine switched from MCJIT (-jit-kind=mcjit)
    to ORC (-jit-kind=orc). (D98931)

    llvm-rc got support for invoking Clang to preprocess its input.
    (D100755)

    llvm-rc got a GNU windres compatible frontend, llvm-windres.
    (D100756)

    llvm-ml has improved compatibility with MS ml.exe, managing to
    assemble more asm files.

Changes to LLDB

    LLDB executable is now included in pre-built LLVM binaries.

    LLDB now includes full featured support for AArch64 SVE register
    access.

    LLDB now supports AArch64 Pointer Authentication, allowing
    stack unwind with signed return address.

    LLDB now supports debugging programs on AArch64 Linux that use
    memory tagging (MTE).

    Added memory tag read and memory tag write commands.

    The memory region command will note when a region has memory
    tagging enabled.

    Synchronous and asynchronous tag faults are recognised.

    Synchronous tag faults have memory tag annotations in addition
    to the usual fault address.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.46 2020/07/02 10:45:38 wiz Exp $
d36 1
a36 1
.if ${OPSYS} == "NetBSD" && !empty(OS_VERSION:M[123456789].*)
@


1.46
log
@clang: update to 10.0.0nb4.

Make perl a run-time dependency to fix

ERROR: [check-interpreter.mk] The interpreter "/usr/pkg/bin/perl" of "/usr/pkg/bin/scan-build" does not exist.
ERROR: [check-interpreter.mk] The interpreter "/usr/pkg/bin/perl" of "/usr/pkg/libexec/c++-analyzer" does not exist.
ERROR: [check-interpreter.mk] The interpreter "/usr/pkg/bin/perl" of "/usr/pkg/libexec/ccc-analyzer" does not exist.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.45 2020/07/01 14:46:37 adam Exp $
d34 7
d54 5
d61 7
d70 2
d80 1
d83 1
d85 1
d89 3
d93 2
d97 1
@


1.45
log
@clang: build with static analizer (default and needed for clang-tools-extra); remove clang-static-analyzer
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.44 2020/05/07 20:21:41 rillig Exp $
d71 1
a71 1
LIBCPP_CHECK!= \
@


1.44
log
@lang/clang: fix detection of libstdc++

In the previous commit, I had missed a negation in the empty(...)
condition.

PKGREVISION++ to notify clang users of the fix.

https://mail-index.netbsd.org/pkgsrc-users/2020/05/07/msg031132.html
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.43 2020/04/26 10:19:26 rillig Exp $
a2 1
# used by lang/clang-static-analyzer/Makefile
a25 2
# XXX can't disable static-analyzer without also disabling ARCMT
CMAKE_ARGS+=	-DCLANG_ENABLE_ARCMT=OFF
@


1.43
log
@lang/clang: avoid unnecessary shell command

The "echo NO" is not necessary since the output of the shell command is
immediately inspected. Therefore there is no need to use the :sh
modifier.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.42 2020/04/18 07:53:38 adam Exp $
d87 1
a87 1
.if ${OPSYS} == "NetBSD" && ${LIBCPP_CHECK} == YES
@


1.42
log
@clang: updated to 10.0.0

What’s New in Clang 10.0.0?

Some of the major new features and improvements to Clang are listed here. Generic improvements to Clang as a whole or to its underlying infrastructure are described first, followed by language-specific sections with improvements to Clang’s support for those languages.

Major New Features

clang used to run the actual compilation in a subprocess (“clang -cc1”). Now compilations are done in-process by default. -fno-integrated-cc1 restores the former behavior. The -v and -### flags will print “(in-process)” when compilations are done in-process.
Concepts support. Clang now supports C++2a Concepts under the -std=c++2a flag.

Improvements to Clang’s diagnostics

-Wtautological-overlap-compare will warn on negative numbers and non-int types.
-Wtautological-compare for self comparisons and -Wtautological-overlap-compare will now look through member and array access to determine if two operand expressions are the same.
-Wtautological-bitwise-compare is a new warning group. This group has the current warning which diagnoses the tautological comparison of a bitwise operation and a constant. The group also has the new warning which diagnoses when a bitwise-or with a non-negative value is converted to a bool, since that bool will always be true.
-Wbitwise-conditional-parentheses will warn on operator precedence issues when mixing bitwise-and (&) and bitwise-or (|) operator with the conditional operator (?:).
-Wrange-loop-analysis got several improvements. It no longer warns about a copy being made when the result is bound to an rvalue reference. It no longer warns when an object of a small, trivially copyable type is copied. The warning now offers fix-its. Excluding -Wrange-loop-bind-reference it is now part of -Wall. To reduce the number of false positives the diagnostic is disabled in macros and template instantiations.
-Wmisleading-indentation has been added. This warning is similar to the GCC warning of the same name. It warns about statements that are indented as if they were part of a if/else/for/while statement but are not semantically part of that if/else/for/while.
-Wbitwise-op-parentheses and -Wlogical-op-parentheses are disabled by default.
The new warnings -Wc99-designator and -Wreorder-init-list warn about uses of C99 initializers in C++ mode for cases that are valid in C99 but not in C++20.
The new warning -Wsizeof-array-div catches cases like int arr[10]; ...sizeof(arr) / sizeof(short)... (should be sizeof(arr) / sizeof(int)), and the existing warning -Wsizeof-pointer-div catches more cases.
The new warning -Wxor-used-as-pow warns on cases where it looks like the xor operator ^ is used to be mean exponentiation, e.g. 2 ^ 16.
The new warning -Wfinal-dtor-non-final-class warns on classes that have a final destructor but aren’t themselves marked final.
-Wextra now enables -Wdeprecated-copy. The warning deprecates move and copy constructors in classes where an explicit destructor is declared. This is for compatibility with GCC 9, and forward looking for a change that’s being considered for C++23. You can disable it with -Wno-deprecated-copy.

Non-comprehensive list of changes in this release

In both C and C++ (C17 6.5.6p8, C++ [expr.add]), pointer arithmetic is only permitted within arrays. In particular, the behavior of a program is not defined if it adds a non-zero offset (or in C, any offset) to a null pointer, or if it forms a null pointer by subtracting an integer from a non-null pointer, and the LLVM optimizer now uses those guarantees for transformations. This may lead to unintended behavior in code that performs these operations. The Undefined Behavior Sanitizer -fsanitize=pointer-overflow check has been extended to detect these cases, so that code relying on them can be detected and fixed.
The Implicit Conversion Sanitizer (-fsanitize=implicit-conversion) has learned to sanitize pre/post increment/decrement of types with bit width smaller than int.
For X86 target, -march=skylake-avx512, -march=icelake-client, -march=icelake-server, -march=cascadelake, -march=cooperlake will default to not using 512-bit zmm registers in vectorized code unless 512-bit intrinsics are used in the source code. 512-bit operations are known to cause the CPUs to run at a lower frequency which can impact performance. This behavior can be changed by passing -mprefer-vector-width=512 on the command line.
Clang now defaults to .init_array on Linux. It used to use .ctors if the found GCC installation is older than 4.7.0. Add -fno-use-init-array to get the old behavior (.ctors).
The behavior of the flag -flax-vector-conversions has been modified to more closely match GCC, as described below. In Clang 10 onwards, command lines specifying this flag do not permit implicit vector bitcasts between integer vectors and floating-point vectors. Such conversions are still permitted by default, however, and the default can be explicitly requested with the Clang-specific flag -flax-vector-conversions=all. In a future release of Clang, we intend to change the default to -fno-lax-vector-conversions.
Improved support for octeon MIPS-family CPU. Added octeon+ to the list of of CPUs accepted by the driver.
For the WebAssembly target, the wasm-opt tool will now be run if it is found in the PATH, which can reduce code size.
For the RISC-V target, floating point registers can now be used in inline assembly constraints.

New Compiler Flags

The -fgnuc-version= flag now controls the value of __GNUC__ and related macros. This flag does not enable or disable any GCC extensions implemented in Clang. Setting the version to zero causes Clang to leave __GNUC__ and other GNU-namespaced macros, such as __GXX_WEAK__, undefined.
vzeroupper insertion on X86 targets can now be disabled with -mno-vzeroupper. You can also force vzeroupper insertion to be used on CPUs that normally wouldn’t with -mvzeroupper.
The -fno-concept-satisfaction-caching can be used to disable caching for satisfactions of Concepts. The C++2a draft standard does not currently permit this caching, but disabling it may incur significant compile-time costs. This flag is intended for experimentation purposes and may be removed at any time; please let us know if you encounter a situation where you need to specify this flag for correct program behavior.
The -ffixed-xX flags now work on RISC-V. These reserve the corresponding general-purpose registers.
RISC-V has added -mcmodel=medany and -mcmodel=medlow as aliases for -mcmodel=small and -mcmodel=medium respectively. Preprocessor definitions for __riscv_cmodel_medlow and __riscv_cmodel_medany have been corrected.
-fmacro-prefix-map=OLD=NEW substitutes directory prefix OLD for NEW in predefined preprocessor macros such as __FILE__. This helps with reproducible builds that are location independent. The new -ffile-prefix-map option is equivalent to specifying both -fdebug-prefix-map and -fmacro-prefix-map.
-fpatchable-function-entry=N[,M] is added to generate M NOPs before the function entry and N-M NOPs after the function entry. This is used by AArch64 ftrace in the Linux kernel.
-mbranches-within-32B-boundaries is added as an x86 assembler mitigation for Intel’s Jump Condition Code Erratum.

Deprecated Compiler Flags

The following options are deprecated and ignored. They will be removed in future versions of Clang.

-mmpx used to enable the __MPX__ preprocessor define for the Intel MPX instructions. There were no MPX intrinsics.
-mno-mpx used to disable -mmpx and is the default behavior.
-fconcepts-ts previously used to enable experimental concepts support. Use -std=c++2a instead to enable Concepts support.

Modified Compiler Flags

RISC-V now sets the architecture (riscv32/riscv64) based on the value provided to the -march flag, overriding the target provided by -triple.
-flax-vector-conversions has been split into three different levels of laxness, and has been updated to match the GCC semantics:
-flax-vector-conversions=all: This is Clang’s current default, and permits implicit vector conversions (performed as bitcasts) between any two vector types of the same overall bit-width. Former synonym: -flax-vector-conversions (Clang <= 9).
-flax-vector-conversions=integer: This permits implicit vector conversions (performed as bitcasts) between any two integer vector types of the same overall bit-width. Synonym: -flax-vector-conversions (Clang >= 10).
-flax-vector-conversions=none: Do not perform any implicit bitcasts between vector types. Synonym: -fno-lax-vector-conversions.
-debug-info-kind now has an option -debug-info-kind=constructor, which is one level below -debug-info-kind=limited. This option causes debug info for classes to be emitted only when a constructor is emitted.
RISC-V now chooses a slightly different sysroot path and defaults to using compiler-rt if no GCC installation is detected.
RISC-V now supports multilibs in baremetal environments. This support does not extend to supporting multilib aliases.

Attribute Changes in Clang

Support was added for function __attribute__((target("branch-protection=...")))
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.41 2020/03/26 14:47:46 nia Exp $
d72 1
a72 1
.if ${OPSYS} == "NetBSD" && !empty(PKGSRC_COMPILER:Mclang)
d74 8
a81 1
LIBCPP_CHECK_SH=	printf "\#include <ciso646>\n\#ifdef _LIBCPP_VERSION\nYES\n\#endif" | ${CLANGBASE}/bin/clang++ -x c++ -E - 2>&1 | grep YES || true
d83 1
a83 1
LIBCPP_CHECK_SH=	echo NO
d87 1
a87 1
.if ${OPSYS} == "NetBSD" && empty(LIBCPP_CHECK_SH:sh:MYES)
@


1.41
log
@clang: Bump GCC_REQD
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.40 2020/03/24 05:58:48 rillig Exp $
a8 1
PKGREVISION=	1
d19 1
a19 1
USE_LANGUAGES=		c c++11
@


1.40
log
@lang/clang: fix nonexistent SUBST_FILES

This restores the intended behavior of patching the NetBSD toolchain.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.39 2020/01/26 17:31:27 rillig Exp $
d22 1
a22 1
GCC_REQD+=		4.8
@


1.39
log
@all: migrate homepages from http to https

pkglint -r --network --only "migrate"

As a side-effect of migrating the homepages, pkglint also fixed a few
indentations in unrelated lines. These and the new homepages have been
checked manually.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.38 2019/12/29 15:31:22 adam Exp $
d9 1
a65 1
REPLACE_PYTHON+=	utils/analyzer/ubiviz
d85 1
a85 2
SUBST_FILES.libcxx=		lib/Driver/ToolChains.cpp
SUBST_FILES.libcxx+=		lib/Driver/Tools.cpp
@


1.38
log
@llvm: updated to 9.0.1

9.0.1 is a bug-fix release.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.37 2019/11/03 19:03:56 rillig Exp $
d12 1
a12 1
HOMEPAGE=	http://clang.llvm.org/
@


1.37
log
@lang: align variable assignments

pkglint -Wall -F --only aligned --only indent -r

No manual corrections.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.36 2019/10/24 11:40:00 tnn Exp $
d6 3
a8 1
DISTNAME=	cfe-9.0.0.src
a9 2
MASTER_SITES=	http://releases.llvm.org/${PKGVERSION_NOREV}/
EXTRACT_SUFX=	.tar.xz
@


1.36
log
@catch up with llvm relicensing and bump PKGREVISIONs
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.35 2019/10/19 13:54:29 adam Exp $
d8 1
a8 1
MASTER_SITES=   http://releases.llvm.org/${PKGVERSION_NOREV}/
@


1.35
log
@clang: updated to 9.0.0

9.0.0:
Major New Features
* Experimental support for C++ for OpenCL has been added.

Non-comprehensive list of changes in this release
* The __VERSION__ macro has been updated. Previously this macro contained the string ‘4.2.1 Compatible’ to achieve compatibility with GCC 4.2.1, but that should no longer be necessary. However, to retrieve Clang’s version, please favor the one of the macro defined in clang namespaced version macros.

New Compiler Flags
* -ftime-trace and ftime-trace-granularity=N Emits flame chart style compilation time report in chrome://tracing and speedscope.app compatible format. A trace .json file is written next to the compiled object file, containing hierarchical time information about frontend activities (file parsing, template instantiation) and backend activities (modules and functions being optimized, optimization passes).

Modified Compiler Flags
* clang -dumpversion now returns the version of Clang itself.

Windows Support
* clang-cl now treats non-existent files as possible typos for flags, clang-cl /diagnostic:caret /c test.cc for example now produces clang: error: no such file or directory: '/diagnostic:caret'; did you mean '/diagnostics:caret'?
* clang now parses the __declspec(allocator) specifier and generates debug information, so that memory usage can be tracked in Visual Studio.
* The -print-search-dirs option now separates elements with semicolons, as is the norm for path lists on Windows
* Improved handling of dllexport in conjunction with explicit template instantiations for MinGW, to allow building a shared libc++ for MinGW without --export-all-symbols to override the dllexport attributes
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.34 2019/08/26 14:56:21 adam Exp $
d14 1
a14 1
LICENSE=	modified-bsd
@


1.34
log
@clang: fix CMAKE_ARGS.Darwin
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.33 2019/08/05 19:06:49 adam Exp $
d6 1
a6 1
DISTNAME=	cfe-8.0.1.src
d8 1
a8 3
MASTER_SITES=   ${MASTER_SITE_GITHUB:=llvm/}
GITHUB_PROJECT= llvm-project
GITHUB_RELEASE= llvmorg-${PKGVERSION_NOREV}
@


1.33
log
@llvm: updated to 8.0.1

LLVM 8.0.1 is now available! Download it now, or read the release notes.

This release contains bug-fixes for the LLVM 8.0.0 release. This
release is API and ABI compatible with 8.0.0.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.32 2019/06/02 08:39:28 adam Exp $
d32 2
a74 2
.include "../../mk/compiler.mk"

@


1.32
log
@clang: updated to 8.0.0

Clang 8.0.0:

Major New Features

* Clang supports use of a profile remapping file, which permits profile data captured for one version of a program to be applied when building another version where symbols have changed (for example, due to renaming a class or namespace). See the UsersManual for details.

* Clang has new options to initialize automatic variables with a pattern. The default is still that automatic variables are uninitialized. This isn’t meant to change the semantics of C and C++. Rather, it’s meant to be a last resort when programmers inadvertently have some undefined behavior in their code. These options aim to make undefined behavior hurt less, which security-minded people will be very happy about.

* Improvements to Clang’s diagnostics

Non-comprehensive list of changes in this release
* The experimental feature Pretokenized Headers (PTH) was removed in its entirely from Clang. The feature did not properly work with about 1/3 of the possible tokens available and was unmaintained.
* The internals of libc++ include directory detection on MacOS have changed. Instead of running a search based on the -resource-dir flag, the search is now based on the path of the compiler in the filesystem. The default behaviour should not change. However, if you override -resource-dir manually and rely on the old behaviour you will need to add appropriate compiler flags for finding the corresponding libc++ include directory.
* The integrated assembler is used now by default for all MIPS targets.
* Improved support for MIPS N32 ABI and MIPS R6 target triples.
* Clang now includes builtin functions for bitwise rotation of common value sizes, such as: __builtin_rotateleft32
* Improved optimization for the corresponding MSVC compatibility builtins such as _rotl().
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.31 2019/03/27 06:24:22 adam Exp $
d6 1
a6 1
DISTNAME=	cfe-8.0.0.src
d8 3
a10 1
MASTER_SITES=	http://llvm.org/releases/${PKGVERSION_NOREV}/
@


1.31
log
@clang-tools-extra: added version 7.0.1

Extra tools built using Clang's tooling APIs.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.30 2018/12/23 00:11:39 adam Exp $
d6 1
a6 1
DISTNAME=	cfe-7.0.1.src
@


1.30
log
@llvm and friends: updated to 7.0.1

7.0.1:
This release contains bug-fixes for the LLVM 7.0.0 release. This
release is API and ABI compatible with 7.0.0.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.29 2018/12/09 20:04:38 adam Exp $
d4 1
a15 2
DISTINFO_FILE=		${.CURDIR}/../../lang/clang/distinfo
PATCHDIR=		${.CURDIR}/../../lang/clang/patches
a139 1
.include "../../mk/bsd.pkg.mk"
@


1.29
log
@llvm: updated to 7.0.0

LLVM 7.0.0 Release

The release contains the work on trunk up to SVN revision 338536 plus
work on the release branch. It is the result of the community's work
over the past six months, including: function multiversioning in Clang
with the 'target' attribute for ELF-based x86/x86_64 targets, improved
PCH support in clang-cl, preliminary DWARF v5 support, basic support
for OpenMP 4.5 offloading to NVPTX, OpenCL C++ support, MSan, X-Ray
and libFuzzer support for FreeBSD, early UBSan, X-Ray and libFuzzer
support for OpenBSD, UBSan checks for implicit conversions, many
long-tail compatibility issues fixed in lld which is now production
ready for ELF, COFF and MinGW, new tools llvm-exegesis, llvm-mca and
diagtool. And as usual, many optimizations, improved diagnostics, and
bug fixes.

For more details, see the release notes:
https://llvm.org/releases/7.0.0/docs/ReleaseNotes.html
https://llvm.org/releases/7.0.0/tools/clang/docs/ReleaseNotes.html
https://llvm.org/releases/7.0.0/tools/clang/tools/extra/docs/ReleaseNotes.html
https://llvm.org/releases/7.0.0/tools/lld/docs/ReleaseNotes.html
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.28 2018/08/09 14:56:41 jperkin Exp $
d5 1
a5 1
DISTNAME=	cfe-7.0.0.src
@


1.28
log
@clang: Use the full LLVM suite on SunOS.

This enables compiler-rt, libcxx, and libunwind, as well as fixing various
assumptions in the code about what should be set on SunOS.  In bulk builds
a while back this was able to compete favourably with GCC.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.27 2018/08/07 10:44:50 adam Exp $
d5 1
a5 1
DISTNAME=	cfe-6.0.1.src
d68 1
d133 1
a133 1
	${RUN} mkdir -p ${WRKDIR}/build
@


1.27
log
@llvm: updated to 6.0.1

6.0.1:

Non-comprehensive list of changes in this release

Support for retpolines was added to help mitigate “branch target injection” (variant 2) of the “Spectre” speculative side channels described by Project Zero and the Spectre paper.
The Redirects argument of llvm::sys::ExecuteAndWait and llvm::sys::ExecuteNoWait was changed to an ArrayRef of optional StringRef‘s to make it safer and more convenient to use.
The backend name was added to the Target Registry to allow run-time information to be fed back into TableGen. Out-of-tree targets will need to add the name used in the def X : Target definition to the call to RegisterTarget.
The Debugify pass was added to opt to facilitate testing of debug info preservation. This pass attaches synthetic DILocations and DIVariables to the instructions in a Module. The CheckDebugify pass determines how much of the metadata is lost.
Significantly improved quality of CodeView debug info for Windows.
Preliminary support for Sanitizers and sibling features on X86(_64) NetBSD (ASan, UBsan, TSan, MSan, SafeStack, libFuzzer).

Changes to the LLVM IR
----------------------
The fast-math-flags (FMF) have been updated. Previously, the ‘fast’ flag indicated that floating-point reassociation was allowed and all other flags were set too. The ‘fast’ flag still exists, but there is a new flag called ‘reassoc’ to indicate specifically that reassociation is allowed. A new bit called ‘afn’ was also added to selectively allow approximations for common mathlib functions like square-root. The new flags provide more flexibility to enable/disable specific floating-point optimizations. Making the optimizer respond appropriately to these flags is an ongoing effort.

Changes to the AArch64 Target
-----------------------------
Enabled the new GlobalISel instruction selection framework by default at -O0.

Changes to the ARM Target
-------------------------
Support for enabling SjLj exception handling on platforms where it isn’t the default.

Changes to the Hexagon Target
-----------------------------
The Hexagon backend now supports V65 ISA.
The -mhvx option now takes an optional value that specifies the ISA version of the HVX coprocessor. The available values are v60, v62 and v65. By default, the value is set to be the same as the CPU version.
The compiler option -mhvx-double is deprecated and will be removed in the next release of the compiler. Programmers should use the -mhvx-length option to specify the desired vector length: -mhvx-length=64b for 64-byte vectors and -mhvx-length=128b for 128-byte vectors. While the current default vector length is 64 bytes, users should always specify the length explicitly, since the default value may change in the future.
The target feature hvx-double is deprecated and will be removed in the next release. LLVM IR generators should use target features hvx-length64b and hvx-length128b to indicate the vector length. The length should always be specified when HVX code generation is enabled.

Changes to the MIPS Target
--------------------------
Fixed numerous bugs:

fpowi on MIPS64 giving incorrect results when used with a negative integer.
Usage of the asm ‘c’ constraint with the wrong datatype causing an assert/crash.
Fixed a conversion bug when using the DSP ASE.
Fixed an inconsistency where objects were not marked as using the microMIPS as when the micromips function attribute or the ”.set micromips” directive was used.
Reordered the MIPSR6 specific hazard scheduler pass to after the delay slot filler, fixing a class of rare edge case bugs where the delay slot filler would violate ISA restrictions.
Fixed a crash when using a type of unknown size with gp relative addressing.
Corrected the j macro for microMIPS.
Corrected the encoding of movep for microMIPS32r6.
Fixed an issue with the usage of insert instructions having an invalid set of operands.
Fixed an issue where TLS symbols were not marked as such.
Enabled the usage of register scavenging with MSA, due to its shorter offsets for loads and stores.
Corrected the ELF headers when using the DSP ASE.

New features:

The long branch pass now generates some R6 specific instructions when targeting MIPSR6.
The delay slot filler now performs more branch conversions if delay slots cannot be filled.
The MIPS MT ASE is now fully supported.
Added support for the lapc pseudo instruction.
Improved the selection of multiple instructions (dext, nmadd, nmsub).
Further improved microMIPS codesize reduction.

Deprecation notices:

microMIPS64R6 support was been deprecated since 5.0, and has now been completely removed.

Changes to the SystemZ Target
-----------------------------
During this release the SystemZ target has:

Added support for 128-bit atomic operations.
Added support for the “o” constraint for inline asm statements.

Changes to the X86 Target
-------------------------
During this release the X86 target has:

Added support for enabling SjLj exception handling on platforms where it isn’t the default.
Added intrinsics for Intel Extensions: VAES, GFNI, VPCLMULQDQ, AVX512VBMI2, AVX512BITALG, AVX512VNNI.
Added support for Intel Icelake CPU.
Fixed some X87 codegen bugs.
Added instruction scheduling information for Intel Sandy Bridge, Ivy Bridge, Haswell, Broadwell, and Skylake CPUs.
Improved scheduler model for AMD Jaguar CPUs.
Improved llvm-mc’s disassembler for some EVEX encoded instructions.
Add support for i8 and i16 vector signed/unsigned min/max horizontal reductions.
Improved codegen for memory comparisons
Improved codegen for i32 vector multiplies
Improved codegen for scalar integer absolute values
Improved codegen for vector integer rotations (XOP and AVX512)
Improved codegen of data being transferred between GPRs and K-registers.
Improved codegen for vector truncations.
Improved folding of address computations into gather/scatter instructions.
Gained initial support recognizing variable shuffles from vector element extracts and inserts.
Improved documentation for SSE/AVX intrinsics in intrin.h header files.
Gained support for emitting retpolines, including automatic insertion of the necessary thunks or using external thunks.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.26 2018/05/22 12:39:23 adam Exp $
d92 10
@


1.26
log
@llvm: updated to 5.0.2

5.0.2:
Bug fix release.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.25 2017/12/30 10:39:24 adam Exp $
d5 1
a5 1
DISTNAME=	cfe-5.0.2.src
@


1.25
log
@llvm: updated to 5.0.1

LLVM 5.0.1:
This release contains bug-fixes for the LLVM 5.0.0 release. This
release is API and ABI compatible with 5.0.0.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.24 2017/12/01 19:22:12 adam Exp $
d5 1
a5 1
DISTNAME=	cfe-5.0.1.src
@


1.24
log
@llvm: updated to 5.0.0

5.0.0:
Non-comprehensive list of changes in this release
* LLVM’s WeakVH has been renamed to WeakTrackingVH and a new WeakVH has been introduced. The new WeakVH nulls itself out on deletion, but does not track values across RAUW.
* A new library named BinaryFormat has been created which holds a collection of code which previously lived in Support. This includes the file_magic structure and identify_magic functions, as well as all the structure and type definitions for DWARF, ELF, COFF, WASM, and MachO file formats.
* The tool llvm-pdbdump has been renamed llvm-pdbutil to better reflect its nature as a general purpose PDB manipulation / diagnostics tool that does more than just dumping contents.
* The BBVectorize pass has been removed. It was fully replaced and no longer used back in 2014 but we didn’t get around to removing it. Now it is gone. The SLP vectorizer is the suggested non-loop vectorization pass.
* A new tool opt-viewer.py has been added to visualize optimization remarks in HTML. The tool processes the YAML files produced by clang with the -fsave-optimization-record option.
* A new CMake macro LLVM_REVERSE_ITERATION has been added. If enabled, all supported unordered LLVM containers would be iterated in reverse order. This is useful for uncovering non-determinism caused by iteration of unordered containers. Currently, it supports reverse iteration of SmallPtrSet and DenseMap.
* A new tool llvm-dlltool has been added to create short import libraries from GNU style definition files. The tool utilizes the PE COFF SPEC Import Library Format and PE COFF Auxiliary Weak Externals Format to achieve compatibility with LLD and MSVC LINK.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.23 2017/07/11 19:47:37 adam Exp $
d5 1
a5 1
DISTNAME=	cfe-5.0.0.src
d24 1
a24 1
CMAKE_ARGS+=	-DLLVM_CONFIG=${LLVM_CONFIG_PATH}
d32 3
@


1.23
log
@Changes 4.0.1:
This is a bug-fix release.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.22 2017/06/01 13:30:25 jlam Exp $
d5 1
a5 1
DISTNAME=	cfe-4.0.1.src
d123 1
@


1.22
log
@Use public SHLIB_TYPE instead of private _OPSYS_SHLIB_TYPE.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.21 2017/05/05 22:47:00 kamil Exp $
d5 1
a5 1
DISTNAME=	cfe-4.0.0.src
@


1.21
log
@Reduce diff with pkgsrc-wip/clang-git

This also fixes linking with libstdc++ in clang and should make it usable.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.20 2017/05/03 08:38:43 jperkin Exp $
d94 1
a94 1
.if ${_OPSYS_SHLIB_TYPE} == "dylib"
@


1.20
log
@Convert CXXFLAGS setting C++ standard to USE_LANGUAGES.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.19 2017/03/17 22:38:17 adam Exp $
d26 2
a27 2
CMAKE_ARGS+=	-DCMAKE_C_COMPILER=gcc
CMAKE_ARGS+=	-DCMAKE_CXX_COMPILER=g++
d84 1
a84 1
SUBST_SED.libcxx=		-e 's,(Major >= 7 || (Major == 6 && Minor == 99 && Micro >= 49) || Major == 0),(false),'
@


1.19
log
@LLVM 4.0.0:
The minimum compiler version required for building LLVM has been raised to 4.8 for GCC and 2015 for Visual Studio.
The C API functions LLVMAddFunctionAttr, LLVMGetFunctionAttr, LLVMRemoveFunctionAttr, LLVMAddAttribute, LLVMRemoveAttribute, LLVMGetAttribute, LLVMAddInstrAttribute and LLVMRemoveInstrAttribute have been removed.
The C API enum LLVMAttribute has been deleted.
The definition and uses of LLVM_ATRIBUTE_UNUSED_RESULT in the LLVM source were replaced with LLVM_NODISCARD, which matches the C++17 [[nodiscard]] semantics rather than gcc’s __attribute__((warn_unused_result)).
The Timer related APIs now expect a Name and Description. When upgrading code the previously used names should become descriptions and a short name in the style of a programming language identifier should be added.
LLVM now handles invariant.group across different basic blocks, which makes it possible to devirtualize virtual calls inside loops.
The aggressive dead code elimination phase (“adce”) now removes branches which do not effect program behavior. Loops are retained by default since they may be infinite but these can also be removed with LLVM option -adce-remove-loops when the loop body otherwise has no live operations.
The llvm-cov tool can now export coverage data as json. Its html output mode has also improved.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.18 2017/01/16 17:26:47 brook Exp $
d20 1
a20 1
USE_LANGUAGES=		c c++
a117 4
# At least LLVM 3.9.0 and subprojects don't correctly add C++11 flags
# automatically.
CXXFLAGS+=	-std=c++11

@


1.18
log
@Use the system-specific libtool on Darwin.

This fixes bugs relating to unrecognized libtool options on Darwin.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.17 2017/01/05 11:54:32 adam Exp $
d5 1
a5 1
DISTNAME=	cfe-3.9.1.src
@


1.17
log
@Changes 3.9.1:
The LLVMContext gains a new runtime check (see LLVMContext::discardValueNames()) that can be set to discard Value names (other than GlobalValue). This is intended to be used in release builds by clients that are interested in saving CPU/memory as much as possible.
There is no longer a “global context” available in LLVM, except for the C API.
The autoconf build system has been removed in favor of CMake. LLVM 3.9 requires CMake 3.4.3 or later to build. For information about using CMake please see the documentation on Building LLVM with CMake. For information about the CMake language there is also a CMake Primer document available.
C API functions LLVMParseBitcode, LLVMParseBitcodeInContext, LLVMGetBitcodeModuleInContext and LLVMGetBitcodeModule having been removed. LLVMGetTargetMachineData has been removed (use LLVMGetDataLayout instead).
The C API function LLVMLinkModules has been removed.
The C API function LLVMAddTargetData has been removed.
The C API function LLVMGetDataLayout is deprecated in favor of LLVMGetDataLayoutStr.
The C API enum LLVMAttribute and associated API is deprecated in favor of the new LLVMAttributeRef API. The deprecated functions are LLVMAddFunctionAttr, LLVMAddTargetDependentFunctionAttr, LLVMRemoveFunctionAttr, LLVMGetFunctionAttr, LLVMAddAttribute, LLVMRemoveAttribute, LLVMGetAttribute, LLVMAddInstrAttribute, LLVMRemoveInstrAttribute and LLVMSetInstrParamAlignment.
TargetFrameLowering::eliminateCallFramePseudoInstr now returns an iterator to the next instruction instead of void. Targets that previously did MBB.erase(I); return; now probably want return MBB.erase(I);.
SelectionDAGISel::Select now returns void. Out-of-tree targets will need to be updated to replace the argument node and remove any dead nodes in cases where they currently return an SDNode * from this interface.
Added the MemorySSA analysis, which hopes to replace MemoryDependenceAnalysis. It should provide higher-quality results than MemDep, and be algorithmically faster than MemDep. Currently, GVNHoist (which is off by default) makes use of MemorySSA.
The minimum density for lowering switches with jump tables has been reduced from 40% to 10% for functions which are not marked optsize (that is, compiled with -Os).
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.16 2016/12/17 23:28:34 joerg Exp $
d31 2
@


1.16
log
@Explicitly build LLVM projects with -std=c++11, it doesn't get detected
automatically in all cases.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.15 2016/11/14 20:15:33 ryoon Exp $
d5 1
a5 1
DISTNAME=	cfe-3.9.0.src
@


1.15
log
@Update llvm packages to 3.9.0

* Drop CppBackend. It is removed.

Changelog:
* GCC ABI Tag
* LLVM IR: new intrinsics etc.
* Change LLVM IPO model
* Support ThinLTO
* Improve the ARM targets, ARMv8.2-A support etc.
* Improve the MIPS targets
* Improve the PowerPC target, default optim O3 to O2
* Improve the X86 target, SKylake AVX-512 etc.
* Improve the AMDGPU, better support for Mesa 12
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.14 2016/07/26 12:43:51 wiz Exp $
d116 4
@


1.14
log
@Update llvm and clang* to 3.8.1.

This release contains bug-fixes for the LLVM 3.8.0 release. This
release is API and ABI compatible with 3.8.0.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.13 2016/03/10 15:01:52 tnn Exp $
d5 1
a5 1
DISTNAME=	cfe-3.8.1.src
@


1.13
log
@Update to clang-3.8.0. Split out llvm tools to lang/llvm.
Packaged in pkgsrc-wip by myself and Kamil.
Remove stale pkgsrc/SunOS bread crumbs that were difficult to merge
following the build framework switch. Needs to be redone. (Sorry!)

Summary of significant changes in LLVM:
- switch build framework from autoconf to CMake
- llvm-ar now supports thin archives.
- llvm doesn t produce .data.rel.ro.local or .data.rel sections anymore.
- opional support for linking clang and the LLVM tools with a single
  libLLVM shared library

  pkgsrc note: we have this library in lang/libLLVM, but we don't currently
  use it. We may do so in the future if/when the API matures.

- The optimization to move the prologue and epilogue of functions in colder
  code path (shrink-wrapping) is now enabled by default
- new target-independent gcc-compatible emulated Thread Local Storage mode
- various target specific optimizations

Summary of significant changes in Clang:

- new compiler flags for tuning what DWARF information is included
- better strict alignment handling
- better support for __builtin_object_size
@
text
@d1 1
a1 1
# $NetBSD$
d5 1
a5 1
DISTNAME=	cfe-3.8.0.src
@


1.12
log
@g/c obsolete comment
@
text
@d1 1
a1 2
# $NetBSD: Makefile.common,v 1.11 2016/01/11 19:16:08 ryoon Exp $
#
d5 2
a6 2
DISTNAME=	clang-3.7.1
CATEGORIES=	lang
d8 5
a12 8
DISTFILES=	llvm-${PKGVERSION_NOREV}.src.tar.xz \
		libcxx-${PKGVERSION_NOREV}.src.tar.xz \
		cfe-${PKGVERSION_NOREV}.src.tar.xz \
		compiler-rt-${PKGVERSION_NOREV}.src.tar.xz

MAINTAINER=	adam.hoka@@gmail.com
HOMEPAGE=	http://llvm.org/
COMMENT=	Low Level Virtual Machine compiler infrastructure
d15 4
a18 1
WRKSRC=			${WRKDIR}/llvm-${PKGVERSION_NOREV}.src
d21 2
a22 12
USE_TOOLS+=		chown gmake groff gzip pod2html pod2man
GCC_REQD+=		4.7 4.8
GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--disable-assertions
CONFIGURE_ARGS+=	--disable-bindings	# disable OCaml
CONFIGURE_ARGS+=	--disable-timestamps
CONFIGURE_ARGS+=	--enable-optimized

# In-tree builds are not allowed
OBJDIR=			../build
CONFIGURE_DIRS=		${OBJDIR}
CONFIGURE_SCRIPT=	../llvm-${PKGVERSION_NOREV}.src/configure
d24 41
a64 1
CHECK_PORTABILITY_SKIP=	utils/buildit/build_llvm
d66 17
a82 1
TEST_TARGET=		check unittests
d84 2
a85 2
DISTINFO_FILE=		${.CURDIR}/../../lang/clang/distinfo
PATCHDIR=		${.CURDIR}/../../lang/clang/patches
d87 3
a89 1
.include "../../mk/bsd.prefs.mk"
d91 1
d93 1
a93 1
PLIST_SUBST+=		SOEXT="dylib"
d95 2
a96 1
PLIST_SUBST+=		SOEXT="so"
d98 1
d100 2
a101 1
.include "../../mk/compiler.mk"
d103 1
a103 39
.if ${OPSYS} == "SunOS" && !empty(PKGSRC_COMPILER:Mgcc)
# This should probably be in hacks, but since clang hardcodes gcc paths
# put this here so it can be removed when clang matures.
# cxa_finalize.o is no longer necessary with libc.so >= ILLUMOS_0.5
TEST_ILLUMOS_3849!=\
	if /usr/bin/elfdump -v /lib/libc.so | \
		${GREP} -q 'ILLUMOS_0.5' ; then ${ECHO} 1; \
	else ${ECHO} 0; \
	fi

#doesn't seem to be needed anymore, but may be dependent on
#a recent version of solaris (illumos) ld.
#
#CFLAGS.SunOS+=		-mimpure-text

SUBST_CLASSES+=			fix-paths
SUBST_STAGE.fix-paths=		pre-configure
SUBST_MESSAGE.fix-paths=	Fixing absolute gcc paths for SunOS.
SUBST_FILES.fix-paths=		tools/clang/lib/Driver/Tools.cpp
.  if defined(_GCC_ARCHDIR)
SUBST_SED.fix-paths=		-e 's,/usr/gcc/4.5/lib/gcc/,${_GCC_ARCHDIR}/,g'
.  else
LIBGCCDIR!=	${CC} -print-libgcc-file-name
ARCHDIR:=	${LIBGCCDIR:H}
SUBST_SED.fix-paths=		-e 's,/usr/gcc/4.5/lib/gcc/,${ARCHDIR}/,g'
.  endif
SUBST_SED.fix-paths+=		-e '/^.*i386.*getVendorName.*$$/{d;}'
SUBST_SED.fix-paths+=		-e '/^.*GCCLibPath +=$$/d'
SUBST_SED.fix-paths+=		-e 's,/4.5.2/amd64/,amd64/,g'
SUBST_SED.fix-paths+=		-e 's,"as","gas",g'
.  if exists(/usr/bin/ld)
SUBST_SED.fix-paths+=		-e 's,getToolChain().GetProgramPath("ld"),"/usr/bin/ld",g'
.  else
SUBST_SED.fix-paths+=		-e 's,getToolChain().GetProgramPath("ld"),"/usr/ccs/bin/ld",g'
.  endif
.  if ${TEST_ILLUMOS_3849}
SUBST_SED.fix-paths+=		-e 's,^.*cxa_finalize.*$$,		; //cxa_finalize.o,g'
.  endif
.endif
d105 9
a113 7
# patch NetBSD::GetCXXStdlibType
.if ${OPSYS} == "NetBSD" && !empty(PKGSRC_COMPILER:Mgcc)
SUBST_CLASSES+=			libcxx
SUBST_STAGE.libcxx=		pre-configure
SUBST_MESSAGE.libcxx=		Patching toolchain to use libstdc++ as we're using GCC
SUBST_FILES.libcxx=		tools/clang/lib/Driver/ToolChains.cpp
SUBST_SED.libcxx=		-e 's,Major >= 7 || (Major == 6 && Minor == 99 && Micro >= 49) || Major == 0,false,'
d117 1
a117 7
	mv ${WRKDIR}/libcxx-${PKGVERSION_NOREV}.src ${WRKSRC}/projects/libcxx
	mv ${WRKDIR}/compiler-rt-${PKGVERSION_NOREV}.src ${WRKSRC}/projects/compiler-rt
	mv ${WRKDIR}/cfe-${PKGVERSION_NOREV}.src ${WRKSRC}/tools/clang
.if ${OPSYS} == "SunOS"
	${ECHO} "int sun_ld_needs_a_symbol=0;" >> ${WRKSRC}/lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.cpp
.endif
	mkdir ${WRKSRC}/${OBJDIR}
d119 1
d122 2
@


1.11
log
@Update to 3.7.1

Changelog:
Major changes in 3.7.1
======================

* 3.7.0 was released with an inadvertent change to the signature of the C
  API function: LLVMBuildLandingPad, which made the C API incompatible with
  prior releases.  This has been corrected in LLVM 3.7.1.

  As a result of this change, 3.7.0 is not ABI compatible with 3.7.1.

  +----------------------------------------------------------------------------+
  | History of the LLVMBuildLandingPad() function                              |
  +===========================+================================================+
  | 3.6.2 and prior releases  | LLVMBuildLandingPad(LLVMBuilderRef,            |
  |                           |                     LLVMTypeRef,               |
  |                           |                     LLVMValueRef,              |
  |                           |                     unsigned, const char*)     |
  +---------------------------+------------------------------------------------+
  | 3.7.0                     | LLVMBuildLandingPad(LLVMBuilderRef,            |
  |                           |                     LLVMTypeRef,               |
  |                           |                     unsigned, const char*)     |
  +---------------------------+------------------------------------------------+
  | 3.7.1 and future releases | LLVMBuildLandingPad(LLVMBuilderRef,            |
  |                           |                     LLVMTypeRef,               |
  |                           |                     LLVMValueRef,              |
  |                           |                     unsigned, const char*)     |
  +---------------------------+------------------------------------------------+
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.10 2015/11/06 13:51:18 wiz Exp $
a4 4
# used by lang/libLLVM/Makefile
# Keep in mind that the MesaLib package is also heavily reliant on libLLVM.
# The mesa project tends to release new stable releases whenever clang is
# updated, so it is a good idea to update that package simultaneously.
@


1.10
log
@Remove static-analyzer option, moved into a separate package.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.9 2015/09/26 08:42:19 tnn Exp $
d10 1
a10 1
DISTNAME=	clang-3.7.0
@


1.9
log
@Update to clang-3.7.0 and libLLVM-3.7.0

Compacted version of upstream's release notes:

The LLVM C API LLVMGetTargetMachineData is deprecated
DataLayout is no longer optional
Comdats are now ortogonal to the linkage
On ELF now supports multiple sections with the same name and comdat
LLVM now lazily loads metadata in some cases
Creating archives with IR files with debug info is now 25X faster
llvm-ar(1) can create archives in the BSD format used by OS X
LLVM received a backend for the extended Berkely Packet Filter instruction set
The BPF target is now available by default
Switch-case lowering was rewritten to avoid generating unbalanced search trees
The debug info IR class hierarchy now inherits from Metadata
Argument-less TargetMachine::getSubtarget has been removed from the tree
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.7 2015/07/20 05:49:53 adam Exp $
d4 1
@


1.8
log
@preempt any fallout by including a comment abount making sure MesaLib
still works when updating this.
@
text
@d6 2
a7 2
# The mesa project tends to release new stables whenever clang is updated,
# so it is a good idea to update that package simultaneously.
d9 1
a9 1
DISTNAME=	clang-3.6.2
d33 5
d111 1
@


1.7
log
@Changes 3.6.2:
Bug-fix release.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.6 2015/05/28 13:25:59 adam Exp $
d5 3
@


1.6
log
@Changes 3.6.1:
* Support for AuroraUX has been removed.
* Added support for a native object file-based bitcode wrapper format.
* Added support for MSVC’s __vectorcall calling convention as x86_vectorcallcc.
* Prefix data rework
* Metadata is not a Value
* Alias syntax change
* The old JIT has been removed
* object::Binary doesn’t own the file buffer
* IR in object files is now supported
* The gold plugin has been rewritten
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.5 2015/04/07 22:05:36 tnn Exp $
d6 1
a6 1
DISTNAME=	clang-3.6.1
@


1.5
log
@Unbreak C++ on NetBSD, by popular demand.

Background:
LLVM 3.6 upstream added support for being a native toolchain on NetBSD.
This changed the default C++ runtime library from libstdc++ to libc++.
Patch this in pkgsrc's clang so we continue to use libstdc++ (for now)
Proper support for libc++ should be added later (perhaps w/ PKG_OPTIONs).
Thanks to Joerg for explaining the problem.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.4 2015/03/22 16:07:59 tnn Exp $
d6 1
a6 1
DISTNAME=	clang-3.6.0
@


1.4
log
@need zlib
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.3 2015/03/13 18:00:33 tnn Exp $
d87 9
@


1.3
log
@needs gzip(1) tool for generation of html.tar.gz
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.2 2015/03/04 13:57:42 tnn Exp $
d95 1
@


1.2
log
@Makefile: move some stuff from Makefile.common here
PLIST: unsubstitute ${MACHINE_ARCH}
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.1 2015/03/04 09:59:57 tnn Exp $
d22 1
a22 1
USE_TOOLS+=		chown gmake groff pod2html pod2man
@


1.1
log
@convert to Makefile.common-style package so libLLVM can reference this
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.36 2015/03/03 16:27:33 tnn Exp $
a29 4
MAKE_DIRS+=		etc/llvm

INSTALLATION_DIRS=	bin lib libexec

a95 1
.include "../../textproc/libxml2/buildlink3.mk"
@

