Opened 9 years ago

Last modified 2 years ago

#48004 reopened defect

Internal compiler error (gcc-5.1.0) when using math.h on Yosemite

Reported by: skymoo (Adam Mercer) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), larryv (Lawrence Velázquez), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), cooljeanius (Eric Gallager)
Port: gmp, gcc5, gcc10, gcc11

Description

I've been trackinng down a build error with some software and it seems that gcc5 @5.1.0_1 is throwing an internal error on Yosemite on anything using the math.h header, for example:

cgc-mercer-vm1:~ ram$ cat test.c
#include <stdio.h>
#include <math.h>

int main(void)
{
double x, y, result;
x = 2;
y = 8;
result = pow(x, y);
printf("%g^%g = %g\n", x, y, result);
return(0);
}
cgc-mercer-vm1:~ ram$ gcc-mp-5 -o test test.c
In file included from test.c:2:0:
/opt/local/lib/gcc5/gcc/x86_64-apple-darwin14/5.1.0/include-fixed/math.h:
In function '__inline_isnormalf':
/opt/local/lib/gcc5/gcc/x86_64-apple-darwin14/5.1.0/include-fixed/math.h:273:5:
internal compiler error: Illegal instruction: 4
     return __inline_isfinitef(__x) && __builtin_fabsf(__x) >= __FLT_MIN__;
     ^

/opt/local/lib/gcc5/gcc/x86_64-apple-darwin14/5.1.0/include-fixed/math.h:273:5:
internal compiler error: Abort trap: 6
gcc-mp-5: internal compiler error: Abort trap: 6 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://trac.macports.org/newticket> for instructions.
cgc-mercer-vm1:~ ram$

The same code builds fine on Mavericks with the same version of this the gcc5 port

Attachments (1)

main.log (10.0 MB) - added by skymoo (Adam Mercer) 9 years ago.

Change History (17)

comment:1 Changed 9 years ago by skymoo (Adam Mercer)

The machine that I seeing this used the prebuilt gcc5 @5.1.0_1 binary, another machine had the port built from source and that didn't exhibit the problem. I'm just building the gcc5 from source on the machine that exhibited the problem to see if that changes anything.

comment:2 Changed 9 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

Changed 9 years ago by skymoo (Adam Mercer)

Attachment: main.log added

comment:3 Changed 9 years ago by skymoo (Adam Mercer)

The gcc5 port failed to build from source, build log is attached. The specific failure is:

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/build/./gcc/xgcc -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/build/./gcc/ -B/opt/local/x86_64-apple-darwin14/bin/ -B/opt/local/x86_64-apple-darwin14/lib/ -isystem /opt/local/x86_64-apple-darwin14/include -isystem /opt/local/x86_64-apple-darwin14/sys-include    -g -O2 -pipe -Os -O2  -g -O2 -pipe -Os -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -pipe -fno-common -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -pipe -fno-common -I. -I. -I../.././gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/gcc-5.1.0/libgcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/gcc-5.1.0/libgcc/. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/gcc-5.1.0/libgcc/../gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/gcc-5.1.0/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o _divsc3_s.o -MT _divsc3_s.o -MD -MP -MF _divsc3_s.dep -DSHARED -DL_divsc3 -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/gcc-5.1.0/libgcc/libgcc2.c
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/gcc-5.1.0/libgcc/libgcc2.c: In function '__mulxc3':
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/gcc-5.1.0/libgcc/libgcc2.c:1957:21: internal compiler error: Illegal instruction: 4
:info:build     if (isnan (c)) c = COPYSIGN (0, c);
:info:build                      ^
:info:build libbacktrace could not find executable to open
:info:build Please submit a full bug report,
:info:build with preprocessed source if appropriate.
:info:build See <https://trac.macports.org/newticket> for instructions.
:info:build make[3]: *** [_mulxc3_s.o] Error 1
:info:build make[3]: *** Waiting for unfinished jobs....
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/build/x86_64-apple-darwin14/libgcc'
:info:build make[2]: *** [all-stage1-target-libgcc] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/build'
:info:build make[1]: *** [stage1-bubble] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/build'
:info:build make: *** [bootstrap] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/build'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc5/gcc5/work/build" && /usr/bin/make -j4 -w bootstrap 
:info:build Exit code: 2
:error:build org.macports.build for port gcc5 returned: command execution failed
:debug:build Error code: CHILDSTATUS 76615 2
:debug:build Backtrace: command execution failed

I notice that it reports another internal compiler error:

internal compiler error: Illegal instruction: 4

This machine is running Yosemite and is actually a VM running under Fusion 7. Is this some kind of virtualisation issue?

comment:4 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Don't know. It built fine for me under Yosemite on a real Mac.

comment:5 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

On my system:

$ port -v installed gcc5
The following ports are currently installed:
  gcc5 @5.1.0_1+universal (active) platform='darwin 14' archs='i386 x86_64'
$ gcc-mp-5 -o test test.c
$ ./test 
2^8 = 256
$ 

comment:6 Changed 9 years ago by larryv (Lawrence Velázquez)

gcc5 builds fine for me on normal Yosemite and virtualized Mavericks.

Do you see any xgcc crash reports in Console?

comment:7 in reply to:  6 Changed 9 years ago by skymoo (Adam Mercer)

Replying to larryv@…:

gcc5 builds fine for me on normal Yosemite and virtualized Mavericks.

It builds fine for me on Yosemite and Mavericks when running on actual hardware, I haven't tried virtualised Mavericks. I can test that.

Do you see any xgcc crash reports in Console?

I didn't look. The machine is on a private network at work, I'll try and look tomorrow. If I don't have the time it'll be next week as I'm traveling from Friday through Monday.

comment:8 in reply to:  6 Changed 9 years ago by skymoo (Adam Mercer)

Replying to larryv@…:

Do you see any xgcc crash reports in Console?

Sorry for the delay, we've been moving offices and I just managed to get the machine powered back up. I just tried to rebuild gcc5 again so didn't see any crash reports in Console.

comment:9 in reply to:  6 Changed 9 years ago by skymoo (Adam Mercer)

Replying to larryv@…:

gcc5 builds fine for me on normal Yosemite and virtualized Mavericks.

It also builds find under vitualised Mavericks for me. Seems like this could be related to virtualisation.

comment:10 Changed 8 years ago by gnw3

This could be related to Bug #51097, where gcc5 builds failed in xgcc until I installed gmp +core2 rather than using the default macports binary.

comment:11 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: mcalhoun@… added

Cc Me!

comment:12 Changed 7 years ago by kurthindenburg (Kurt Hindenburg)

Owner: changed from mww@… to macports-tickets@…
Status: newassigned

comment:13 Changed 3 years ago by kencu (Ken)

Resolution: worksforme
Status: assignedclosed

looks like this resolved itself. Please reopen if otherwise

comment:14 Changed 2 years ago by kencu (Ken)

Resolution: worksforme
Status: closedreopened

Not actually resolved!

see #64355

comment:15 Changed 2 years ago by kencu (Ken)

Port: gmp gcc10 gcc11 added

all the gcc versions I tried showed this error until I rebuilt gmp from source on this core2 machine I am using, then all the gcc versions work properly again.

The gmp Portfile already goes to steps to make sure that gmp is built to the lowest supported processor, so I'm not quite sure how I found myself in this position at the moment. I have gmp built universal, if that could make any difference in how the logic works.

But at any rate, for someone who stumbles over this, rebuilding gmp is the probable fix.

Perhaps there is nothing left to fix in the gmp port, given the steps it already takes.

comment:16 Changed 2 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.