August 28, 2016
On Sunday, 28 August 2016 at 20:42:12 UTC, Joseph Rushton Wakeling wrote:
> 
> Erm ... I've just done a completely fresh build of LDC v1.0.0 (freshly checked out from git), and there's no sign of an ldc-profdata binary.  Nor does make seem to know anything about and ldc-profdata target.
>
> What am I missing? :-\

Sorry, my fault. It's not part of 1.0.0.

-Johan
August 28, 2016
On Sunday, 28 August 2016 at 22:13:06 UTC, Johan Engelen wrote:
> On Sunday, 28 August 2016 at 20:42:12 UTC, Joseph Rushton Wakeling wrote:
>> 
>> Erm ... I've just done a completely fresh build of LDC v1.0.0 (freshly checked out from git), and there's no sign of an ldc-profdata binary.  Nor does make seem to know anything about and ldc-profdata target.
>>
>> What am I missing? :-\
>
> Sorry, my fault. It's not part of 1.0.0.

No worries.  I'll make sure that it gets added to the package definition once 1.1.0 is out ;-)
August 30, 2016
On Sunday, 28 August 2016 at 20:30:49 UTC, kinke wrote:
> On Sunday, 28 August 2016 at 20:12:44 UTC, Joseph Rushton Wakeling wrote:
>>> how would I ensure that the built ldc2 tries to use _that_ linker rather than some other one?
>
> There's a hidden `-gcc=<pathToGcc>` switch supported by LDC. So I guess specifying that one in the default switches in the ldc2.conf file does the trick (e.g., `-gcc=%%ldcbinarypath/gcc`).

Is there any way of also specifying flags to pass to gcc?  I ask because just including them in the -gcc flag doesn't work, e.g.:

   -gcc=ldc2.gcc --sysroot=/snap/ldc2/x1/bin/..

... results in a gcc call where the --sysroot flag is placed in a position that gcc doesn't accept.

I've tried specifying `-L=...` but that's translated into a gcc call with `-Xlinker ...` rather than just being handed to gcc directly.
August 31, 2016
On Tuesday, 30 August 2016 at 23:22:12 UTC, Joseph Rushton Wakeling wrote:
> Is there any way of also specifying flags to pass to gcc?  I ask because just including them in the -gcc flag doesn't work, e.g.:
>
>    -gcc=ldc2.gcc --sysroot=/snap/ldc2/x1/bin/..
>
> ... results in a gcc call where the --sysroot flag is placed in a position that gcc doesn't accept.

Actually, I'm wrong about this: I think that LDC is checking to see if a file called `ldc2.gcc --sysroot=/snap/ldc2/x1/bin/..` exists, and since it doesn't find one (!), it exits with an error message.

Anyway, same question -- is there any way of including flags to pass to gcc, or is it just the gcc command itself that can be specified?
August 31, 2016
On 31 Aug 2016, at 20:37, Joseph Rushton Wakeling via digitalmars-d-ldc wrote:
> Anyway, same question -- is there any way of including flags to pass to gcc, or is it just the gcc command itself that can be specified?

Unfortunately, there is currently no way for doing that as far as I can see.

Such functionality would also be helpful for passing on GCC-style flags picked up from pkg-config et al. – see e.g. https://github.com/ldc-developers/ldc/pull/1594, although we'd need widespread host compiler support before we could rely on something like that.

For your particular use case, however – in a controlled and very specific situation –, wouldn't a small wrapper around the GCC binary to supplant the necessary arguments work just as well? If GCC doesn't work without any additional arguments, this is arguably a bug anyway.

 – David
August 31, 2016
On Wednesday, 31 August 2016 at 20:24:44 UTC, David Nadlinger wrote:
> For your particular use case, however – in a controlled and very specific situation –, wouldn't a small wrapper around the GCC binary to supplant the necessary arguments work just as well? If GCC doesn't work without any additional arguments, this is arguably a bug anyway.

It's pretty much what I've been trying to do, but the choice of wrapper doesn't seem to be respected.

Is there anything problematic with this ldc2.conf that you can see?  Any reason why it might not be respecting the `-gcc` flag included in the config?
https://gist.github.com/WebDrake/229645efeca14fa54b0b1c82bcbb6477
September 01, 2016
On 31 Aug 2016, at 22:24, Joseph Rushton Wakeling via digitalmars-d-ldc wrote:
> Is there anything problematic with this ldc2.conf that you can see?  Any reason why it might not be respecting the `-gcc` flag included in the config?
> https://gist.github.com/WebDrake/229645efeca14fa54b0b1c82bcbb6477

LDC will still go through the usual path lookup routines for the argument in order to deal with PATH lookup (see gen/programs.cpp). In what might be regarded as a bit of a quirk, as a result the -gcc argument and CC global are effectively just ignored silently if they cannot be resolved successfully.

Are you sure the binary specified is executable, on the PATH, and so on?

 — David
September 01, 2016
On Wednesday, 31 August 2016 at 23:16:04 UTC, David Nadlinger wrote:
> LDC will still go through the usual path lookup routines for the argument in order to deal with PATH lookup (see gen/programs.cpp). In what might be regarded as a bit of a quirk, as a result the -gcc argument and CC global are effectively just ignored silently if they cannot be resolved successfully.
>
> Are you sure the binary specified is executable, on the PATH, and so on?

Yea, that sounds a distinct possibility.  I was suspecting all along that LDC was somehow failing "silently" and falling back to some default, so it's good to have it confirmed that it's what is likely happening here.

Thanks very much -- I _think_ this is probably the last piece of the puzzle (famous last words, I know:-).
September 01, 2016
On Wednesday, 31 August 2016 at 23:16:04 UTC, David Nadlinger wrote:
> LDC will still go through the usual path lookup routines for the argument in order to deal with PATH lookup (see gen/programs.cpp). In what might be regarded as a bit of a quirk, as a result the -gcc argument and CC global are effectively just ignored silently if they cannot be resolved successfully.
>
> Are you sure the binary specified is executable, on the PATH, and so on?

Just to confirm: will the %%ldcbinarypath%% wildcard be respected when passed to the `-gcc` flag?  As in e.g.

    -gcc=%%ldcbinarypath%%/../usr/bin/gcc

... ?
September 01, 2016
On Thursday, 1 September 2016 at 20:43:48 UTC, Joseph Rushton Wakeling wrote:
> On Wednesday, 31 August 2016 at 23:16:04 UTC, David Nadlinger wrote:
>> LDC will still go through the usual path lookup routines for the argument in order to deal with PATH lookup (see gen/programs.cpp). In what might be regarded as a bit of a quirk, as a result the -gcc argument and CC global are effectively just ignored silently if they cannot be resolved successfully.
>>
>> Are you sure the binary specified is executable, on the PATH, and so on?
>
> Just to confirm: will the %%ldcbinarypath%% wildcard be respected when passed to the `-gcc` flag?  As in e.g.
>
>     -gcc=%%ldcbinarypath%%/../usr/bin/gcc
>
> ... ?

To be specific: I mean when placed in the `ldc2.conf` file.