Re: Building GCC 8 using 32-bit addressing on a 64-bit machine
Segher Boessenkool <[email protected]> Mon, 27 Apr 2026 07:35:53 -0500
| Newsgroups | gmane.comp.gcc.help |
|---|---|
| Message-ID | <ae9YKSSSRIKH-30_@gate> |
On Mon, Apr 27, 2026 at 04:32:18AM -0700, Gordon Steemson via Gcc-help wrote: > 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 lik e 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? You haven't said what you tried, only what you want the result to be. From the few things you said you likely want --host=powerpc-linux ? Segher