digitalmars.D.ldc - How to set the linker ldmd2 LTS uses.
- Georgi D (19/19) Mar 03 2017 Hi,
- David Nadlinger (5/7) Mar 03 2017 You should be able to use the CC environment variable. There is a
- Georgi D (3/10) Mar 03 2017 This worked.
- Georgi D (31/38) Mar 03 2017 One more question:
- David Nadlinger via digitalmars-d-ldc (3/5) Mar 03 2017 %%ldcbinarypath%% is what you are looking for.
- Georgi D (5/10) Mar 04 2017 Yes, it worked perfectly. I think it would be useful to have an
Hi, I am trying to build LDC 1.1.1 using LDC LTS for bootstrap in a crosscompile environment where the system /usr/bin/gcc cannot be used. During the CMake generation I get: ``` Error: failed to locate gcc CMake Error at cmake/Modules/ExtractDMDSystemLinker.cmake:40 (message): Failed to compile empty program using D compiler '<toolchain>/bin/ldmd2' Call Stack (most recent call first): CMakeLists.txt:559 (include) ``` When I run ldmd2 -v test.d manually I see it is using: /usr/bin/gcc test.o -o test for linking. How can I specify the gcc location on the command line or in the environment? Thanks
Mar 03 2017
On Friday, 3 March 2017 at 21:35:13 UTC, Georgi D wrote:How can I specify the gcc location on the command line or in the environment?You should be able to use the CC environment variable. There is a hidden `gcc` switch as well, but I don't think we ever officially documented it. — David
Mar 03 2017
On Friday, 3 March 2017 at 21:39:55 UTC, David Nadlinger wrote:On Friday, 3 March 2017 at 21:35:13 UTC, Georgi D wrote:This worked. Thanks a lot.How can I specify the gcc location on the command line or in the environment?You should be able to use the CC environment variable. There is a hidden `gcc` switch as well, but I don't think we ever officially documented it. — David
Mar 03 2017
On Friday, 3 March 2017 at 21:39:55 UTC, David Nadlinger wrote:On Friday, 3 March 2017 at 21:35:13 UTC, Georgi D wrote:One more question: Is it possible to have paths relative to the compiler executable in ldc.conf? This is important to me because in my environment the compiler is build in a build farm and then downloaded as part of the build process to the local machine and used. So the ldc.conf generated during compilation would contain paths to the build farm machine which are not usable locally. It would be great if ldc.conf could look like this: ``` // This configuration file uses libconfig. // See http://www.hyperrealm.com/libconfig/ for syntax details. // The default group is required default: { // 'switches' holds array of string that are appends to the command line // arguments before they are parsed. switches = [ "-I${__LDC_BIN}/../include/d/ldc", "-I${__LDC_BIN}/../include/d", "-L-L${__LDC_BIN}/../lib", "-defaultlib=phobos2-ldc,druntime-ldc", "-debuglib=phobos2-ldc-debug,druntime-ldc-debug" ]; }; ``` I see that ldmd2 looks for ldc.conf relative to its binary location already. Thanks,How can I specify the gcc location on the command line or in the environment?You should be able to use the CC environment variable. There is a hidden `gcc` switch as well, but I don't think we ever officially documented it. — David
Mar 03 2017
On 3 Mar 2017, at 23:10, Georgi D via digitalmars-d-ldc wrote:Is it possible to have paths relative to the compiler executable in ldc.conf?%%ldcbinarypath%% is what you are looking for. — David
Mar 03 2017
On Friday, 3 March 2017 at 22:24:05 UTC, David Nadlinger wrote:On 3 Mar 2017, at 23:10, Georgi D via digitalmars-d-ldc wrote:Yes, it worked perfectly. I think it would be useful to have an option for the CMake build to emit ldc2.conf which uses this parameter (A position independent build). ThanksIs it possible to have paths relative to the compiler executable in ldc.conf?%%ldcbinarypath%% is what you are looking for. — David
Mar 04 2017