Bootstrapping build

Joakim via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Feb 25 03:05:29 PST 2016


On Wednesday, 24 February 2016 at 08:05:49 UTC, Russel Winder 
wrote:
> On Tue, 2016-02-23 at 20:14 +0100, David Nadlinger via 
> digitalmars-d- ldc wrote:
>> […]
>> 
>> As I'm sure you know, to avoid this issue you can either 
>> specify an rpath during linking or put the shared libraries 
>> into a well-known directory (/lib, /usr/lib or one listed in 
>> ld.so.conf).
>
> The /lib and /usr/lib solution are not feasible in my context 
> as those directories are reserved for package managed things. 
> All my personally build stuff goes into ~/Built. To add this to 
> the ld.so paths seems a bit wrong somehow as the directory 
> /etc/ld.so.conf.d is not really a place for per user things.
>
> I think my point was really that since the LDC build knows 
> where it is going to install ldc2 and the shared objects, it 
> should put the rpath into the installed compiler automatically 
> so as to avoid LD_LIBRARY_PATH being needed to run ldc2.

The issue, which David might have missed, is that the ldc binary 
itself is linked against the phobos shared library that comes 
with the D compiler that compiles the ddmd frontend in 2.069+, 
really the druntime portion I guess.  If that shared library is 
not in a standard path, ie if you just downloaded the dmd tar for 
linux, ldc won't know where to find it and will fail with a 
strange error when building druntime.

The solution is to add some logic to the cmake module that finds 
the D compiler to build ddmd and add that rpath if necessary when 
linking the ldc executable.  Otherwise, I followed your 
workaround and defined LD_LIBRARY_PATH.

Good thing you wrote about this as the error is tough to figure 
out otherwise.


More information about the digitalmars-d-ldc mailing list