tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Using a replacement linker with pkgsrc

> On Jun 25, 2020, at 4:26 PM, Jonathan Perkin <> wrote:
> * On 2020-06-25 at 22:47 BST, Brook Milligan wrote:
>> Why is this not the default?  It would seem that if we build a
>> pkgsrc compiler we would always want all the associated libraries,
>> but perhaps I am missing something.
> I don't really know, but there appear to be two schools of thought in
> this area.
> One is to try and handle everything automatically and somewhat
> magically, attempting to pull in different compilers when the native
> compiler does not satisfy GCC_REQD, and somehow ensure that all of the
> different runtime libraries or compilers do not conflict.  The default
> of not using always-libgcc attempts to work around this by not
> installing the pkgsrc libgcc in order to prefer the native libgcc, but
> clearly it has issues.
> The alternative, and the one that I am strongly in favour of, is zero
> magic, where it is up to the user to decide up-front what compiler
> they will use to build all of their packages.  This requires them to
> think a bit in advance about what baseline they will use, and ensure
> that it is bootstrapped first, but results in only a single version of
> the GCC runtime being used across all packages, avoids lots of
> potential library-related issues, and is much simpler.
> AIUI I'm in the minority here though, hence the current defaults.

Thanks for the explanation.

In my experience, the magic works great … until it doesn’t.  Then it seems really hard to tweak things to work.  I also seem to think that the magic works much better on NetBSD than other platforms, some of which have substandard native tools, including compilers.

The magic also seems to be a problem when trying to build pkgsrc with something other than gcc.  For example, I have yet to figure out how to build pkgsrc with the pkgsrc version of clang, but perhaps that is just me.  (Please let me know how if it is possible.)

I’m not entirely sure if it is possible to build everything in pkgsrc with a single compiler; thus, there may always be some sort of magic like GCC_REQD.  However, if it is (or if it mostly is), I agree that an up-front, known-good configuration is much preferable to inpenetrable magic that almost works but often doesn't.  Currently, installing pkgsrc on non-standard systems is a real pain because there are so many degrees of freedom with respect to the toolchain, let alone random bugs in individual packages.  This in fact is one of my biggest annoyances.

To aid “not thinking in advance”, would it be feasible to define a better set of hooks for selecting a specific compile and also provide some, perhaps platform/version-specific, defaults?  It would be really helpful to be able to say, I want to use compiler X throughout, and have pkgsrc do the right thing.


Home | Main Index | Thread Index | Old Index