I could use some help compiling xorg for my iBook G4

Superrusso

New Member


Messages: 1

Hello everybody, I'm so thankful you're all here.

I'm trying to compile xorg for this old iBook G4, and I've run into a stumble. I'm trying to compile llvm90, and I get an error:

/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/config/rs6000/rs6000.md:5933: error: integer constant is too large for 'long' type

I actually get this error when trying to compile a few things to move forward, some mesa-dri...etc...I think this is due to an long int being used that is too long for this PowerPC 32 bit processor? Anyway, is there a path forward, do I need to change some variables in GCC maybe? I'd really like to get a window manager going on this thing and see how useful I can make it. This is a venture with education in mind, so I don't mind if it's a buncha work, but thus far this issue my google fu has failed me.

Again, thanks for any help anybody can lend!
 

canardo

New Member


Messages: 5

Hello,

I have the same problem that Superrusso has reported above.
I have install FreeBSD 12.0 powerpc on a Apple Powerbook G4 17"
When trying to install xorg via ports, i get a compilation error

Code:
/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/config/rs6000/rs6000.md:5933: error: integer constant is too large for 'long' type
Please find below some informations regarding the environment, and the full error message.

I'm an absolute newbie on FreeBSD (please be kind), and I don't know much about compiling. I gathered the info I could find.
As proposed above, I had a look on 3.18.44 IBM RS/6000 and PowerPC Options but I don't really understand it.

Question : how do I find the compiler information ? Is it all in the error message below ?


Hardware informations


Code:
# uname -mrs
FreeBSD 12.0-RELEASE powerpc
Code:
# getconf LONG_BIT
32
Code:
# sysctl -a hw.model
hw.model: Motorola PowerPC 7447A

Full error message

Code:
# cd /usr/ports/x11/xorg
# make install clean


===>  Staging for xorg-7.7_3
===>   xorg-7.7_3 depends on file: /usr/local/libdata/pkgconfig/dri.pc - not found
===>   mesa-dri-18.3.2_7 depends on package: wayland-protocols>=1.8 - found
===>   mesa-dri-18.3.2_7 depends on file: /usr/local/libdata/pkgconfig/pthread-stubs.pc - found
===>   mesa-dri-18.3.2_7 depends on executable: bison - found
===>   mesa-dri-18.3.2_7 depends on executable: msgfmt - found
===>   mesa-dri-18.3.2_7 depends on executable: gmake - found
===>   mesa-dri-18.3.2_7 depends on package: pkgconf>=1.3.0_1 - found
===>   mesa-dri-18.3.2_7 depends on file: /usr/local/bin/python3.6 - found
===>   mesa-dri-18.3.2_7 depends on package: llvm80>=3.9.0_4 - not found
===>   llvm80-8.0.1_3 depends on executable: sphinx-build-3.6 - found
===>   llvm80-8.0.1_3 depends on package: py36-recommonmark>=0.0.20180530 - found
===>   llvm80-8.0.1_3 depends on executable: swig3.0 - not found
===>   swig30-3.0.12 depends on executable: gmake - found
===>   swig30-3.0.12 depends on shared library: libpcre.so - not found
===>   pcre-8.43_2 depends on executable: gcc9 - not found
===>  Building for gcc9-9.2.0
gmake[12]: Entering directory '/usr/ports/lang/gcc9/work/.build'
echo stage3 > stage_final
gmake[13]: Entering directory '/usr/ports/lang/gcc9/work/.build'
gmake[14]: Entering directory '/usr/ports/lang/gcc9/work/.build'
gmake[15]: Entering directory '/usr/ports/lang/gcc9/work/.build'
rm -f stage_current
gmake[15]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
gmake[14]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
gmake[14]: Entering directory '/usr/ports/lang/gcc9/work/.build'
gmake[15]: Entering directory '/usr/ports/lang/gcc9/work/.build/libiberty'
gmake[16]: Entering directory '/usr/ports/lang/gcc9/work/.build/libiberty/testsuite'
gmake[16]: Nothing to be done for 'all'.
gmake[16]: Leaving directory '/usr/ports/lang/gcc9/work/.build/libiberty/testsuite'
gmake[15]: Leaving directory '/usr/ports/lang/gcc9/work/.build/libiberty'
gmake[15]: Entering directory '/usr/ports/lang/gcc9/work/.build/lto-plugin'
gmake  all-am
gmake[16]: Entering directory '/usr/ports/lang/gcc9/work/.build/lto-plugin'
gmake[16]: Leaving directory '/usr/ports/lang/gcc9/work/.build/lto-plugin'
gmake[15]: Leaving directory '/usr/ports/lang/gcc9/work/.build/lto-plugin'
gmake[15]: Entering directory '/usr/ports/lang/gcc9/work/.build/intl'
gmake[15]: Nothing to be done for 'all'.
gmake[15]: Leaving directory '/usr/ports/lang/gcc9/work/.build/intl'
gmake[15]: Entering directory '/usr/ports/lang/gcc9/work/.build/build-powerpc-portbld-freebsd12.0/libiberty'
gmake[16]: Entering directory '/usr/ports/lang/gcc9/work/.build/build-powerpc-portbld-freebsd12.0/libiberty/testsuite'
gmake[16]: Nothing to be done for 'all'.
gmake[16]: Leaving directory '/usr/ports/lang/gcc9/work/.build/build-powerpc-portbld-freebsd12.0/libiberty/testsuite'
gmake[15]: Leaving directory '/usr/ports/lang/gcc9/work/.build/build-powerpc-portbld-freebsd12.0/libiberty'
gmake[15]: Entering directory '/usr/ports/lang/gcc9/work/.build/build-powerpc-portbld-freebsd12.0/fixincludes'
gmake[15]: Nothing to be done for 'all'.
gmake[15]: Leaving directory '/usr/ports/lang/gcc9/work/.build/build-powerpc-portbld-freebsd12.0/fixincludes'
gmake[15]: Entering directory '/usr/ports/lang/gcc9/work/.build/build-powerpc-portbld-freebsd12.0/libcpp'
test -f config.h || (rm -f stamp-h1 && gmake stamp-h1)
gmake[15]: Leaving directory '/usr/ports/lang/gcc9/work/.build/build-powerpc-portbld-freebsd12.0/libcpp'
gmake[15]: Entering directory '/usr/ports/lang/gcc9/work/.build/libbacktrace'
gmake  all-am
gmake[16]: Entering directory '/usr/ports/lang/gcc9/work/.build/libbacktrace'
true  DO=all multi-do # gmake
gmake[16]: Leaving directory '/usr/ports/lang/gcc9/work/.build/libbacktrace'
gmake[15]: Leaving directory '/usr/ports/lang/gcc9/work/.build/libbacktrace'
gmake[15]: Entering directory '/usr/ports/lang/gcc9/work/.build/libcpp'
test -f config.h || (rm -f stamp-h1 && gmake stamp-h1)
gmake[15]: Leaving directory '/usr/ports/lang/gcc9/work/.build/libcpp'
gmake[15]: Entering directory '/usr/ports/lang/gcc9/work/.build/libdecnumber'
gmake[15]: Nothing to be done for 'all'.
gmake[15]: Leaving directory '/usr/ports/lang/gcc9/work/.build/libdecnumber'
gmake[15]: 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[15]: *** [Makefile:1116: insn-emit.o] Error 1
gmake[15]: Leaving directory '/usr/ports/lang/gcc9/work/.build/gcc'
gmake[14]: *** [Makefile:4662: all-stage1-gcc] Error 2
gmake[14]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
gmake[13]: *** [Makefile:22474: stage1-bubble] Error 2
gmake[13]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
gmake[12]: *** [Makefile:22806: bootstrap-lean] Error 2
gmake[12]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[11]: stopped in /usr/ports/lang/gcc9
*** Error code 1

Stop.
make[10]: stopped in /usr/ports/lang/gcc9
*** Error code 1

Stop.
make[9]: stopped in /usr/ports/devel/pcre
*** Error code 1

Stop.
make[8]: stopped in /usr/ports/devel/pcre
*** Error code 1

Stop.
make[7]: stopped in /usr/ports/devel/swig30
*** Error code 1

Stop.
make[6]: stopped in /usr/ports/devel/swig30
*** Error code 1

Stop.
make[5]: stopped in /usr/ports/devel/llvm80
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/devel/llvm80
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/graphics/mesa-dri
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/graphics/mesa-dri
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/x11/xorg
*** Error code 1

Stop.
make: stopped in /usr/ports/x11/xorg


Thanks a lot for your help.
 

mark_j

Active Member

Reaction score: 44
Messages: 111

I "think" it's a bug in gcc-9.2.0 port because insn-emit.c is a generated file while building the compiler.

Looking at the command line, there's no -mcpu=powerpc or -mcpu=native specified. I would have expected something like either of these to be present (unless GCC defaults to what it detects as the CPU architecture).

I think all you could reasonably do is report this to the maintainer of the gcc-9.2.0 port, see:

You could also try to just build gcc9 in ports and see if that emits any more errors (doubtful, but hey, it's better than nothing).

Perhaps try building an earlier version of gcc to see if you can get a functioning GCC?

(It's scary to me that an application depends on a compiler's specific version :
pcre-8.43_2 depends on executable: gcc9 - not found). Depending on any compiler does seem backward, and contrary to why we have so many "standards"... LOL. :p
 

canardo

New Member


Messages: 5

Same error, as expected, when trying to directly compile gcc9.

FYI, gcc8 compiles fine, but xorg definitely asks for gcc9.

A bug already exists in BugZilla for this problem, but has been reported for 12.1-BETA2, so I've added a comment related to 12.0-RELEASE : PR 241125

I don't know if I could/should update the bug title or the version by myself, so I let them as they were.
Maybe someone more "experienced" should do it ?
 

roccobaroccoSC

Aspiring Daemon

Reaction score: 145
Messages: 600

There was another thread in the forum recently, where they had a similas issue. It turned out different versions of gcc might get mixed up, when installed in parallel. Maybe try to have only one version installed and see if this resolves the problem.
Also, you could upgrade the system to a higher patch level. Yours is 12.0 unpatched.
 

canardo

New Member


Messages: 5

My final goal was to install xorg, and while installing it, I bumped on the gcc-9.2.0 problem.
It is only after, that I tried to install gcc-8, so my guess is gcc-9 by itself has a problem.

Indeed, my 12.0 is unpatched. But when I tried to updated it, I got the following error message

Code:
freebsd-update fetch
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching public key from update4.FreeBSD.org... failed.
Fetching public key from update1.FreeBSD.org... failed.
Fetching public key from update2.FreeBSD.org... failed.
No mirrors remaining, giving up.
It is a fresh install, so maybe I have to tweak something in my config. I didn't had time to investigate this error yet.
If you have any suggestions they are very welcome :)
Thanks
 

mark_j

Active Member

Reaction score: 44
Messages: 111

Same error, as expected, when trying to directly compile gcc9.

FYI, gcc8 compiles fine, but xorg definitely asks for gcc9.

A bug already exists in BugZilla for this problem, but has been reported for 12.1-BETA2, so I've added a comment related to 12.0-RELEASE : PR 241125

I don't know if I could/should update the bug title or the version by myself, so I let them as they were.
Maybe someone more "experienced" should do it ?
Well the compilation of gcc8 was always a 'hail mary'.
As to the bug report, I wouldn't worry. It's been assigned, someone knows the variants are 12R and 12.1b2.
 

mark_j

Active Member

Reaction score: 44
Messages: 111

There was another thread in the forum recently, where they had a similas issue. It turned out different versions of gcc might get mixed up, when installed in parallel. Maybe try to have only one version installed and see if this resolves the problem.
Also, you could upgrade the system to a higher patch level. Yours is 12.0 unpatched.
Patching it now, knowing the bug is still around would be a waste of time, IMHO.
 

acheron

Aspiring Daemon

Reaction score: 228
Messages: 601

Indeed, my 12.0 is unpatched. But when I tried to updated it, I got the following error message

Code:
freebsd-update fetch
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching public key from update4.FreeBSD.org... failed.
Fetching public key from update1.FreeBSD.org... failed.
Fetching public key from update2.FreeBSD.org... failed.
No mirrors remaining, giving up.
It is a fresh install, so maybe I have to tweak something in my config. I didn't had time to investigate this error yet.
If you have any suggestions they are very welcome :)
Thanks
freebsd-update doesn't work for tier2 arches, it's only for i386/amd64. You can either set up your own server or use the traditionnal make buildworld buildkernel / installworld installkernel.
 

goosnarrggh

New Member


Messages: 1

The problematic code was added with this commit https://github.com/gcc-mirror/gcc/commit/4b4c309c5ddb4cf08c87fc552d8c85e89de32e14
You can try to change (not tested) : 0xFFFFFFF8FFFFFFFF to 0xFFFFFFF8FFFFFFFFLL
And it is patched in trunk: https://github.com/gcc-mirror/gcc/commit/297d694377b6bd379e5cd7b885abed5fc31323e1
It's also been back-ported to the gcc-9 branch: https://github.com/gcc-mirror/gcc/commit/72bbeccc70e7f509d0ff46ba94508eef2381cd02

It seems likely that the patch suggested above has been approved by people who are in a position to know for certain that it is appropriate, and it is reasonable to expect that, eventually, an upstream minor gcc 9.x update will be released which will eliminate the need for a private patch.
 

canardo

New Member


Messages: 5

Bugzilla ticket PR 241125 is now Closed FIXED

The FreeBSD version I'm using is
FreeBSD 12.1-RELEASE-p1 powerpc

I've updated ports following the fix, and then compile gcc9.
Problem is I now have another error.
I search on FreeBSD forum, Bugzilla and Google, and did not find the same error.

My questions are:
- does someone else has the same error ?
- should I open a new thread on the forum or stay in this thread ?
- should I create a new bug on Bugzilla ?
- do you know how to fix this problem (maybe I made a mistake..) ?

Thanks a lot


Error is


Code:
# cd /usr/ports/lang/gcc9
# make install clean
===>  Building for gcc9-9.2.0
gmake[2]: Entering directory '/usr/ports/lang/gcc9/work/.build'
echo stage3 > stage_final
....
....
gmake[5]: Nothing to be done for 'all'.
gmake[5]: Leaving directory '/usr/ports/lang/gcc9/work/.build/libdecnumber'
gmake[5]: Entering directory '/usr/ports/lang/gcc9/work/.build/gcc'
/usr/ports/lang/gcc9/work/.build/./gcc/xgcc -B/usr/ports/lang/gcc9/work/.build/./gcc/ -xc -nostdinc /dev/null -S -o /dev/null -fself-test=/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/testsuite/selftests
cc1: internal compiler error: Segmentation fault
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
gmake[5]: *** [/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/c/Make-lang.in:124: s-selftest-c] Error 1
gmake[5]: Leaving directory '/usr/ports/lang/gcc9/work/.build/gcc'
gmake[4]: *** [Makefile:4662: all-stage1-gcc] Error 2
gmake[4]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
gmake[3]: *** [Makefile:22474: stage1-bubble] Error 2
gmake[3]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
gmake[2]: *** [Makefile:22806: bootstrap-lean] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/gcc9
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/gcc9
 

tibikuera

New Member


Messages: 1

Bugzilla ticket PR 241125 is now Closed FIXED

The FreeBSD version I'm using is
FreeBSD 12.1-RELEASE-p1 powerpc

I've updated ports following the fix, and then compile gcc9.
Problem is I now have another error.
I search on FreeBSD forum, Bugzilla and Google, and did not find the same error.

My questions are:
- does someone else has the same error ?
- should I open a new thread on the forum or stay in this thread ?
- should I create a new bug on Bugzilla ?
- do you know how to fix this problem (maybe I made a mistake..) ?

Thanks a lot


Error is


Code:
# cd /usr/ports/lang/gcc9
# make install clean
===>  Building for gcc9-9.2.0
gmake[2]: Entering directory '/usr/ports/lang/gcc9/work/.build'
echo stage3 > stage_final
....
....
gmake[5]: Nothing to be done for 'all'.
gmake[5]: Leaving directory '/usr/ports/lang/gcc9/work/.build/libdecnumber'
gmake[5]: Entering directory '/usr/ports/lang/gcc9/work/.build/gcc'
/usr/ports/lang/gcc9/work/.build/./gcc/xgcc -B/usr/ports/lang/gcc9/work/.build/./gcc/ -xc -nostdinc /dev/null -S -o /dev/null -fself-test=/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/testsuite/selftests
cc1: internal compiler error: Segmentation fault
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
gmake[5]: *** [/usr/ports/lang/gcc9/work/gcc-9.2.0/gcc/c/Make-lang.in:124: s-selftest-c] Error 1
gmake[5]: Leaving directory '/usr/ports/lang/gcc9/work/.build/gcc'
gmake[4]: *** [Makefile:4662: all-stage1-gcc] Error 2
gmake[4]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
gmake[3]: *** [Makefile:22474: stage1-bubble] Error 2
gmake[3]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
gmake[2]: *** [Makefile:22806: bootstrap-lean] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/gcc9/work/.build'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/gcc9
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/gcc9
I have exactly the same error.
 

canardo

New Member


Messages: 5

Regarding error 'internal compiler error: Segmentation fault' described above, I've created a new bugzilla ticket PR 242506.

If you have the same error, I invite you to had comments in the bug, related for example to your hardware/software/config info.
 
Top