[erlang-questions] OTP / HiPE broken with GCC 6.2

Kostis Sagonas kostis@REDACTED
Sat Nov 5 11:22:23 CET 2016


On 11/05/2016 12:49 AM, Johannes Weißl wrote:
> Hi Mikael,
>
> On Thu, Nov 03, 2016 at 08:12PM +0100, Mikael Pettersson wrote:
>> > I cannot reproduce this with the tip of the otp master branch, and gcc's built
>> > from either the gcc-6.2.0 release tar ball or from a recent head of the gcc-6 branch.
> Can you try to configure gcc with "--enable-default-pie"? With this flag
> (which is used for the Debian gcc package) I could reproduce the bug on
> Debian and Fedora with the gcc-6.2.0 release tar ball and the current
> gcc svn trunk (rev 241852). PIE also seems to have been used for the
> official Fedora erlang19.1.4-1.fc25 package, as there HiPE is also
> broken.
>
>> > Most likely the Erlang VM was compiled with non-standard options, for instance
>> > as a PIE (position-independent executable) which would break all address space
>> > layout assumptions.
> This seems to be the case, thanks for the pointer! What would be your
> preferred solution to solve this problem? One possibility would be to
> add an option to the OTP build system to compile without PIE, so
> that it does not break for compilers that have PIE enabled by default.
> Similar has been suggested here for the Linux kernel:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841438

Well, it's good to know that HiPE, when suffering from such problems, is 
in good company (that of the Linux kernel).

> With CFLAGS and LDFLAGS set to "-no-pie -fno-pie" I can compile a
> working version with the current Debian Testing gcc.

 From a quick read of the thread you suggested for the kernel and of the 
corresponding Ubuntu thread, it seems that forcing no-pie in the flags 
is the way on this one.

But of course this does not solve the problem for OTP releases that are 
already out there. (It should be pretty obvious that this affects all 
Erlang/OTP releases that include HiPE: none can be compiled with PIE.)

Kostis



More information about the erlang-questions mailing list