abulmo / amoeba

an UCI chess engine in D language
GNU General Public License v3.0
44 stars 8 forks source link

Crashes gdc, ldc2 needs -fPIC? #4

Closed reppolice closed 7 years ago

reppolice commented 7 years ago

Hi, not much of a D guy here, but I can't build on Ubuntu 16.10 with the repo compilers, gdc simply segfaults (I was very impressed by that!), while ldc:

ldc2 -O3 -release -boundscheck=off -singleobj -w -dw amoeba.d util.d board.d eval.d kpk.d move.d search.d uci.d weight.d /usr/bin/ld: amoeba.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status Error: /usr/bin/gcc failed with status: 1 Makefile:79: recipe for target 'build' failed

I couldn't build even without the "fast" target, is there any obvious fix here?

Thanks!

abulmo commented 7 years ago

I cannot help much. I personally use Fedora and the compilers from the official dlang site (http://dlang.org/download.html) without problems. Your problem is related to your compilation environment, not to amoeba, so I will close this issue. Googling shows it is a common problem on Ubuntu 16.10: https://wiki.ubuntu.com/SecurityTeam/PIE. You can try to add the "-fPIC" option to ldc2, or more probably "-relocation-model=pic", but I cannot test it nor guaranty this will work.