jmmv / pkg_comp

Automates the build of pkgsrc binary packages in a sandbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use alternate compiler in sandbox

schmonz opened this issue · 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?

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