View Single Post
Old December 17, 2016, 22:58   #115
aenea77
Rookie
 
Join Date: Dec 2016
Posts: 1
aenea77 is on a distinguished road
Problem compiling angband with gcc 6

Hi,
two days ago I updated my Linux Debian home server from stable(Jessie) to testing (Stretch), the version of the compiler changed to 6.2.1 20161124 (Debian 6.2.1-5).

After that I tried to compile the Angband source code taken from github and I obtained the following error:
/usr/bin/ld: -r and -pie may not be used together

The linker fails when it try to create angband.o, I'm not an expert on gcc but I did some research and it seems that the gcc included in the new Debian version is compiled with the option --enable-default-pie.
With this configuration a program compiled (and linked) through gcc will be a "position independent executable", this is a security feature.
Unfortunately ld can't be invoked with -r and -pie.
A possible solution that I found is to disable the option by using -fno-pie in the compiling phase and -no-pie in the linking phase.
I modified the Makefile under src directory and now the compiling process terminates correctly and I can play Angband again, for your reference I attach to my post the diff file.

Regards
Attached Files
File Type: txt Makefile-diff.txt (369 Bytes, 68 views)
aenea77 is offline   Reply With Quote