Bug 257167 - Mk/Uses/compiler.mk: openmp unnecessarily sets USE_GCC=yes (on some architectures_
Summary: Mk/Uses/compiler.mk: openmp unnecessarily sets USE_GCC=yes (on some architect...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2021-07-14 01:22 UTC by Piotr Kubaj
Modified: 2021-08-22 20:30 UTC (History)
3 users (show)

See Also:


Attachments
Unified diff to limit gcc use (529 bytes, patch)
2021-08-21 21:58 UTC, Jason W. Bacon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2021-07-14 01:22:34 UTC
LLVM has libomp on most architectures, so it should be possible to set USES=compiler:openmp and just use base clang on those architectures.

There are some architectures where there's no libomp available due to lack of support, and for those architectures USES=compiler:openmp should be equal to USES=compiler:gcc-c++11-lib.

Currently setting USES=compiler:openmp is equal to USE_GCC=yes.
Comment 1 Jason W. Bacon freebsd_committer 2021-08-20 21:13:24 UTC
I second this.

What platforms still require gcc for openmp?  My openmp-dependent ports build fine with clang on x86, aarch64, and ppc64 (13-RELEASE), but I don't want to remove compiler:openmp from my ports if it's going to cause breakage elsewhere.
Comment 2 Piotr Kubaj freebsd_committer 2021-08-21 01:08:51 UTC
Currently armv6, armv7, powerpc and powerpcspe.
Comment 3 Jason W. Bacon freebsd_committer 2021-08-21 14:31:25 UTC
It should be pretty simple to limit the gcc requirement to those platforms, correct?  Any other reason not to proceed?
Comment 4 Jason W. Bacon freebsd_committer 2021-08-21 21:58:49 UTC
Created attachment 227359 [details]
Unified diff to limit gcc use

Attached patch works for me.
Comment 5 Piotr Kubaj freebsd_committer 2021-08-21 23:14:12 UTC
(In reply to Jason W. Bacon from comment #4)
That's not enough, programs using C++ will be mislinked.

On affected architectures, it should also add the necessary CXXFLAGS and LDFLAGS:
CXXFLAGS+=      -nostdinc++ -isystem /usr/include/c++/v1
LDFLAGS+=       -L${WRKDIR}

_USES_configure+=       200:gcc-libc++-configure
gcc-libc++-configure:
        @${LN} -fs /usr/lib/libc++.so ${WRKDIR}/libstdc++.so
Comment 6 Jason W. Bacon freebsd_committer 2021-08-21 23:49:42 UTC
(In reply to Piotr Kubaj from comment #5)

Is this somehow happening now, without the ARCH checks, or is your aim to tackle another existing issue while we're in there.
Comment 7 Piotr Kubaj freebsd_committer 2021-08-22 20:30:32 UTC
(In reply to Jason W. Bacon from comment #6)
I'm not sure, but it would be better to solve this issue properly.