gcc 9.2.0 port doesn't compile on powerpc platform: c++ -std=gnu++98 -fno-PIE -c -g -DIN_GCC -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -I. -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/. -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/../include -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/../libcpp/include -I/usr/local/include -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/../libdecnumber -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/../libbacktrace -DLIBICONV_PLUG -o insn-emit.o -MT insn-emit.o -MMD -MP -MF ./.deps/insn-emit.TPo insn-emit.c /usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/config/rs6000/rs6000.md:5933: error: integer constant is too large for 'long' type Tried on 12.1-BETA2: FreeBSD applejuice 12.1-BETA2 FreeBSD 12.1-BETA2 GENERIC powerpc
Is this on literal "powerpc" (32-bit) or "powerpc64" (64-bit), or one of the other variants instead?
This is old Mac Mini so 32-bit: kernel: cpu0: Motorola PowerPC 7447A revision 1.2, 1249.10 MHz kernel: cpu0: Features 9c000000<PPC32,ALTIVEC,FPU,MMU> kernel: cpu0: HID0 8450c0bc<EMCP,TBEN,NAP,DPM,ICE,DCE,SGE,BTIC,LRSTK,FOLD,BHT>
Same error also present in FreeBSD 12.0-RELEASE I don't know if the bug title should be updated/edited accordingly, or if a new ticket should be created. On my machine, Powerbook G4 17, same error when compiling gcc-9.2.0 gmake[5]: Entering directory '/usr/ports/lang/gcc9/work/.build/gcc' c++ -std=gnu++98 -fno-PIE -c -g -DIN_GCC -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -I. -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/. -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/../include -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/../libcpp/include -I/usr/local/include -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/../libdecnumber -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/../libbacktrace -DLIBICONV_PLUG -o insn-emit.o -MT insn-emit.o -MMD -MP -MF ./.deps/insn-emit.TPo insn-emit.c /usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/config/rs6000/rs6000.md:5933: error: integer constant is too large for 'long' type gmake[5]: *** [Makefile:1116: insn-emit.o] Error 1 uname -mrs FreeBSD 12.0-RELEASE powerpc getconf LONG_BIT 32 sysctl -a hw.model hw.model: Motorola PowerPC 7447A
Identical bug in FreeBSD 11.3 PowerPC architecture on ports build
Confirm this bug on my PowerBook G4 My uname -a: FreeBSD newton 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC powerpc
Forum thread at https://forums.freebsd.org/threads/i-could-use-some-help-compiling-xorg-for-my-ibook-g4.72492/ might provide additional insight.
Hi! What is your host compiler, and its version?
My version of FreeBSD is FreeBSD 12.0-RELEASE powerpc freshly installed, with no changes to default values. So I guess the compiler is the default one (clang ??). If you post command lines, I can run them on my machine and post results here.
(In reply to canardo from comment #8) it's gcc 4.2.1 on 12.0
Can you try the same workaround that's been put in for powerpc64, i.e. using gcc8?
For those experiencing this issue, can you please post the output of cc --version Segher, https://forums.freebsd.org/threads/i-could-use-some-help-compiling-xorg-for-my-ibook-g4.72492/ identifies https://github.com/gcc-mirror/gcc/commit/4b4c309c5ddb4cf08c87fc552d8c85e89de32e14 by Carl Love as the GCC commit this caused this.
Yes, and I identify https://gcc.gnu.org/r278107 as the commit that fixes it :-) I'll backport that (to GCC 9) later this week. (Please report GCC bugs in GCC bugzilla. Thanks!)
On my machine: cc --version cc (GCC) 4.2.1 20070831 patched [FreeBSD]
I have done the backport. When FreeBSD gets a new snapshot from the gcc-9-branch it will have the fix.
Lovely, thank you Segher! The next snapshot update I'll be committing (to lang/gcc9-devel) is *not* going to have this yet, but the one I'll commit in about a week (which is going to be this coming Saturday's) should. And then I'll be looking into adding a temporary patch for lang/gcc9 since the next minor release from the GCC 9 branch probably is a little too far out.
A commit references this bug: Author: gerald Date: Wed Nov 27 10:41:54 UTC 2019 New revision: 518494 URL: https://svnweb.freebsd.org/changeset/ports/518494 Log: Update to the 20191123 snapshot of GCC 9.2.1. This addresses a build failure on powerpc ("error: integer constant is too large for 'long' type"). [1] It also brings three improvements for both the tree optimizers and middle end, plus one each for i386 and powerpc, and several on the C++ side. PR: 241125 [1] Changes: head/lang/gcc9-devel/Makefile head/lang/gcc9-devel/distinfo
A commit references this bug: Author: gerald Date: Fri Nov 29 13:47:58 UTC 2019 New revision: 518650 URL: https://svnweb.freebsd.org/changeset/ports/518650 Log: Temporarily apply a patch from upstream that addresses a build failure on powerpc ("error: integer constant is too large for 'long' type"). This is already part of lang/gcc9-devel after r518494 and the 20191123 snapshot of GCC 9.2.1; it will be part of the GCC 9.3 release at which point we can remove this local patch again. PR: 241125 Changes: head/lang/gcc9/files/patch-powerpc32
Sodala, I think we are done and have addressed this everywhere possible. Thanks to everyone who helped nail this down!
A commit references this bug: Author: gerald Date: Thu Mar 26 14:16:58 UTC 2020 New revision: 529189 URL: https://svnweb.freebsd.org/changeset/ports/529189 Log: Update to the GCC 9.3 release, which fixes some 157 further bugs. This remains the default version of GCC in the Ports Collection, and this update mostly addresses regressions. files/patch-powerpc32 was a backport from this release branch to begin with and has now become obsolete. [1] PR: 241125 [1] Changes: head/lang/gcc9/Makefile head/lang/gcc9/distinfo head/lang/gcc9/files/patch-powerpc32