postgresql/postgresql.patch

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
child 699
da76d565ccd3
permissions
-rw-r--r--

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: src/Makefile.shlib
     2 --- src/Makefile.shlib.orig	2010-07-06 05:55:33.000000000 +0200
     3 +++ src/Makefile.shlib	2010-09-21 08:58:56.000000000 +0200
     4 @@ -329,7 +329,7 @@
     6  .PHONY: all-lib all-static-lib all-shared-lib
     8 -all-lib: all-shared-lib
     9 +all-lib:
    10  ifdef soname
    11  # no static library when building a dynamically loadable module
    12  all-lib: all-static-lib
    13 Index: src/backend/Makefile
    14 --- src/backend/Makefile.orig	2010-07-05 20:54:37.000000000 +0200
    15 +++ src/backend/Makefile	2010-09-21 08:58:56.000000000 +0200
    16 @@ -41,7 +41,7 @@
    17  LIBS := $(filter-out -lpgport, $(LIBS)) $(LDAP_LIBS_BE)
    19  # The backend doesn't need everything that's in LIBS, however
    20 -LIBS := $(filter-out -lz -lreadline -ledit -ltermcap -lncurses -lcurses, $(LIBS))
    21 +LIBS := $(filter-out -lreadline -ledit -ltermcap -lncurses -lcurses, $(LIBS))
    23  ##########################################################################
    25 Index: src/include/port.h
    26 --- src/include/port.h.orig	2010-05-15 16:44:13.000000000 +0200
    27 +++ src/include/port.h	2010-09-21 08:58:56.000000000 +0200
    28 @@ -374,7 +374,7 @@
    29  extern int	getopt(int nargc, char *const * nargv, const char *ostr);
    30  #endif
    32 -#ifndef HAVE_ISINF
    33 +#if !defined(HAVE_ISINF) && !defined(__FreeBSD__)
    34  extern int	isinf(double x);
    35  #endif
    37 Index: src/makefiles/Makefile.freebsd
    38 --- src/makefiles/Makefile.freebsd.orig	2010-07-05 20:54:38.000000000 +0200
    39 +++ src/makefiles/Makefile.freebsd	2010-09-21 09:00:42.000000000 +0200
    40 @@ -17,7 +17,7 @@
    41  # Rule for building a shared library from a single .o file
    42  %.so: %.o
    43  ifdef ELF_SYSTEM
    44 -	$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
    45 +	$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $< $(SHLIB_LINK)
    46  else
    47  	$(LD) $(LDREL) $(LDOUT) $<.obj -x $<
    48  	@echo building shared object $@
    49 Index: src/makefiles/Makefile.linux
    50 --- src/makefiles/Makefile.linux.orig	2010-07-05 20:54:38.000000000 +0200
    51 +++ src/makefiles/Makefile.linux	2010-09-21 09:01:01.000000000 +0200
    52 @@ -14,4 +14,4 @@
    54  # Rule for building a shared library from a single .o file
    55  %.so: %.o
    56 -	$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
    57 +	$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $< $(SHLIB_LINK)
    58 Index: src/makefiles/Makefile.solaris
    59 --- src/makefiles/Makefile.solaris.orig	2010-07-05 20:54:38.000000000 +0200
    60 +++ src/makefiles/Makefile.solaris	2010-09-21 09:01:22.000000000 +0200
    61 @@ -19,9 +19,9 @@
    62  # Rule for building a shared library from a single .o file
    63  %.so: %.o
    64  ifeq ($(GCC), yes)
    65 -	$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
    66 +	$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $< $(SHLIB_LINK)
    67  else
    68 -	$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -G -o $@ $<
    69 +	$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -G -o $@ $< $(SHLIB_LINK)
    70  endif
    72  sqlmansect = 5sql

mercurial