Re: Plan to Update GPC

Waldek Hebisch <[email protected]> Fri, 8 May 2020 16:53:37 +0200
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
On Thu, May 07, 2020 at 05:11:05PM -0400, Kevan Hashemi wrote:
> Dear GPC Collaborators,
> 
> PROBLEM: MacOS 10.15 does not run 32-bit binaries. My application uses 30k lines of GPC code. The MacOS GPC is 32-bit only.
> 
> MY FAILURE ON MACOS: The current GPC is compatible with the back-end of GCC 3.4.6 only.

No.  While little used GCC 4.1.2 port is finished and should work well.

> The procedure on all platforms is to compile gcc3.4.6 with the GPC sources. With a variety of C-compilers on MacOS (CLANG, GCC-4.9, GCC-5, and GCC-8), I can produce the two cross-compiler executables xgcc and xgpc. These are x86_64 executables. They both compile "Hello World", but they produce only 32-bit objects. When I pass "-m64", they say "Sorry: 64-bit not compiled in". I try building GCC 3.4.6 alone with:
> 
> config --target=x86_64-apple-darwin
> make
> 
> But I get, "Configuration x86_64-apple-darwin16.7.0 not supported". When I apply the same procedure to the GCC 4.9.4 sources, the build proceeds. The GCC 3.4.6 sources support 64-bit targets on Linux, so I was hoping it could do the same on MacOS. I have examined the GCC literature and the contents of gcc/config, but I still don't know what file should be present to provide x86_64 support on apple-darwin. Unless someone tells me otherwise, I'm going to assume that getting the 64-bit MacOS GPC out of GCC 3.4.6 is impossible.
> 
> Translating all my beautiful, reliable GPC code into another language does not sound like fun. Porting GPC to a newer version of GCC, such as GCC 8, is a possibility, but I understand that the GCC back-end team has a history of being uncooperative with the GPC team. Another solution is to port GPC to LVVM so we can use the CLANG compilers. The LVVM strategy seem like a good one to me: produce platform-independent code that then gets compiled and assembled. If I understand correctly, a CLANG front-end will work on any platform.
> 
> I would like to hear your advice. I have to solve this problem. I have allocated one thousand hours of my time to get it done. If there is a way to revive GPC with that amount of labor, I'll do it.

First step would be to find out earliest GCC which supports
64-bit Mac OS as target.  It is possible that GCC-4.3.5 will
do, attempting to build gets beyond "Configuration
x86_64-apple-darwin16.7.0 not supported" (full build requies
Apple tools so I can not check if it works).

Anyway, I would suggenst trying

http://github.com/hebisch/gpc

with GCC-4.3.5.  Look at README, for 4.3.5 you need to use
'--disable-mapped-location'.

-- 
                              Waldek Hebisch