This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] glibc 2.7 compilation failure with GCC 4.2.x due to 486+-specific memmove() redeclaration and _FORTIFY_SOURCEry


On 29 Oct 2007, Mike Frysinger uttered the following:

> On Monday 29 October 2007, Nix wrote:
>> CONFIGURE=$1
>> shift
>> $CONFIGURE --build=i686-pc-linux-gnu "$@"
>
> dunno man ... i have CFLAGS="-O2 -march=i686" and targetting i686-pc-linux-gnu 
> and it builds for me.

Maybe this is a GCC version thing? Are you building with 4.2.x?

The behaviour of inlines has changed in 4.3.x (but not, one would have thought,
so much that redefining inlines with completely different definitions would
be acceptable).

>                        but i'm not doubting you as the people reported your 
> same failure and said your patch fixed things for them ;)

If it's helped people then my purpose in posting this patch is achieved :)

>> --build-id and --as-needed by default at link time, and the latter at
>> least is bad for the glibc testsuite. I have patches to allow glibc to
>> build with a default-on --build-id, if you want them, but they're so
>> trivial I thought nobody would care...)
>
> i'd check cvs head and if it's still broken, post the patch

Checked with a tree pristine except for the following utterly trivial
patch (provided for completeness), which I need in order for configure
to run at all, because my installed Linux headers are stowed like
everything else and thus are expected to be symlinks. (Also the check
might be considered wrong: `make install' won't destroy the target of
the symlinks if you install in the recommended way, by `make install
install_root=somewhere-else' and then using your packaging system to
move it into place. It will if you just use `make install', but hasn't
Ulrich said over and over again that anyone doing that deserves what
they get?):

Index: sysdeps/unix/sysv/linux/configure
===================================================================
--- sysdeps/unix/sysv/linux/configure.orig	2006-10-28 20:36:53.000000000 +0100
+++ sysdeps/unix/sysv/linux/configure	2007-09-21 19:35:21.000000000 +0100
@@ -324,42 +324,6 @@
 esac
 
 
-if test $host = $build; then
-  # If $prefix/include/{net,scsi} are symlinks, make install will
-  # clobber what they're linked to (probably a kernel tree).
-  # test -L ought to work on all Linux boxes.
-  if test "x$prefix" != xNONE; then
-    ac_prefix=$prefix
-  else
-    ac_prefix=$ac_default_prefix
-  fi
-  echo "$as_me:$LINENO: checking for symlinks in ${ac_prefix}/include" >&5
-echo $ECHO_N "checking for symlinks in ${ac_prefix}/include... $ECHO_C" >&6
-  ac_message=
-  if test -L ${ac_prefix}/include/net; then
-    ac_message="$ac_message
-   ${ac_prefix}/include/net is a symlink"
-  fi
-  if test -L ${ac_prefix}/include/scsi; then
-    ac_message="$ac_message
-   ${ac_prefix}/include/scsi is a symlink"
-  fi
-  if test -n "$ac_message"; then
-    { { echo "$as_me:$LINENO: error: $ac_message
-\`make install' will destroy the target of the link(s).
-Delete the links and re-run configure, or better still, move the entire
-${ac_prefix}/include directory out of the way." >&5
-echo "$as_me: error: $ac_message
-\`make install' will destroy the target of the link(s).
-Delete the links and re-run configure, or better still, move the entire
-${ac_prefix}/include directory out of the way." >&2;}
-   { (exit 1); exit 1; }; }
-  else
-    echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6
-  fi
-fi
-
 # We have inlined syscalls.
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_INLINED_SYSCALLS 1

Anyway, here's the patch again: it applies to HEAD without slop.

2007-10-21  Nix  <nix@esperi.org.uk>

	* sysdeps/i386/i486/bits/string.h (memmove): New macro.
	Function of that name renamed to...
	* sysdeps/i386/i486/bits/string.h (__memmove_g): ... this.

Index: libc-patched/sysdeps/i386/i486/bits/string.h
===================================================================
--- libc-patched.orig/sysdeps/i386/i486/bits/string.h	2007-10-20 19:46:17.000000000 +0100
+++ libc-patched/sysdeps/i386/i486/bits/string.h	2007-10-21 17:31:06.000000000 +0100
@@ -143,10 +143,13 @@
 
 #define _HAVE_STRING_ARCH_memmove 1
 #ifndef _FORCE_INLINES
+#define memmove(dest, src, n) \
+  __memmove_g ((dest), (src), (n))
+
 /* Copy N bytes of SRC to DEST, guaranteeing
    correct behavior for overlapping strings.  */
 __STRING_INLINE void *
-memmove (void *__dest, __const void *__src, size_t __n)
+__memmove_g (void *__dest, __const void *__src, size_t __n)
 {
   register unsigned long int __d0, __d1, __d2;
   register void *__tmp = __dest;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]