Plan to Update GPC

Kevan Hashemi hashemi at
Tue Jun 2 22:54:18 CEST 2020

Dear Thomas,

> May I suggest that you write up your knowledge of what you did? 

Here is my GPC web page, which I'll leave up as it is.

Here are a few things that might prove useful, but which are already known to Waldek, Gale, and John.

(1) There is no port to MacOS of Binutils "as" and "ld". With MacOS Command Line Tools comes the CLANG C-compiler, assembler, and linker. There is also a GNU-like assembler, which you can get access to with "as -Q". This GNU-Like assembler is an Apple-created branch of the true GNU Assembler dating back two decades.

(2) The original GCC 3.4.6, which I hoped to use to compile GPC on MacOS, produces .stabs debug assembler directives. The CLANG assembler does not recognise .stabs directives. But the GNU-like assembler does recognise them.

(3) The GNU-like assembler will not accept certain movq x64_86 instructions generated by the host's GCC 4+ compiler, or the host CLANG CC compiler, when building the target GCC 3.4.6. But the CLANG assembler will accept these instructions.

Corrolary: In order to compile GCC 3.4.6, we need to start with the CLANG compiler to compile the XGCC, then switch to the GNU-Like assembler to assemble the output of XGCC as it compiles GPC. I was doing this by hand because I could not figure out how to get the configure or Makefiles to make the switch automatically.

(4) Having compiled an intermediate cross-compiler, XGCC 3.4.6, I can get most of the way to producing GPC, but only in 32-bit. So far as I can tell, GCC 3.4.6 does not support x86_64 on MacOS. So we have to compile GPC with a later GCC.

(5) Now Waldek provides a modified GPC that he is able to compile with GCC 4.3.5. I try that on MacOS. We need the "-std=gnu89" option during the compile of GCC 4.3.5, whcih the CLANG compiler does not recognise. So we must compile GCC 4.3.5 with another GCC compiler. I worked with GCC 4.9.4 and "-std=gnu89".

(6) At this point, I'm getting duplicate library routine errors, which I can get past by deleting object files. Waldek tells me there he suspects some confusion with the limits.h header files. I have 99 instances of this file on my machine. My machine is a mess.

That's it.

Best, Kevan

Kevan Hashemi, Electrical Engineer
Physics Department, Brandeis University

More information about the Gpc mailing list