pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: How to choose (pkgsrc) gcc version for build ?
vom513 <vom513%gmail.com@localhost> writes:
> I looked over:
>
> https://www.netbsd.org/docs/pkgsrc/configuring.html
>
> https://wiki.netbsd.org/pkgsrc/gcc/
>
> And I’m afraid I still can’t tell if this is possible. I’d like to use a pkgsrc (i.e. newer) gcc for building one specific package.
>
> Is there a way to do this ?
Set GCC_REQD for that package only. Something like (edited from
something else, not tested) in mk.conf
.if "${PKGPATH}" == "foo/bar"
GCC_REQD+= 14
.endif
This won't force that version, because there might be GCC_REQD+=17
someplace else.
Or just add the line into your copy of pkgsrc, or
make GCC_REQD=14 package-install
> And of course if what I’m asking is “bad mojo” please tell me that as
> well… It’s just I have something I need to build that supposedly will
> work with gcc14 - but I don’t necessarily want to build everything
> afterwards with it (unless this is actually recommended?)
Well, the entire situation is messy, as in theory there are ABI
differences among gcc versions and mixing libstdc++ versions in one
binary because one lib was build with N and one lib with M is messy.
However, we do it all the time, and pkgsrc has lots of USE_CXX_FEATURES
to specify a language variant for conditional upgdrade.
Many people believe, and a few insist on it, that the best thing is to
use one compiler for everything, period. But that's not typical
practice.
> Obviously to even build gcc14 I had to bootstrap with the system gcc
> (12.5.0 I think) - so there are a handful of packages built with that
> already (chicken vs. egg).
Yes, you can just cd /usr/pkgsrc/lang/gcc14 and build the package.
There are three paths from that:
1. Set GCC_REQD+=14 for packages that need it. If so, you are
probably finding a bug and perhaps the package uses the unreleased
C++27 :-) But seriously, it's a good question if it's something
about you or your system, or if everybody else would have the same
issue.
2. After building gcc14, set GCC_REQD+=14 in mk.conf, so everything
else uses 14. For extra points, use conditionals to omit gcc14 and
dependencies. sysutils/auto-admin may be useful.
3. After building gcc14, "pkg_admin set rebuild=yes \*" and run
pkg_rolling-replace, so that you have even gcc14 and deps built
with gcc14.
There's a fourth path, which is to bootstrap pkgsrc to eg
/usr/pkg-compiler and build gcc14, and then set up pkgsrc to use that as
an external compiler and build everything.
Generally option 1 is ok.
Home |
Main Index |
Thread Index |
Old Index