Diff llvm-5.0.2 with a llvm-6.0.1

/usr/portage/sys-devel/llvm/llvm-6.0.1.ebuild 2019-05-15 16:09:00.000000000 +0300
9 9
PYTHON_COMPAT=( python2_7 )
10 10

  
11 11
inherit cmake-utils eapi7-ver flag-o-matic multilib-minimal \
12
	pax-utils python-any-r1 toolchain-funcs
12
	multiprocessing pax-utils python-any-r1 toolchain-funcs
13 13

  
14 14
DESCRIPTION="Low Level Virtual Machine"
15 15
HOMEPAGE="https://llvm.org/"
16 16
SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz
17
	https://dev.gentoo.org/~mgorny/dist/llvm/llvm-5.0.1-patchset.tar.bz2
18 17
	!doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/${P}-manpages.tar.bz2 )"
19 18

  
20 19
# Keep in sync with CMakeLists.txt
......
33 32
LICENSE="UoI-NCSA rc BSD public-domain
34 33
	llvm_targets_ARM? ( LLVM-Grant )"
35 34
SLOT="$(ver_cut 1)"
36
KEYWORDS="amd64 arm ~arm64 ~ppc64 x86 ~amd64-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
37
IUSE="debug doc gold libedit +libffi ncurses test
38
	kernel_Darwin kernel_linux ${ALL_LLVM_TARGETS[*]}"
35
KEYWORDS="amd64 arm arm64 ~ppc64 x86 ~amd64-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
36
IUSE="debug doc gold libedit +libffi ncurses test xar xml
37
	kernel_Darwin ${ALL_LLVM_TARGETS[*]}"
38
RESTRICT="!test? ( test )"
39 39

  
40 40
RDEPEND="
41 41
	sys-libs/zlib:0=
......
47 47
	)
48 48
	libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
49 49
	libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
50
	ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )"
50
	ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
51
	xar? ( app-arch/xar )
52
	xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )"
51 53
# configparser-3.2 breaks the build (3.3 or none at all are fine)
52 54
DEPEND="${RDEPEND}
53 55
	dev-lang/perl
......
83 85
	# https://bugs.gentoo.org/show_bug.cgi?id=565358
84 86
	eapply "${FILESDIR}"/7.1.0/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
85 87

  
86
	# Apply the backported patches
87
	eapply "${WORKDIR}/llvm-5.0.1-patchset"
88
	# Copy the new binary file (we don't support git binary patches)
89
	cp {"${WORKDIR}/llvm-5.0.1-patchset",.}/test/tools/llvm-symbolizer/Inputs/print_context.o || die
90

  
91 88
	# Fix appending -Wl,-rpath-link on non-Linux (-> FreeBSD).
92 89
	eapply "${FILESDIR}"/6.0.1/0001-cmake-Append-Wl-rpath-link-conditionally-to-GNULD.patch
93 90

  
94
	# gcc-8 build failure
95
	eapply "${FILESDIR}"/5.0.2/0001-Fix-return-type-in-ORC-readMem-client-interface.patch
96

  
97 91
	# disable use of SDK on OSX, bug #568758
98 92
	sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
99 93

  
......
123 117
		-DLLVM_ENABLE_FFI=$(usex libffi)
124 118
		-DLLVM_ENABLE_LIBEDIT=$(usex libedit)
125 119
		-DLLVM_ENABLE_TERMINFO=$(usex ncurses)
120
		-DLLVM_ENABLE_LIBXML2=$(usex xml)
126 121
		-DLLVM_ENABLE_ASSERTIONS=$(usex debug)
127 122
		-DLLVM_ENABLE_EH=ON
128 123
		-DLLVM_ENABLE_RTTI=ON
......
133 128

  
134 129
		-DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
135 130
		-DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
136
		-DHAVE_LIBXAR=0
131
		# used only for llvm-objdump tool
132
		-DHAVE_LIBXAR=$(multilib_native_usex xar 1 0)
137 133

  
138 134
		# disable OCaml bindings (now in dev-ml/llvm-ocaml)
139 135
		-DOCAMLFIND=NO
......
147 143
		)
148 144
#	fi
149 145

  
146
	use test && mycmakeargs+=(
147
		-DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
148
	)
149

  
150 150
	if multilib_is_native_abi; then
151 151
		mycmakeargs+=(
152 152
			-DLLVM_BUILD_DOCS=$(usex doc)
......
175 175
		)
176 176
	fi
177 177

  
178
	# workaround BMI bug in gcc-7 (fixed in 7.4)
179
	# https://bugs.gentoo.org/649880
180
	# apply only to x86, https://bugs.gentoo.org/650506
181
	if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
182
			[[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
183
	then
184
		local CFLAGS="${CFLAGS} -mno-bmi"
185
		local CXXFLAGS="${CXXFLAGS} -mno-bmi"
186
	fi
187

  
178 188
	# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
179 189
	use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
180 190
	cmake-utils_src_configure
......
223 233
	rm -rf "${ED%/}"/usr/include || die
224 234
	mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
225 235

  
226
	if use kernel_linux || use kernel_Darwin; then
227
		# install fuzzer libraries for clang (cmake rules were added in 6)
228
		# https://bugs.gentoo.org/636840
229
		into "/usr/lib/llvm/${SLOT}"
230
		dolib.a "$(get_libdir)"/libLLVMFuzzer*.a
231
	fi
232

  
233 236
	LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" )
234 237
}
235 238

  
Thank you!