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

Johannes Weißl jargon@REDACTED
Sat Nov 5 00:49:07 CET 2016

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

> 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:

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

> If you want further help debugging this, show us
> (1) the output of gcc -v

$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.2.0-10' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.2.0 20161027 (Debian 6.2.0-10)

> (2) any special options (whether via ./configure or environment variables) used when
>     compiling otp

No special options.


More information about the erlang-questions mailing list