* On 2024-08-01 at 01:35 BST, phil+netbsd%krylov.eu@localhost wrote:
+# This package will link against libstdc++.so from the pkgsrc GCC when the +# base OS GCC doesn't meet the minimum requirement. Thus we do this so the +# appropriate gcc-libs package will be captured as a dependency, otherwise +# binary packages will be broken. +# rustc: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/pkg/lib/libLLVM.so.18.1) +.if ${OPSYS} == "Linux" +OPSYS_LIBSTDCXX_VERSIONS_CMD= objdump -p ${_OPSYS_LIB_DIRS:=/libstdc++.so.*} 2>/dev/null | grep -o 'GLIBCXX_[0-9.]*' +. if empty(OPSYS_LIBSTDCXX_VERSIONS_CMD:sh:MGLIBCXX_3.4.22) +USE_PKGSRC_GCC_RUNTIME= yes +. endif +.endif
This isn't the correct fix. Unfortunately it's a bit more complicated than that.
USE_PKGSRC_GCC_RUNTIME is a user variable, so packages shouldn't be setting it. Its purpose is to determine whether the dependency for GCC libraries should come from the -libs package instead of the main GCC package.
The problem is that the main GCC packages only set DEPMETHOD=build, which in the case of USE_PKGSRC_GCC_RUNTIME=no is wrong, they should be full dependencies so that the runtime libraries are available.
I'll need to do some testing before making changes, as it's been a while since I used the in-tree GCC packages (mostly because they have issues such as this).
We should also consider just making USE_PKGSRC_GCC_RUNTIME=yes the default.
-- Jonathan Perkin - mnx.io - pkgsrc.smartos.org Open Source Complete Cloud www.tritondatacenter.com