pkg_comp icon indicating copy to clipboard operation
pkg_comp copied to clipboard

use alternate compiler in sandbox

Open schmonz opened this issue 6 years ago • 1 comments

I'm wanting to do my NetBSD 8.x package builds with clang. Newer NetBSD has clang in the base system, but 8.x doesn't, so I've built it from pkgsrc on the host.

What's a good way to get clang pkg_add'd in the sandbox and have it get used to build the bootstrap and all my packages?

schmonz avatar Aug 25 '19 01:08 schmonz

mail/rspamd recently grew GCC_REQD+=8 and NetBSD 9.2's gcc is still 7.5.0, so I was curious what would happen on my next pkg_comp run. What happened was, pkgsrc built me a lang/gcc8 and used it to build mail/rspamd, which was slower (of course) but tolerably automatic, except that when I restarted rspamd I got this error:

/usr/lib/libstdc++.so.7: version GLIBCXX_3.4.18 required by /opt/pkg/lib/rspamd/librspamd-server.so not defined"

What I'm trying now:

  1. Build lang/gcc10 on the host system, with a LOCALBASE distinct from the target's
  2. Turn it into a fake NetBSD release-set tarball: tar -P -zcvf /path/to/binary/sets/pkgsrc-gcc10.tar.xz $(pkg_info -qL gcc10)
  3. Set GCCBASE to point at it in extra.mk.conf, and GCC_REQD=10 to try to avoid older/other pkgsrc gcc versions getting built
  4. pkg_comp extracts it and starts using it for post-bootstrap package builds
  5. At some point it's still trying to build lang/gcc10, which I'm still experimenting to see if I can avoid

schmonz avatar Jan 15 '22 12:01 schmonz