db/db.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
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.

michael@121 1 Index: mutex/mut_fcntl.c
michael@121 2 --- mutex/mut_fcntl.c.orig 2008-01-08 21:58:43 +0100
michael@121 3 +++ mutex/mut_fcntl.c 2008-05-26 22:36:45 +0200
michael@121 4 @@ -84,7 +84,7 @@
michael@121 5
michael@121 6 /* Acquire an exclusive kernel lock. */
michael@121 7 k_lock.l_type = F_WRLCK;
michael@121 8 - if (fcntl(env->lockfhp->fd, F_SETLKW, &k_lock))
michael@121 9 + if (fcntl(env->lockfhp->fd, F_SETLKW, &k_lock) == -1)
michael@121 10 goto err;
michael@121 11
michael@121 12 /* If the resource is still available, it's ours. */
michael@121 13 @@ -97,7 +97,7 @@
michael@121 14
michael@121 15 /* Release the kernel lock. */
michael@121 16 k_lock.l_type = F_UNLCK;
michael@121 17 - if (fcntl(env->lockfhp->fd, F_SETLK, &k_lock))
michael@121 18 + if (fcntl(env->lockfhp->fd, F_SETLK, &k_lock) == -1)
michael@121 19 goto err;
michael@121 20
michael@121 21 /*
michael@121 22 Index: os/os_open.c
michael@121 23 --- os/os_open.c.orig 2008-03-26 05:11:35 +0100
michael@121 24 +++ os/os_open.c 2008-05-26 22:36:05 +0200
michael@121 25 @@ -67,7 +67,7 @@
michael@121 26 if (LF_ISSET(DB_OSO_EXCL))
michael@121 27 oflags |= O_EXCL;
michael@121 28
michael@121 29 -#ifdef HAVE_O_DIRECT
michael@121 30 +#if defined(HAVE_O_DIRECT) && defined(__FreeBSD__)
michael@121 31 if (LF_ISSET(DB_OSO_DIRECT))
michael@121 32 oflags |= O_DIRECT;
michael@121 33 #endif

mercurial