Community Packages

Please read this before reporting a bug:
http://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

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
Task Type Bug Report
Category Packages
Status Closed
Assigned To Mihails Strasuns (Dicebot)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

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

Closed by  Doug Newgard (Scimmia)
Sunday, 20 September 2015, 03:30 GMT
Reason for closing:  Not a bug
Comment by Mihails Strasuns (Dicebot) - Saturday, 12 September 2015, 14:54 GMT
Is it on 32-bit system? I have just checked on my x86_64 Arch and it works with both 2.068.1 DMD and 0.15.1 LDC
Comment by Mihails Strasuns (Dicebot) - Saturday, 12 September 2015, 14:55 GMT
Also please check you dmd.conf / ldc2.conf for any custom modifications
Comment by Richard White (rwhite) - Saturday, 12 September 2015, 15:33 GMT
This is on a x86_64 Arch.

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.
Comment by Richard White (rwhite) - Saturday, 12 September 2015, 15:45 GMT
Just noticed that ldc has an additional line at the end of the error.

/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
Comment by Richard White (rwhite) - Saturday, 12 September 2015, 16:13 GMT
I found the problem. The hardening-wrapper package appends its utils (which seem to be incompatible with dmd and ldc) to the begging of your path causing them to be used. Removing the hardening-wrapper and restarting seems to have fixed the problem.
Comment by Mihails Strasuns (Dicebot) - Sunday, 13 September 2015, 10:10 GMT
Thanks for nailing it down. I am afraid there isn't much I can do in this case, this belongs to upstream issue tracker - https://issues.dlang.org/show_bug.cgi?id=15054

Loading...