[haiku-commits] BRANCH xyzzy-github.x86_64 - src/bin/coreutils/lib

  • From: xyzzy-github.x86_64 <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 14 Aug 2012 12:49:21 +0200 (CEST)

added 1 changeset to branch 'refs/remotes/xyzzy-github/x86_64'
old head: efffcb292feee3c2db4814d7e414910fe91876d9
new head: b067b2878bc1f74c9f0d2f60b3d702830e61e8b2

----------------------------------------------------------------------------

b067b28: Fix expr from coreutils on x86_64.
  
  The coreutils sources get built against the regex.h included with
  coreutils, but linked against the regex implementation in libroot. Some
  of the types used by coreutils' regex implementation differ from those
  in libroot's on 64-bit platforms meaning they are incompatible. Fixed by
  building coreutils' own regex implementation rather than linking to
  libroot's (GCC 2 still uses libroot though, coreutils' implementation
  doesn't build with GCC 2).

                                      [ Alex Smith <alex@xxxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Commit:      b067b2878bc1f74c9f0d2f60b3d702830e61e8b2

Author:      Alex Smith <alex@xxxxxxxxxxxxxxxx>
Date:        Tue Aug 14 10:08:21 2012 UTC

----------------------------------------------------------------------------

2 files changed, 28 insertions(+), 5 deletions(-)
src/bin/coreutils/lib/Jamfile  |   16 ++++++++++++++--
src/bin/coreutils/lib/stdint.h |   17 ++++++++++++++---

----------------------------------------------------------------------------

diff --git a/src/bin/coreutils/lib/Jamfile b/src/bin/coreutils/lib/Jamfile
index 0c8785c..76bc1ff 100644
--- a/src/bin/coreutils/lib/Jamfile
+++ b/src/bin/coreutils/lib/Jamfile
@@ -9,7 +9,7 @@ SubDirCcFlags -DHAVE_CONFIG_H 
-DB_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT ;
 SubDirSysHdrs $(SUBDIR) ;
 #SubDirSysHdrs $(SUBDIR) $(DOTDOT) ;
 
-StaticLibrary libfetish.a :
+local libSources =
 #      __fpending.c
 #      acl.c
 #      alloca.c
@@ -167,7 +167,6 @@ StaticLibrary libfetish.a :
        readtokens.c
        readtokens0.c
 #      realloc.c
-#      regex.c
        rename.c
        root-dev-ino.c
 #      rmdir.c
@@ -243,4 +242,17 @@ StaticLibrary libfetish.a :
        yesno.c
 ;
 
+# For non-GCC 2 builds use the included regex implementation. The sources get
+# built against the included regex.h rather than the one from libroot. On
+# 32-bit this isn't problematic as they're compatible, but they are not for 64.
+# GCC 2 cannot compile the included implementation, so just link to libroot's
+# one there.
+if $(HAIKU_GCC_VERSION[1]) != 2 {
+       libSources += regex.c ;
+}
+
+StaticLibrary libfetish.a :
+       $(libSources)
+;
+
 SEARCH on [ FGristFiles u8-uctomb.c u8-uctomb-aux.c ] = [ FDirName $(SUBDIR) 
unistr ] ;
diff --git a/src/bin/coreutils/lib/stdint.h b/src/bin/coreutils/lib/stdint.h
index c8802b1..f14ef4b 100644
--- a/src/bin/coreutils/lib/stdint.h
+++ b/src/bin/coreutils/lib/stdint.h
@@ -447,10 +447,17 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == 
sizeof (uintmax_t)) -
 #  define PTRDIFF_MAX  _STDINT_MAX (1, 32, 0)
 # endif
 #else
-# define PTRDIFF_MIN  \
+# ifdef __x86_64__
+#  define PTRDIFF_MIN  \
+    _STDINT_MIN (1, 64, 0l)
+#  define PTRDIFF_MAX  \
+    _STDINT_MAX (1, 64, 0l)
+# else
+#  define PTRDIFF_MIN  \
     _STDINT_MIN (1, 32, 0l)
-# define PTRDIFF_MAX  \
+#  define PTRDIFF_MAX  \
     _STDINT_MAX (1, 32, 0l)
+# endif
 #endif
 
 /* sig_atomic_t limits */
@@ -473,7 +480,11 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == 
sizeof (uintmax_t)) -
 #  define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)
 # endif
 #else
-# define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)
+# ifdef __x86_64__
+#  define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)
+# else
+#  define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)
+# endif
 #endif
 
 /* wchar_t limits */


Other related posts:

  • » [haiku-commits] BRANCH xyzzy-github.x86_64 - src/bin/coreutils/lib - xyzzy-github . x86_64