Bootstrapping build

David Nadlinger via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Feb 25 10:36:44 PST 2016


Hi Russel,

On 25 Feb 2016, at 18:37, Russel Winder via digitalmars-d-ldc wrote:
> I appreciate this is a non-trivial issue/problem, hopefully my attempt
> at humour has not implied I believe otherwise.

No worries, I definitely didn't pick up any such vibes. In turn, I was 
just trying to make sure I understand what the problem is in the first 
place.

> My thinking is that if the CMAKE_INSTALL_PREFIX has been set then the
> build should be able to add this with '/lib' as the rpath into the
> final link of ldc2 and ldmd2. Moreover, ldc2 and ldmd2 themselves 
> could
> add this as an rpath in the link of any created executables.
>
> However my CMake and ld skills are not great, so this may be "pie in
> the sky".

Doing that wouldn't be difficult in itself. For example, we do something 
like the former already for the binary releases where we need to find 
the libconfig .so, but can't be sure of the install path: 
https://github.com/ldc-developers/ldc-scripts/blob/987fe9d4abccd48fd45f1c3112b8faf6bfc82aeb/ldc2-packaging/2-build-ldc.sh#L41
And for the latter, one could just add the appropriate linker flag to 
ldc2.conf.

We should definitely do something like that if/when we ship Linux binary 
packages with shared libraries included. However, I'm not so sure 
whether it should be the default. Trying to play cute tricks instead of 
relying on the standard way of doing things tends not to end all that 
well. And it seems as if we'd need to exclude builds standard 
installation directories even if we did always hard-code the rpath, as 
that is for example forbidden in the Fedora packaging guidelines.

  — David



More information about the digitalmars-d-ldc mailing list