Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Building PCC for "tools" is broken (missing symbol __USE)- PCC bug or NetBSD source tree error?





-----Original Message----- From: Iain Hibbert
Sent: Saturday, July 19, 2014 1:33 PM
To: William D. Jones
Cc: current-users%netbsd.org@localhost
Subject: Re: Building PCC for "tools" is broken (missing symbol __USE)- PCC bug or NetBSD source tree error?

it certainly is. I think I remember that __USE() now, it was a local
(NetBSD) addition due to a set but unused variable, which is changed in
upstream versions now.
Alright then. What do you suggest I do to reconcile the NetBSD version with the current upstream tree? Should I wait for the next major release of PCC, and then attempt to integrate the changes, or is there something I can do now (to start)?

It does handle most of the NetBSD source tree lately, the main problems
currently are things which GCC accepts (or encourages) which are not
supported. Personally, I think it would be good for PCC to be able to
build GCC, perhaps that would be enough compatibility.
I would be ecstatic to find another compiler that can compile GCC- even if only the first stage. It doesn't solve the difficult problem of finding a 100% compatible GCC compiler that's not a nightmare to port, but it's a start.

I have not tried application sources (eg pkgsrc) due to lack of time.
Join the club :P.

I am not sure, but it may not.. predictably the GCC developers use GCC
language features within their code, and these are not always supported. I
have been concentrating on other things lately and have not tried to build
GCC with PCC. At least I know that the binutils we have in tree won't
build, as there is an unsupported feature which causes an error (restrict
keyword in array declaration).
GCC 4.7.3 and below can in theory (emphasis on theory) be built with a pure ANSI C compiler that has a working libc. The first stage of GCC will use the host C compiler to build a cross-gcc from pure ANSI C. The cross-gcc can compile the remaining source code that relies on GCC's extensions. In practice, I have seen GCC 4.7.3 emit a number of warnings for standards-violating code when -pedantic is set. For perspective, from my own experimentation, TinyCC is capable of compiling the cross-gcc which then builds the remaining extensions (with minor source code tweaks in 3 or so file)... sadly the cross-gcc segfaults :P, and I haven't had the time to figure out what goes wrong. So I don't think it's an impractical goal.

Versions above 4.7.3 sadly require a C++ compiler. Still, one could compile GCC 4.7.3 and use that to create the C++ compiler.

--
William D. Jones

Home | Main Index | Thread Index | Old Index