FS#46260 - [dmd] [ldc] fail to build d programs
Attached to Project:
Community Packages
Opened by Richard White (rwhite) - Friday, 11 September 2015, 15:02 GMT
Last edited by Doug Newgard (Scimmia) - Sunday, 20 September 2015, 03:30 GMT
Opened by Richard White (rwhite) - Friday, 11 September 2015, 15:02 GMT
Last edited by Doug Newgard (Scimmia) - Sunday, 20 September 2015, 03:30 GMT
|
Details
Description: Both the dmd and ldc (but not the gdc) d
compilers in the repos fail to build anything. It always
returns this
/usr/bin/ld: hello.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC hello.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status --- errorlevel 1 Steps to reproduce: Create a *.d file with the trivial program void main(){} $ dmd filename.d |
This task depends upon
My /etc/dmd.conf is:
[Environment]
DFLAGS=-I/usr/include/dlang/dmd -L-L/usr/lib -L-L/usr/lib32 -L--export-dynamic
which is the default I believe.
And my /etc/ldc2.conf:
default:
{
// 'switches' holds array of string that are appends to the command line
// arguments before they are parsed.
switches = [
"-I/usr/include/dlang/ldc/ldc",
"-I/usr/include/dlang/ldc",
"-L-L/usr/lib",
"-L-L/usr/lib32",
"-L--no-warn-search-mismatch",
"-defaultlib=lphobos2,ldruntime",
"-debuglib=lphobos2-debug,ldruntime-debug"
];
};
Which is also the default.
/usr/bin/ld: hello.o: relocation R_X86_64_32 against `.rodata..str' can not be used when making a shared object; recompile with -fPIC
hello.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Error: /usr/lib/hardening-wrapper/bin/gcc failed with status: 1