Frank Heckenbach wrote:
Adriaan van Os wrote:
The most recent Apple version of GCC that I can find on the web (http://www.opendarwin.org/en/news.php#20) is "gcc3-1205 Darwin". Installing and using it doesn't change reported problems. Yet, I can use it to build a new GCC from the standard GCC-3.2.1 sources. This gives me a GCC-3.2.1 that installs and runs on Darwin. If I use this new GCC (3.2.1) to build GPC 20021128, there are no building problems: reported problems 1 to 4 have disappeared !
I don't quite understand. With the downloaded GCC, you are able to build gcc-3.2.1, but building GPC with gcc-3.2.1 sources fails. But the problems (#1, 2 and 3) are related to parts of the GCC sources that are unchanged by GPC. So compiling the same sources once works and once fails!? I must be missing something ...
Problems #1, 2 and 3 are related to GCC (not GPC), so to build "GCC 3.2.1" I had to ignore problem #1 (which doesn't seem to influence the build process). Also, I had to apply the hacks for problems #2 and #3. However, this new (hacked) GCC 3.2.1 compiler now causes problems when I try to repeat what (I think) I did. Probably, I have mixed up versions and my statement above is wrong. Well, I have done quite a lot of experimenting with different versions -- on the fly trying to learn UNIX.
Well, to be more precise, rebuilding GCC 3.2.1, using a fresh copy of the GCC-3.2.1 sources and the hacked GCC 3.2.1 compiler results in an error:
In file included from ../../../gcc-3.2/gcc/intl/dcigettext.c:58: ../include/stdlib.h:84: syntax error before "rune_t" make[3]: *** [dcigettext.o] Error 1 make[2]: *** [intl.all] Error 1 make[1]: *** [stage2_build] Error 2 make: *** [bootstrap] Error 2
(Please note that this error doesn't appear when building GCC 3.2.1 with an Apple GCC, but that results in other problems, as reported).
At first, I thought, the error was related to the hacked GCC 3.2.1 compiler, but it turns out that GCC 3.2.1 doesn't build (itself) on Darwin without a patch to stddef.h. The patch can be found at http://gcc.gnu.org/ml/gcc/2002-08/msg01681.html.
--- gcc-04072002/gcc/ginclude/stddef.h Wed Jan 9 13:28:06 2002 +++ gccsrc/gcc/gcc/ginclude/stddef.h Thu Jul 4 18:37:27 2002 @@ -242,6 +242,7 @@ #ifndef _WCHAR_T_ #ifndef _BSD_WCHAR_T_ #ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */ +#ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */ #ifndef _WCHAR_T_DEFINED_ #ifndef _WCHAR_T_DEFINED #ifndef _WCHAR_T_H @@ -278,6 +279,7 @@ #ifdef _BSD_RUNE_T_ #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) typedef _BSD_RUNE_T_ rune_t; +#define _BSD_RUNE_T_DEFINED_ #define _BSD_WCHAR_T_DEFINED_ #if defined (__FreeBSD__) /* Why is this file so hard to maintain properly? In constrast to @@ -295,6 +297,7 @@ #endif #ifndef __cplusplus typedef __WCHAR_TYPE__ wchar_t; +#endif #endif #endif #endif
I propose to add this patch to gcc-3.2.1.diff. It is already in the GCC trunk (whatever that may be).
After the patch, I can use the hacked GCC 3.2.1 to build a clean GCC-3.2.1, "make bootstrap" is successfull. Now that I (finally) have a clean GCC 3.2.1 compiler, I can also build a clean GPC 3.2.1 on Darwin.
Resumé ----------- Problem 1. The Conftest crash is still there, but it doesn't seem to matter. I will investigate it further. Problem 2. Temporary hack (problem has gone with the final GCC 3.2.1 compiler) Problem 3. Temporary hack (problem has gone with the final GCC 3.2.1 compiler) Problem 4. Remove the space after `-D' in p/Make-lang.in (Frank Heckenbach) Linker reports malformed object. Patch Parse.y (Frank Heckenbach) GCC-3.2.1 doesn't build on Darwin. Apply above patch (Andreas Tobler)