After hours of struggle I finally found the problem. We need to enable the always-libgcc option in order to produce binaries. In mk.conf add this line: PKG_OPTIONS.gcc10 = always-libgcc The system of course has libgcc available. I wonder why pkgsrc's GCC just can't see and use it.