Summary: | dev-cpp/tbb always pick g++ instead of clang++ | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Julian Cléaud <julian.cleaud> |
Component: | Current packages | Assignee: | Gentoo Science Related Packages <sci> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jstein |
Priority: | Normal | Keywords: | PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/gentoo/gentoo/pull/13129 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Log of emerge dev-cpp/tbb-2017.20161126 with clang++
build.log |
Created attachment 545780 [details]
build.log
successful compile of tbb using clang with edited ebuild
Couldn't compile using clang with the default ebuild. I tested this out using the same method above and can confirm it works. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1ddeefb53647830f2c1b781c51487eecd290d4a commit a1ddeefb53647830f2c1b781c51487eecd290d4a Author: Peter Levine <plevine457@gmail.com> AuthorDate: 2019-10-03 01:43:17 +0000 Commit: Guilherme Amadio <amadio@gentoo.org> CommitDate: 2019-10-03 09:31:43 +0000 dev-cpp/tbb: Fix building with clang Prevent "clang++" from being inadvertently matched to "*g++*" in a case statement. Closes: https://bugs.gentoo.org/662990 Closes: https://github.com/gentoo/gentoo/pull/13129 Package-Manager: Portage-2.3.76, Repoman-2.3.17 Signed-off-by: Peter Levine <plevine457@gmail.com> Signed-off-by: Guilherme Amadio <amadio@gentoo.org> dev-cpp/tbb/tbb-2019.8.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) |
Created attachment 542650 [details] Log of emerge dev-cpp/tbb-2017.20161126 with clang++ The package dev-cpp/tbb (all current versions) will never pick clang when used because of an error within the ebuild : local_src_compile() { [...] case "$(tc-getCXX)" in *g++*) comp="gcc" ;; *ic*c) comp="icc" ;; *clang*) comp="clang" ;; *) die "compiler $(tc-getCXX) not supported by build system" ;; esac [...] CXX="$(tc-getCXX)" \ CC="$(tc-getCC)" \ [...] emake compiler=${comp} work_dir="${BUILD_DIR}" tbb_root="${S}" $@ } This snippet causes error because tc-getCXX most probably returns clang++ when clang is used and hence matches "*g++*" first. As a test, I added this line just before the case block : elog "TC: $(tc-getCXX)" And got the following : * TC: /usr/lib/llvm/6/bin/clang++ Hence, at build time, this line showed that gcc was selected : make -j9 compiler=gcc work_dir=/var/tmp/portage/dev-cpp/tbb-2017.20161128/work/tbb2017_20161128oss-abi_x86_64.amd64 tbb_root=/var/tmp/portage/dev-cpp/tbb-2017.20161128/work/tbb2017_20161128oss tbb tbbmalloc Finally, this result in the following error (at least for >=dev-cpp/tbb-2017.20161128) and a failure to emerge it : clang-6.0: error: unknown argument: '-flifetime-dse=1' To fix this bug, simply swap clang before g++ within the case, because g++ is unlikely to match clang (all current ebuilds have this bug) : local_src_compile() { [...] case "$(tc-getCXX)" in *clang*) comp="clang" ;; *g++*) comp="gcc" ;; *ic*c) comp="icc" ;; *) die "compiler $(tc-getCXX) not supported by build system" ;; esac [...] }