tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Selecting a C++ compiler

Edgar Fuß <> writes:

> Default GCC version for C++:
> I guess some _GCC_CXX_VERSION_DEFALULT in platform-specific files will do. 
> Of course, someone need to fill in the desired values.

Yes, but we are making progress on consensus about how to choose.
Then, choosing is fairly easy.

> Mixing different GCC versions for C and C++:
> -- Either it's neccessary to build everything with the same compiler, 
>    then just remove the .if !empty(USE_LANGUAGES:Mc++)

yes, if we land there.

> -- Or only a few packages are affected, then either add c++ to their 
>    USE_LANGUAGES (including a comment) or tag them with some 
>    need-the-same-gcc-as-c++ flag that invokes the same branch as if 
>    USE_LANGUAGES contained c++.

I would want a GCC_MUST_MATCH_G++ (but that name is bad) instead of
blurring declarative vs what we want the effects to be today.  But yes
in principle.  And I think this belongs in bl3 of the libs that have
this issue.

> Support for various C++ versions by individual GCC versions:
> -- If, for any (X,Y) GCC version X accepts -std=c++Y but is considered to 
>    in fact not really do so, simply add this combination to my 
> -- If this would be too gross, add GCC_REQD to the affected packages.

I think the notion of "gcc X implements std Y" is just coded as you did.

The only issue, I think, is gcc 4.9 and maybe 4.8 and C++11.  There, we
either agree that 4.8/4.9 do not implemenet C++11 (which seems strictly
true), or we say they do and make a package that has an issue with that
set GCC_REQD=5.

> Bootstrapping issues:
> -- When built with gcc-inplace-math and -nls, the only dependency of 
>    lang/gcc{49,5,6} is gsed. I doubt that is correct, but it would be 
>    harmless, no?

On NetBSD 7, pkgsrc gsed provides no libraries and only uses base
libraries.  So I think there are no issues.

> -- lang/gcc48 additionally depends on gmp, isl and cloog. Do we need 
>    lang/gcc48 as a default C++ compiler?

Probably not, because if we need a better-than-base compiler, 48 seems
like a bad choice.

> -- We need to assure gcc-inplace-math (and -nls) when building GCC as a 
>    build dependency, either by making that the default or temporarily 
>    overriding the options.

That is the perhaps controversial point.

> -- for lang/gccN itself, we could set a special flag circumventing the 
>    must-build-GCC-first logic or invent a native-c++ pseudo-USE_LANGUAGES 
>    value.

So do you think we need two versions, the "real" gcc6, and the
"bootstrap" gcc6?  Two packages from same source?  Something else?

> People never using C++:
> In case any choice of the above options would affect people never ever 
> building anything using C++ (embedded systems come to my mind), we could 
> use a special setting of GCC_CXX_VERSION (empty or "none") that would 
> preserve the current behaviour for non-c++ packages and fail for c++ 
> packages.

I think if C is built with base, then what would be done for C++ won't
happen if you don't build C++.

But I suppose if GCC_CXX_VERSION is set to none, then any attempt to
use a C++ compiler would fail hard, and that seems ok.

Attachment: signature.asc
Description: PGP signature

Home | Main Index | Thread Index | Old Index