squeaky-pl / portable-pypy

Portable 64 bit x86 PyPy binaries for many Linux distributions.
Other
478 stars 38 forks source link

Error "Unexpected double format" on some machines #56

Closed SemenMartynov closed 6 years ago

SemenMartynov commented 7 years ago

After

docker run --rm `ABI=64 ./runopt.sh` portable-pypy ./build_deps

I see

+ make -j4
echo @`sh  cflags "optimize='-O2'" opmini.o`  -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
@cc -c -DPERL_CORE -D__USE_XOPEN2K8 -I/opt/prefix/include -I/opt/prefix/include/ncurses -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -Wall -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
In file included from op.c:103:0:
perl.h:6978:6: error: #error "Unexpected double format"
 #    error "Unexpected double format"
      ^~~~~
perl.h:7177:6: error: #error "Unexpected double format"
 #    error "Unexpected double format"
      ^~~~~
feature.h:151: confused by earlier errors, bailing out
make: *** [opmini.o] Error 1
SemenMartynov commented 7 years ago

Hmm... I'm a bit confused... I meet this issue on Ubuntu 16.04, but on CentOS 7.3 everything works like a charm! I thought there shouldn't be different because of docker.

squeaky-pl commented 7 years ago

This is entirely possible since the volumes are mounted inside your host operating system. Something about how you configured your file system or particular file system can lead to this problem (indirectly). I never translate on Ubuntu myself. Docker gained support for named volumes quite some time ago, maybe that solves the problem on Ubuntu.

SemenMartynov commented 7 years ago

I can see, that it doesn't related with ubuntu...

I have two hosts and on the first build goes well and on another it ends with an error. The difference in flags!

user@bad$ cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core)
echo @`sh  cflags "optimize='-O2'" opmini.o`  -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
@cc -c -DPERL_CORE -D__USE_XOPEN2K8 -I/opt/prefix/include -I/opt/prefix/include/ncurses -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -Wall -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
In file included from op.c:103:0:
perl.h:6978:6: error: #error "Unexpected double format"
 #    error "Unexpected double format"
      ^~~~~
perl.h:7177:6: error: #error "Unexpected double format"
 #    error "Unexpected double format"
      ^~~~~
feature.h:151: confused by earlier errors, bailing out
make: *** [opmini.o] Error 1

~

user@good$$ cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core)
echo @`sh  cflags "optimize='-O2'" opmini.o`  -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
@cc -c -DPERL_CORE -D__USE_XOPEN2K8 -I/opt/prefix/include -I/opt/prefix/include/ncurses -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c89 -O2 -Wall -Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c

So... there are flowing flags on the good host: -std=c89 -Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings

SemenMartynov commented 7 years ago

I noticed another feature on the bad host

[root@3be89043a175 perl-5.24.1]# ./configure.gnu --prefix=/opt/prefix
try.c: In function 'main':
try.c:9:2: internal compiler error: Illegal instruction
  {4294967303.15, 4294967303ULL},
  ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
SemenMartynov commented 7 years ago

I believe I see where issue is, but don't know how to fix it:

Checking the kind of long doubles you have...
Cannot figure out your long double.
desowin commented 6 years ago

I noticed that "Cannot figure out you long double" happens when I run docker inside Linux running in VirtualBox. When Linux runs directly, then I noticed the internal compiler error.

I managed to build perl using 5bd0b05632d41618373afb99b61a5a7389cb6011 with modified env.list to contain /opt/devtools-7.1/bin instead of /opt/devtools-7.2/bin

SemenMartynov commented 6 years ago

Yes, I also can not get build with 7.2.

As for 7.1 -- on some machines it works, but for some it does not, and I could not detect the dependence. I have an observation that the autotool checks the CPU for the support long double, and not always find it.

And one more detail - if I build on the native host (i.e. without Docker) the build always goes well!..

So the issue is somewhere between toolchain and the Docker.

SemenMartynov commented 6 years ago

Finlay I found the issue! This usually means the gmp or mpfr library you are using is compiled not for the machine you are using and compiled for a new processor. So, it is in tool-chain...