1
0

i686_define_bug.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Fix for compiling glibc with -march=i686 specified.
  2. The patch below found at: http://permalink.gmane.org/gmane.linux.lfs.devel/9758,
  3. a nice discussion (with a comment of the glibc maintainer) can be found here:
  4. http://old.nabble.com/-RFC-PATCH--glibc-doesn%27t-build-with-%22gcc--march%3Di686%22-td17442608.html
  5. To me, this simply shows once more how fucked up things can be. E.g. the (related) bug report here:
  6. http://bugs.gentoo.org/show_bug.cgi?id=201815. There are lots of duplicates to it, many people are
  7. affected, one can find really elaborate reports. And the responsible gentoo developers are too
  8. elite to even point to the actual patch fixing the issue.
  9. diff -Naur glibc-2.11.1-orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c
  10. --- glibc-2.11.1-orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08 20:10:20.000000000 +0000
  11. +++ glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c 2010-04-17 02:24:02.000000000 +0100
  12. @@ -45,6 +45,11 @@
  13. /* Embed an #include to pull in the alignment and .end directives. */
  14. asm ("\n#include \"defs.h\"");
  15. +asm ("\n#if defined __i686 && defined __ASSEMBLER__");
  16. +asm ("\n#undef __i686");
  17. +asm ("\n#define __i686 __i686");
  18. +asm ("\n#endif");
  19. +
  20. /* The initial common code ends here. */
  21. asm ("\n/*@HEADER_ENDS*/");
  22. diff -Naur glibc-2.11.1-orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h
  23. --- glibc-2.11.1-orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08 20:10:20.000000000 +0000
  24. +++ glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-04-17 02:24:02.000000000 +0100
  25. @@ -29,6 +29,10 @@
  26. #include <dl-sysdep.h>
  27. #include <tls.h>
  28. +#if defined __i686 && defined __ASSEMBLER__
  29. +#undef __i686
  30. +#define __i686 __i686
  31. +#endif
  32. /* For Linux we can use the system call table in the header file
  33. /usr/include/asm/unistd.h