Building GCC 8 using 32-bit addressing on a 64-bit machine
Gordon Steemson via Gcc-help <[email protected]> Mon, 27 Apr 2026 04:32:18 -0700
| Newsgroups | gmane.comp.gcc.help |
|---|---|
| Message-ID | <[email protected]> |
I had been encountering a strange problem when bootstrapping GCC 8 in 64-bit mode on my 20-year-old Power Mac G5, which seems to be due to an obscure OS tooling bug and not easily addressed; so I decided to step back and build it for the 32-bit mode of that environment instead. Alas, when I do, the stage1 compiler chokes upon execution, because the stack frames generated by gcc/config/rs6000/rs6000.c do not match the hardcoded size expectations – specifically, the four-register-sized allocation reserved for __builtin_eh_return()’s use takes twice as much space as the preset template expects, because UNITS_PER_WORD is eight rather than four on a PowerPC 970. (I haven’t yet worked out how the same code somehow manages to build correctly when compiled in 64-bit mode ... it's not like any of that code is adjusted to suit the specs of the underlying machine. I can’t locate the definition of __builtin_eh_return(), either.) Does anyone have any insight into this? If I could figure out where __builtin_eh_return() is defined, I could at least determine whether it’s safe to only allocate four octets per saved register (even if that would do more to mask the problem than to actually _fix_ it). If I just go by the results of grep’ing the source tree, __builtin_eh_return() doesn’t actually seem to EXIST. The whole thing is very puzzling, especially since I have seen the project build correctly in the past when it was told to expect a PowerPC 7400 as the default 32-bit target. I hypothesize that configuration does not work correctly when told to use the 32-bit mode of a 64-bit processor as the default 32-bit target. Is this a thing that can be tweaked, or have I encountered a hard limitation? Gordon Steemson