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).
This commit is contained in:
Alex Smith 2012-08-14 11:08:21 +01:00
parent efffcb292f
commit b067b2878b
2 changed files with 28 additions and 5 deletions

View File

@ -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 ] ;

View File

@ -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 */