Tue, 29 Mar 2011 20:04:34 +0200
Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.
The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.
It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.
michael@320 | 1 | Index: config.guess |
michael@332 | 2 | diff -Nau config.guess.orig config.guess |
michael@332 | 3 | --- config.guess.orig 2011-03-21 16:02:29.000000000 +0100 |
michael@332 | 4 | +++ config.guess 2011-03-27 18:06:45.404612233 +0200 |
michael@320 | 5 | @@ -194,7 +194,7 @@ |
michael@320 | 6 | release='-gnu' |
michael@320 | 7 | ;; |
michael@320 | 8 | *) |
michael@320 | 9 | - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` |
michael@320 | 10 | + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` |
michael@320 | 11 | ;; |
michael@320 | 12 | esac |
michael@320 | 13 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: |
michael@332 | 14 | Index: gcc/config/alpha/osf5.h |
michael@332 | 15 | diff -Nau gcc/config/alpha/osf5.h.orig gcc/config/alpha/osf5.h |
michael@332 | 16 | --- gcc/config/alpha/osf5.h.orig 2010-11-21 01:54:14.000000000 +0100 |
michael@332 | 17 | +++ gcc/config/alpha/osf5.h 2011-03-27 18:06:45.432326155 +0200 |
michael@332 | 18 | @@ -94,7 +94,7 @@ |
michael@320 | 19 | constructor and call-frame data structures are not accidentally |
michael@320 | 20 | overridden. */ |
michael@320 | 21 | #define LINK_SPEC \ |
michael@320 | 22 | - "-G 8 %{O*:-O3} %{!O*:-O1} -S %{static:-non_shared} \ |
michael@320 | 23 | + "-oldstyle_liblookup %{!o:-o a.out} -G 8 %{O*:-O3} %{!O*:-O1} -S %{static:-non_shared} \ |
michael@320 | 24 | %{!static:%{shared:-shared -hidden_symbol _GLOBAL_*} \ |
michael@320 | 25 | %{!shared:-call_shared}} %{pg} %{taso} %{rpath*}" |
michael@320 | 26 | |
michael@320 | 27 | Index: gcc/config/i386/sol2-10.h |
michael@332 | 28 | diff -Nau gcc/config/i386/sol2-10.h.orig gcc/config/i386/sol2-10.h |
michael@332 | 29 | --- gcc/config/i386/sol2-10.h.orig 2011-01-26 21:23:17.000000000 +0100 |
michael@332 | 30 | +++ gcc/config/i386/sol2-10.h 2011-03-27 18:06:45.455032224 +0200 |
michael@332 | 31 | @@ -105,7 +105,7 @@ |
michael@320 | 32 | -R /usr/ucblib/64} \ |
michael@320 | 33 | %{!compat-bsd: \ |
michael@320 | 34 | %{!YP,*:%{p|pg:-Y P,/usr/lib/libp/64:/lib/64:/usr/lib/64} \ |
michael@320 | 35 | - %{!p:%{!pg:-Y P,/lib/64:/usr/lib/64}}}}" |
michael@320 | 36 | + %{!p:%{!pg:-Y P,/lib/64:/usr/lib/64}}} -rpath-link /lib/64:/usr/lib/64}" |
michael@320 | 37 | |
michael@320 | 38 | #undef LINK_ARCH64_SPEC |
michael@320 | 39 | #define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE |
michael@332 | 40 | @@ -122,7 +122,7 @@ |
michael@320 | 41 | #endif |
michael@320 | 42 | |
michael@320 | 43 | #define TARGET_LD_EMULATION "%{m64:-m " X86_64_EMULATION "}" \ |
michael@320 | 44 | - "%{!m64:-m " I386_EMULATION "} " |
michael@320 | 45 | + "%{!m64:} " |
michael@320 | 46 | #else |
michael@320 | 47 | #define TARGET_LD_EMULATION "" |
michael@320 | 48 | #endif |
michael@320 | 49 | Index: gcc/config/i386/sol2.h |
michael@332 | 50 | diff -Nau gcc/config/i386/sol2.h.orig gcc/config/i386/sol2.h |
michael@332 | 51 | --- gcc/config/i386/sol2.h.orig 2011-02-02 17:58:49.000000000 +0100 |
michael@332 | 52 | +++ gcc/config/i386/sol2.h 2011-03-27 18:06:45.458713885 +0200 |
michael@332 | 53 | @@ -73,6 +73,9 @@ |
michael@320 | 54 | #undef ASM_QUAD |
michael@320 | 55 | #endif |
michael@320 | 56 | |
michael@320 | 57 | +#undef DEFAULT_PCC_STRUCT_RETURN |
michael@320 | 58 | +#define DEFAULT_PCC_STRUCT_RETURN 1 |
michael@320 | 59 | + |
michael@320 | 60 | /* The Solaris assembler wants a .local for non-exported aliases. */ |
michael@320 | 61 | #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \ |
michael@320 | 62 | do { \ |
michael@320 | 63 | Index: gcc/config/sol2.h |
michael@332 | 64 | diff -Nau gcc/config/sol2.h.orig gcc/config/sol2.h |
michael@332 | 65 | --- gcc/config/sol2.h.orig 2011-01-26 21:23:17.000000000 +0100 |
michael@332 | 66 | +++ gcc/config/sol2.h 2011-03-27 18:06:45.477952967 +0200 |
michael@332 | 67 | @@ -183,8 +183,8 @@ |
michael@332 | 68 | "%{h*} %{v:-V} \ |
michael@320 | 69 | %{!shared:%{!static:%{rdynamic: " RDYNAMIC_SPEC "}}} \ |
michael@320 | 70 | %{static:-dn -Bstatic} \ |
michael@320 | 71 | - %{shared:-G -dy %{!mimpure-text:-z text}} \ |
michael@320 | 72 | - %{symbolic:-Bsymbolic -G -dy -z text} \ |
michael@320 | 73 | + %{shared:-G -dy} \ |
michael@320 | 74 | + %{symbolic:-Bsymbolic -G -dy} \ |
michael@320 | 75 | %(link_arch) \ |
michael@320 | 76 | %{Qy:} %{!Qn:-Qy}" |
michael@320 | 77 | |
michael@320 | 78 | Index: gcc/system.h |
michael@332 | 79 | diff -Nau gcc/system.h.orig gcc/system.h |
michael@332 | 80 | --- gcc/system.h.orig 2011-01-09 13:41:33.000000000 +0100 |
michael@332 | 81 | +++ gcc/system.h 2011-03-27 18:06:45.498233251 +0200 |
michael@332 | 82 | @@ -430,10 +430,6 @@ |
michael@320 | 83 | extern char *strstr (const char *, const char *); |
michael@320 | 84 | #endif |
michael@320 | 85 | |
michael@320 | 86 | -#ifdef HAVE_MALLOC_H |
michael@320 | 87 | -#include <malloc.h> |
michael@320 | 88 | -#endif |
michael@320 | 89 | - |
michael@320 | 90 | #if defined (HAVE_DECL_MALLOC) && !HAVE_DECL_MALLOC |
michael@320 | 91 | extern void *malloc (size_t); |
michael@320 | 92 | #endif |
michael@320 | 93 | Index: libcpp/charset.c |
michael@332 | 94 | diff -Nau libcpp/charset.c.orig libcpp/charset.c |
michael@332 | 95 | --- libcpp/charset.c.orig 2011-01-03 21:52:22.000000000 +0100 |
michael@332 | 96 | +++ libcpp/charset.c 2011-03-27 18:06:45.522800310 +0200 |
michael@320 | 97 | @@ -75,6 +75,7 @@ |
michael@320 | 98 | #define iconv_open(x, y) (errno = EINVAL, (iconv_t)-1) |
michael@320 | 99 | #define iconv(a,b,c,d,e) (errno = EINVAL, (size_t)-1) |
michael@320 | 100 | #define iconv_close(x) (void)0 |
michael@320 | 101 | +#undef ICONV_CONST |
michael@320 | 102 | #define ICONV_CONST |
michael@320 | 103 | #endif |
michael@320 | 104 | |
michael@320 | 105 | Index: libcpp/internal.h |
michael@332 | 106 | diff -Nau libcpp/internal.h.orig libcpp/internal.h |
michael@332 | 107 | --- libcpp/internal.h.orig 2010-09-29 20:18:38.000000000 +0200 |
michael@332 | 108 | +++ libcpp/internal.h 2011-03-27 18:06:45.537431542 +0200 |
michael@320 | 109 | @@ -29,6 +29,7 @@ |
michael@320 | 110 | #if HAVE_ICONV |
michael@320 | 111 | #include <iconv.h> |
michael@320 | 112 | #else |
michael@320 | 113 | +#undef HAVE_ICONV |
michael@320 | 114 | #define HAVE_ICONV 0 |
michael@320 | 115 | typedef int iconv_t; /* dummy */ |
michael@320 | 116 | #endif |