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.
1 Index: include/sswf/libsswf.h
2 --- include/sswf/libsswf.h.orig 2008-06-23 07:51:47 +0200
3 +++ include/sswf/libsswf.h 2008-06-23 18:10:33 +0200
4 @@ -71,12 +71,14 @@
5 /* wint_t is an "equivalent" to wchar_t without being limited to 16 bits as on MS-Windows */
6 #ifndef _MSVC
7 #ifndef __APPLE_CC__
8 +#ifndef __FreeBSD__
9 #ifndef _WINT_T
10 #define _WINT_T
11 typedef unsigned int wint_t;
12 #endif
13 #endif
14 #endif
15 +#endif
17 #ifndef M_PI
18 #define M_PI 3.14159265358979323846
19 @@ -88,7 +90,7 @@
20 #define rint(x) ((double) (long) floor(x + 0.5))
21 #endif
23 -#ifdef _LIBICONV_H
24 +#if defined(_LIBICONV_H) && !defined(__FreeBSD__)
25 #define ICONV_INPUT_CAST
26 #else
27 /* older versions of iconv() were broken in regard to the
28 Index: include/sswf/libsswf_c.h
29 --- include/sswf/libsswf_c.h.orig 2008-06-23 07:51:47 +0200
30 +++ include/sswf/libsswf_c.h 2008-06-23 18:10:33 +0200
31 @@ -38,7 +38,7 @@
33 #include <stdlib.h>
34 #include <stdarg.h>
35 -#if IRIX
36 +#if IRIX || defined(__FreeBSD__)
37 #include <inttypes.h>
38 #endif
39 #include <sswf/libsswf-config.h>
40 Index: src/lib/libsswf_tag_header.c++
41 --- src/lib/libsswf_tag_header.c++.orig 2009-02-25 11:44:25.018888440 +0100
42 +++ src/lib/libsswf_tag_header.c++ 2009-02-25 12:03:04.998881702 +0100
43 @@ -745,7 +745,7 @@
44 }
45 #endif
47 - r = (int) iconv(f_iconvertor, ICONV_INPUT_CAST &string, &in, &p, &out);
48 + r = (int) iconv(f_iconvertor, ICONV_INPUT_CAST const_cast<char **>(&string), &in, &p, &out);
49 if(r < 0) {
50 if(s != buf) {
51 MemFree(s);
52 Index: src/lib/sswf_lexical.c++
53 --- src/sswf/sswf_lexical.c++.orig 2008-06-23 07:51:47.000000000 +0200
54 +++ src/sswf/sswf_lexical.c++ 2009-02-25 12:06:36.214881561 +0100
55 @@ -2026,7 +2026,7 @@
56 out = sizeof(outchar);
57 output = (char *) &outchar;
58 b = (int) f_mb_count;
59 - a = (int) iconv(f_iconvertor, ICONV_INPUT_CAST &input, &f_mb_count, &output, &out);
60 + a = (int) iconv(f_iconvertor, ICONV_INPUT_CAST const_cast<char **>(&input), &f_mb_count, &output, &out);
61 // the output buffer will usually be full before the
62 // input is fully emptied!
63 if(a < 0 && errno == E2BIG && out == 0 && b != (int) f_mb_count) {