autc04 / Retro68

a gcc-based cross-compiler for classic 68K and PPC Macintoshes
GNU General Public License v3.0
537 stars 51 forks source link

ICE when building gmp #232

Open agoode opened 4 months ago

agoode commented 4 months ago
%nix build github:autc04/Retro68#pkgsCross.m68k.gmp
error: builder for '/nix/store/94q4dzsx7jchnjxxrwdbxjl47l792z5x-gmp-with-cxx-static-m68k-apple-macos-6.3.0.drv' failed with exit code 2;
       last 25 log lines:
       >    71 | }
       >       | ^
       > libtool: compile:  m68k-apple-macos-gcc -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_mod_1_2 -O2 -pedantic -fomit-frame-pointer -m68000 -c mod_1_2.c  -fPIC -DPIC -o mod_1_2.o
       > /nix/store/x1xxsh1gp6y389hyl40a0i74dkxiprl7-bash-5.2-p15/bin/bash ../libtool  --tag=CC   --mode=compile m68k-apple-macos-gcc -DHAVE_CONFIG_H -I. -I..  -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo mul_fft | sed 's/_$//'`   -O2 -pedantic -fomit-frame-pointer -m68000 -c -o mul_fft.lo mul_fft.c
       > libtool: compile:  m68k-apple-macos-gcc -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_mod_1_3 -O2 -pedantic -fomit-frame-pointer -m68000 -c mod_1_3.c  -fPIC -DPIC -o mod_1_3.o
       > Please submit a full bug report, with preprocessed source (by using -freport-bug).
       > See <https://gcc.gnu.org/bugs/> for instructions.
       > make[2]: *** [Makefile:492: dump.lo] Error 1
       > make[2]: *** Waiting for unfinished jobs....
       > libtool: compile:  m68k-apple-macos-gcc -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_mod_1_4 -O2 -pedantic -fomit-frame-pointer -m68000 -c mod_1_4.c  -fPIC -DPIC -o mod_1_4.o
       > libtool: compile:  m68k-apple-macos-gcc -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_lshiftc -O2 -pedantic -fomit-frame-pointer -m68000 -c lshiftc.c  -fPIC -DPIC -o lshiftc.o
       > libtool: compile:  m68k-apple-macos-gcc -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_mul -O2 -pedantic -fomit-frame-pointer -m68000 -c mul.c  -fPIC -DPIC -o mul.o
       > libtool: compile:  m68k-apple-macos-gcc -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_mul_fft -O2 -pedantic -fomit-frame-pointer -m68000 -c mul_fft.c  -fPIC -DPIC -o mul_fft.o
       > during RTL pass: combine
       > mul_fft.c: In function 'mpn_mul_fft_decompose':
       > mul_fft.c:813:1: internal compiler error: in fixup_args_size_notes, at expr.cc:4469
       >   813 | }
       >       | ^

This is at https://github.com/autc04/Retro68/blob/4ff2d7d902bc3beaf51e97174b527a44d6c13190/gcc/gcc/expr.cc#L4469 which is close to the HALF-UNDERSTOOD HACK 🙂 from https://github.com/autc04/Retro68/commit/025ebb6397e3bb3f6571fce2df5e1c0030bf4d06.

I'm hopefully going to have time to keep looking. I might try removing the hack, but I'm not sure how to test the consequences of doing so.