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]

[PATCH 1/2] Add --with-ilp32-large-off_t


Hi,

On x86-64, ILP32 with large off_t (64-bit) can be either -mx32 or -m32
with "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64".  This patch adds
a configure time option to choose which one to use for ILP32_OFFBIG.
Any comments?

Thanks.


H.J.
----
	[BZ #14200]
	* Makerules (before-compile): Add $(common-objpfx)bits/environments.h.
	(%.in): Add vpath on $(sysdirs).
	($(common-objpfx)bits/environments.h): New rule.
	($(common-objpfx)bits/environments.st): Likewise.
	(common-generated): Add bits/environments.h bits/environments.st.
	* config.make.in (environments_in): New macro.
	* configure.in: Add --with-ilp32-large-off_t.  Set environments_in
	to bits/environments.in if not set.
	* configure: Regenerated.
	* bits/environments.h: Renamed to ...
	* bits/environments.in: This.
	* sysdeps/unix/bsd/bsd4.4/freebsd/bits/environments.h: Renamed 
	to ...
	* sysdeps/unix/bsd/bsd4.4/freebsd/bits/environments.in: This.
	* sysdeps/unix/sysv/linux/powerpc/bits/environments.h: Renamed
	to ...
	* sysdeps/unix/sysv/linux/powerpc/bits/environments.in: This.
	* sysdeps/unix/sysv/linux/s390/bits/environments.h: Renamed to ...
	* sysdeps/unix/sysv/linux/s390/bits/environments.in: This.
	* sysdeps/unix/sysv/linux/sparc/bits/environments.h: Renamed to ...
	* sysdeps/unix/sysv/linux/sparc/bits/environments.in: This.
	* sysdeps/unix/sysv/linux/x86/bits/environments.h: Renamed to
	...
	* sysdeps/unix/sysv/linux/x86/bits/environments-m32.in: This.
	(_POSIX_V7_ILP32_OFF32): Defined as 1 only if __x86_64__ isn't
	defined.
	(_POSIX_V6_ILP32_OFF32): Likewise.
	(_XBS5_ILP32_OFF32): Likewise.
	* sysdeps/unix/sysv/linux/i386/configure: New file.
	* sysdeps/unix/sysv/linux/x86/bits/environments-mx32.in: Likewise.
	* sysdeps/unix/sysv/linux/x86/configure: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/configure: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/configure: Default to mx32
	for ilp32_large_off_t.

diff --git a/Makerules b/Makerules
index 685b1b8..6abbf93 100644
--- a/Makerules
+++ b/Makerules
@@ -1254,6 +1254,17 @@ ifndef no_deps
 -include $(stdio_lim:h=d)
 endif
 common-generated += bits/stdio_lim.h bits/stdio_lim.d bits/stdio_lim.st
+
+before-compile += $(common-objpfx)bits/environments.h
+vpath %.in $(sysdirs)
+$(common-objpfx)bits/environments.h: $(common-objpfx)bits/environments.st; @:
+$(common-objpfx)bits/environments.st: $(environments_in)
+	$(make-target-directory)
+	$(INSTALL_DATA) $< ${@:st=T}
+	$(move-if-change) ${@:st=T} ${@:st=h}
+	touch $@
+
+common-generated += bits/environments.h bits/environments.st
 
 FORCE:
 
diff --git a/bits/environments.h b/bits/environments.h
deleted file mode 100644
index eff32b3..0000000
--- a/bits/environments.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Copyright (C) 1999, 2001, 2004, 2009 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _UNISTD_H
-# error "Never include this file directly.  Use <unistd.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-/* This header should define the following symbols under the described
-   situations.  A value `1' means that the model is always supported,
-   `-1' means it is never supported.  Undefined means it cannot be
-   statically decided.
-
-   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
-   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
-
-   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
-   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
-
-   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
-   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
-   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
-   used in previous versions of the Unix standard and are available
-   only for compatibility.
-*/
-
-#if __WORDSIZE == 64
-
-/* We can never provide environments with 32-bit wide pointers.  */
-# define _POSIX_V7_ILP32_OFF32	-1
-# define _POSIX_V7_ILP32_OFFBIG	-1
-# define _POSIX_V6_ILP32_OFF32	-1
-# define _POSIX_V6_ILP32_OFFBIG	-1
-# define _XBS5_ILP32_OFF32	-1
-# define _XBS5_ILP32_OFFBIG	-1
-/* We also have no use (for now) for an environment with bigger pointers
-   and offsets.  */
-# define _POSIX_V7_LPBIG_OFFBIG	-1
-# define _POSIX_V6_LPBIG_OFFBIG	-1
-# define _XBS5_LPBIG_OFFBIG	-1
-
-/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
-# define _POSIX_V7_LP64_OFF64	1
-# define _POSIX_V6_LP64_OFF64	1
-# define _XBS5_LP64_OFF64	1
-
-#else /* __WORDSIZE == 32 */
-
-/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
-   and all platforms support LFS.  */
-# define _POSIX_V7_ILP32_OFF32	1
-# define _POSIX_V7_ILP32_OFFBIG	1
-# define _POSIX_V6_ILP32_OFF32	1
-# define _POSIX_V6_ILP32_OFFBIG	1
-# define _XBS5_ILP32_OFF32	1
-# define _XBS5_ILP32_OFFBIG	1
-
-/* We optionally provide an environment with the above size but an 64-bit
-   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
-
-/* We can never provide environments with 64-bit wide pointers.  */
-# define _POSIX_V7_LP64_OFF64	-1
-# define _POSIX_V7_LPBIG_OFFBIG	-1
-# define _POSIX_V6_LP64_OFF64	-1
-# define _POSIX_V6_LPBIG_OFFBIG	-1
-# define _XBS5_LP64_OFF64	-1
-# define _XBS5_LPBIG_OFFBIG	-1
-
-/* CFLAGS.  */
-#define __ILP32_OFFBIG_CFLAGS   "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
-
-#endif /* __WORDSIZE == 32 */
diff --git a/bits/environments.in b/bits/environments.in
new file mode 100644
index 0000000..eff32b3
--- /dev/null
+++ b/bits/environments.in
@@ -0,0 +1,87 @@
+/* Copyright (C) 1999, 2001, 2004, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
+   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
+
+   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
+   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
+   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
+   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
+   used in previous versions of the Unix standard and are available
+   only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* We can never provide environments with 32-bit wide pointers.  */
+# define _POSIX_V7_ILP32_OFF32	-1
+# define _POSIX_V7_ILP32_OFFBIG	-1
+# define _POSIX_V6_ILP32_OFF32	-1
+# define _POSIX_V6_ILP32_OFFBIG	-1
+# define _XBS5_ILP32_OFF32	-1
+# define _XBS5_ILP32_OFFBIG	-1
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
+# define _POSIX_V7_LP64_OFF64	1
+# define _POSIX_V6_LP64_OFF64	1
+# define _XBS5_LP64_OFF64	1
+
+#else /* __WORDSIZE == 32 */
+
+/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
+   and all platforms support LFS.  */
+# define _POSIX_V7_ILP32_OFF32	1
+# define _POSIX_V7_ILP32_OFFBIG	1
+# define _POSIX_V6_ILP32_OFF32	1
+# define _POSIX_V6_ILP32_OFFBIG	1
+# define _XBS5_ILP32_OFF32	1
+# define _XBS5_ILP32_OFFBIG	1
+
+/* We optionally provide an environment with the above size but an 64-bit
+   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
+
+/* We can never provide environments with 64-bit wide pointers.  */
+# define _POSIX_V7_LP64_OFF64	-1
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LP64_OFF64	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LP64_OFF64	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* CFLAGS.  */
+#define __ILP32_OFFBIG_CFLAGS   "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+
+#endif /* __WORDSIZE == 32 */
diff --git a/config.make.in b/config.make.in
index 65410ab..8c18512 100644
--- a/config.make.in
+++ b/config.make.in
@@ -78,6 +78,8 @@ oldest-abi = @oldest_abi@
 exceptions = @exceptions@
 multi-arch = @multi_arch@
 
+environments_in = @environments_in@
+
 mach-interface-list = @mach_interface_list@
 
 have-bash2 = @libc_cv_have_bash2@
diff --git a/configure b/configure
index aa7869f..9792377 100755
--- a/configure
+++ b/configure
@@ -598,6 +598,7 @@ libc_cv_localedir
 libc_cv_slibdir
 old_glibc_headers
 libc_cv_gcc_unwind_find_fde
+environments_in
 libc_extra_cflags
 CPPUNDEFS
 sizeof_long_double
@@ -750,6 +751,7 @@ enable_nss_crypt
 enable_obsolete_rpc
 enable_systemtap
 with_cpu
+with_ilp32_large_off_t
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1421,6 +1423,8 @@ Optional Packages:
                           /usr/src/linux/include) [default=compiler default]
   --with-default-link     do not use explicit linker scripts
   --with-cpu=CPU          select code for CPU variant
+  --with-ilp32-large-off_t=option
+                          select ILP32 option for large off_t
 
 Some influential environment variables:
   CC          C compiler command
@@ -3810,6 +3814,19 @@ if test "${with_cpu+set}" = set; then :
 fi
 
 
+ilp32_large_off_t=
+
+# Check whether --with-ilp32-large-off_t was given.
+if test "${with_ilp32_large_off_t+set}" = set; then :
+  withval=$with_ilp32_large_off_t;   case "$withval" in
+  yes|'') as_fn_error $? "--with-ilp32-large-off_t requires an argument" "$LINENO" 5 ;;
+  no) ;;
+  *) ilp32_large_off_t="$withval" ;;
+  esac
+
+fi
+
+
 if frags=`ls -d $srcdir/sysdeps/*/preconfigure 2> /dev/null`
 then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysdeps preconfigure fragments" >&5
@@ -7467,6 +7484,17 @@ $as_echo "running configure fragment for $dir" >&6; }
   fi
 done
 
+# Check ilp32_large_off_t after all configure fragments have been
+# processed.
+if test -n "$ilp32_large_off_t"; then
+  if test -z "$ilp32_large_off_t_used"; then
+    as_fn_error $? "The $ilp32_large_off_t ILP32 large off_t option of $host_cpu is not supported." "$LINENO" 5
+  fi
+else
+  environments_in=bits/environments.in
+fi
+
+
 if test x$libc_cv_gcc_unwind_find_fde = xyes; then
   $as_echo "#define EXPORT_UNWIND_FIND_FDE 1" >>confdefs.h
 
diff --git a/configure.in b/configure.in
index 5028e64..646fea0 100644
--- a/configure.in
+++ b/configure.in
@@ -349,6 +349,18 @@ AC_ARG_WITH([cpu],
   esac
 ])
 
+ilp32_large_off_t=
+AC_ARG_WITH([ilp32-large-off_t],
+	    AS_HELP_STRING([--with-ilp32-large-off_t=option],
+			   [select ILP32 option for large off_t]),
+	    [dnl
+  case "$withval" in
+  yes|'') AC_MSG_ERROR([--with-ilp32-large-off_t requires an argument]) ;;
+  no) ;;
+  *) ilp32_large_off_t="$withval" ;;
+  esac
+])
+
 dnl Let sysdeps/*/preconfigure act here, like they can in add-ons.
 LIBC_PRECONFIGURE([$srcdir], [for sysdeps])
 
@@ -2136,6 +2148,17 @@ for dir in $sysnames; do
   fi
 done
 
+# Check ilp32_large_off_t after all configure fragments have been
+# processed.
+if test -n "$ilp32_large_off_t"; then
+  if test -z "$ilp32_large_off_t_used"; then
+    AC_MSG_ERROR(The $ilp32_large_off_t ILP32 large off_t option of $host_cpu is not supported.)
+  fi
+else
+  environments_in=bits/environments.in
+fi
+AC_SUBST(environments_in)
+
 if test x$libc_cv_gcc_unwind_find_fde = xyes; then
   AC_DEFINE(EXPORT_UNWIND_FIND_FDE)
 fi
diff --git a/sysdeps/unix/bsd/bsd4.4/freebsd/bits/environments.h b/sysdeps/unix/bsd/bsd4.4/freebsd/bits/environments.h
deleted file mode 100644
index 9bab1b6..0000000
--- a/sysdeps/unix/bsd/bsd4.4/freebsd/bits/environments.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _UNISTD_H
-# error "Never include this file directly.  Use <unistd.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-/* This header should define the following symbols under the described
-   situations.  A value `1' means that the model is always supported,
-   `-1' means it is never supported.  Undefined means it cannot be
-   statically decided.
-
-   _POSIX_V6_ILP32_OFF32   32bit int, long, pointers, and off_t type
-   _POSIX_V6_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
-
-   _POSIX_V6_LP64_OFF32	   64bit long and pointers and 32bit off_t type
-   _POSIX_V6_LPBIG_OFFBIG  64bit long and pointers and large off_t type
-
-   The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and
-   _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard
-   and are available only for compatibility.
-*/
-
-#if __WORDSIZE == 64
-
-/* We can never provide environments with 32-bit wide pointers.  */
-# define _POSIX_V6_ILP32_OFF32	-1
-# define _POSIX_V6_ILP32_OFFBIG	-1
-# define _XBS5_ILP32_OFF32	-1
-# define _XBS5_ILP32_OFFBIG	-1
-/* We also have no use (for now) for an environment with bigger pointers
-   and offsets.  */
-# define _POSIX_V6_LPBIG_OFFBIG	-1
-# define _XBS5_LPBIG_OFFBIG	-1
-
-/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
-# define _POSIX_V6_LP64_OFF64	1
-# define _XBS5_LP64_OFF64	1
-
-#else /* __WORDSIZE == 32 */
-
-/* By default we have 32-bit wide `int', `long int', pointers
-   and 64-bit `off_t'.  */
-# define _POSIX_V6_ILP32_OFF32	-1
-# define _POSIX_V6_ILP32_OFFBIG	1
-# define _XBS5_ILP32_OFF32	-1
-# define _XBS5_ILP32_OFFBIG	1
-
-/* We can never provide environments with 64-bit wide pointers.  */
-# define _POSIX_V6_LP64_OFF64	-1
-# define _POSIX_V6_LPBIG_OFFBIG	-1
-# define _XBS5_LP64_OFF64	-1
-# define _XBS5_LPBIG_OFFBIG	-1
-
-#endif /* __WORDSIZE == 32 */
diff --git a/sysdeps/unix/bsd/bsd4.4/freebsd/bits/environments.in b/sysdeps/unix/bsd/bsd4.4/freebsd/bits/environments.in
new file mode 100644
index 0000000..9bab1b6
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/freebsd/bits/environments.in
@@ -0,0 +1,71 @@
+/* Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _POSIX_V6_ILP32_OFF32   32bit int, long, pointers, and off_t type
+   _POSIX_V6_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
+
+   _POSIX_V6_LP64_OFF32	   64bit long and pointers and 32bit off_t type
+   _POSIX_V6_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and
+   _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard
+   and are available only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* We can never provide environments with 32-bit wide pointers.  */
+# define _POSIX_V6_ILP32_OFF32	-1
+# define _POSIX_V6_ILP32_OFFBIG	-1
+# define _XBS5_ILP32_OFF32	-1
+# define _XBS5_ILP32_OFFBIG	-1
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
+# define _POSIX_V6_LP64_OFF64	1
+# define _XBS5_LP64_OFF64	1
+
+#else /* __WORDSIZE == 32 */
+
+/* By default we have 32-bit wide `int', `long int', pointers
+   and 64-bit `off_t'.  */
+# define _POSIX_V6_ILP32_OFF32	-1
+# define _POSIX_V6_ILP32_OFFBIG	1
+# define _XBS5_ILP32_OFF32	-1
+# define _XBS5_ILP32_OFFBIG	1
+
+/* We can never provide environments with 64-bit wide pointers.  */
+# define _POSIX_V6_LP64_OFF64	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LP64_OFF64	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+#endif /* __WORDSIZE == 32 */
diff --git a/sysdeps/unix/sysv/linux/i386/configure b/sysdeps/unix/sysv/linux/i386/configure
new file mode 100644
index 0000000..ea396d5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/configure
@@ -0,0 +1,3 @@
+# Local configure fragment for sysdeps/unix/sysv/linux/x86_64
+
+. $srcdir/sysdeps/unix/sysv/linux/x86/configure
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/environments.h b/sysdeps/unix/sysv/linux/powerpc/bits/environments.h
deleted file mode 100644
index 793a04f..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/bits/environments.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Copyright (C) 1999, 2001, 2004, 2009 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _UNISTD_H
-# error "Never include this file directly.  Use <unistd.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-/* This header should define the following symbols under the described
-   situations.  A value `1' means that the model is always supported,
-   `-1' means it is never supported.  Undefined means it cannot be
-   statically decided.
-
-   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
-   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
-
-   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
-   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
-
-   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
-   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
-   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
-   used in previous versions of the Unix standard and are available
-   only for compatibility.
-*/
-
-#if __WORDSIZE == 64
-
-/* Environments with 32-bit wide pointers are optionally provided.
-   Therefore following macros aren't defined:
-   # undef _POSIX_V7_ILP32_OFF32
-   # undef _POSIX_V7_ILP32_OFFBIG
-   # undef _POSIX_V6_ILP32_OFF32
-   # undef _POSIX_V6_ILP32_OFFBIG
-   # undef _XBS5_ILP32_OFF32
-   # undef _XBS5_ILP32_OFFBIG
-   and users need to check at runtime.  */
-
-/* We also have no use (for now) for an environment with bigger pointers
-   and offsets.  */
-# define _POSIX_V7_LPBIG_OFFBIG	-1
-# define _POSIX_V6_LPBIG_OFFBIG	-1
-# define _XBS5_LPBIG_OFFBIG	-1
-
-/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
-# define _POSIX_V7_LP64_OFF64	1
-# define _POSIX_V6_LP64_OFF64	1
-# define _XBS5_LP64_OFF64	1
-
-#else /* __WORDSIZE == 32 */
-
-/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
-   and all platforms support LFS.  */
-# define _POSIX_V7_ILP32_OFF32	1
-# define _POSIX_V7_ILP32_OFFBIG	1
-# define _POSIX_V6_ILP32_OFF32	1
-# define _POSIX_V6_ILP32_OFFBIG	1
-# define _XBS5_ILP32_OFF32	1
-# define _XBS5_ILP32_OFFBIG	1
-
-/* We optionally provide an environment with the above size but an 64-bit
-   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
-
-/* Environments with 64-bit wide pointers can be provided,
-   so these macros aren't defined:
-   # undef _POSIX_V7_LP64_OFF64
-   # undef _POSIX_V7_LPBIG_OFFBIG
-   # undef _POSIX_V6_LP64_OFF64
-   # undef _POSIX_V6_LPBIG_OFFBIG
-   # undef _XBS5_LP64_OFF64
-   # undef _XBS5_LPBIG_OFFBIG
-   and sysconf tests for it at runtime.  */
-
-#endif /* __WORDSIZE == 32 */
-
-#define __ILP32_OFF32_CFLAGS	"-m32"
-#define __ILP32_OFFBIG_CFLAGS	"-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
-#define __ILP32_OFF32_LDFLAGS	"-m32"
-#define __ILP32_OFFBIG_LDFLAGS	"-m32"
-#define __LP64_OFF64_CFLAGS	"-m64"
-#define __LP64_OFF64_LDFLAGS	"-m64"
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/environments.in b/sysdeps/unix/sysv/linux/powerpc/bits/environments.in
new file mode 100644
index 0000000..793a04f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/environments.in
@@ -0,0 +1,96 @@
+/* Copyright (C) 1999, 2001, 2004, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
+   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
+
+   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
+   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
+   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
+   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
+   used in previous versions of the Unix standard and are available
+   only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* Environments with 32-bit wide pointers are optionally provided.
+   Therefore following macros aren't defined:
+   # undef _POSIX_V7_ILP32_OFF32
+   # undef _POSIX_V7_ILP32_OFFBIG
+   # undef _POSIX_V6_ILP32_OFF32
+   # undef _POSIX_V6_ILP32_OFFBIG
+   # undef _XBS5_ILP32_OFF32
+   # undef _XBS5_ILP32_OFFBIG
+   and users need to check at runtime.  */
+
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
+# define _POSIX_V7_LP64_OFF64	1
+# define _POSIX_V6_LP64_OFF64	1
+# define _XBS5_LP64_OFF64	1
+
+#else /* __WORDSIZE == 32 */
+
+/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
+   and all platforms support LFS.  */
+# define _POSIX_V7_ILP32_OFF32	1
+# define _POSIX_V7_ILP32_OFFBIG	1
+# define _POSIX_V6_ILP32_OFF32	1
+# define _POSIX_V6_ILP32_OFFBIG	1
+# define _XBS5_ILP32_OFF32	1
+# define _XBS5_ILP32_OFFBIG	1
+
+/* We optionally provide an environment with the above size but an 64-bit
+   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
+
+/* Environments with 64-bit wide pointers can be provided,
+   so these macros aren't defined:
+   # undef _POSIX_V7_LP64_OFF64
+   # undef _POSIX_V7_LPBIG_OFFBIG
+   # undef _POSIX_V6_LP64_OFF64
+   # undef _POSIX_V6_LPBIG_OFFBIG
+   # undef _XBS5_LP64_OFF64
+   # undef _XBS5_LPBIG_OFFBIG
+   and sysconf tests for it at runtime.  */
+
+#endif /* __WORDSIZE == 32 */
+
+#define __ILP32_OFF32_CFLAGS	"-m32"
+#define __ILP32_OFFBIG_CFLAGS	"-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+#define __ILP32_OFF32_LDFLAGS	"-m32"
+#define __ILP32_OFFBIG_LDFLAGS	"-m32"
+#define __LP64_OFF64_CFLAGS	"-m64"
+#define __LP64_OFF64_LDFLAGS	"-m64"
diff --git a/sysdeps/unix/sysv/linux/s390/bits/environments.h b/sysdeps/unix/sysv/linux/s390/bits/environments.h
deleted file mode 100644
index a66371a..0000000
--- a/sysdeps/unix/sysv/linux/s390/bits/environments.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Copyright (C) 1999, 2001, 2004, 2009 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _UNISTD_H
-# error "Never include this file directly.  Use <unistd.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-/* This header should define the following symbols under the described
-   situations.  A value `1' means that the model is always supported,
-   `-1' means it is never supported.  Undefined means it cannot be
-   statically decided.
-
-   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
-   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
-
-   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
-   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
-
-   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
-   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
-   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
-   used in previous versions of the Unix standard and are available
-   only for compatibility.
-*/
-
-#if __WORDSIZE == 64
-
-/* Environments with 32-bit wide pointers are optionally provided.
-   Therefore following macros aren't defined:
-   # undef _POSIX_V7_ILP32_OFF32
-   # undef _POSIX_V7_ILP32_OFFBIG
-   # undef _POSIX_V6_ILP32_OFF32
-   # undef _POSIX_V6_ILP32_OFFBIG
-   # undef _XBS5_ILP32_OFF32
-   # undef _XBS5_ILP32_OFFBIG
-   and users need to check at runtime.  */
-
-/* We also have no use (for now) for an environment with bigger pointers
-   and offsets.  */
-# define _POSIX_V7_LPBIG_OFFBIG	-1
-# define _POSIX_V6_LPBIG_OFFBIG	-1
-# define _XBS5_LPBIG_OFFBIG	-1
-
-/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
-# define _POSIX_V7_LP64_OFF64	1
-# define _POSIX_V6_LP64_OFF64	1
-# define _XBS5_LP64_OFF64	1
-
-#else /* __WORDSIZE == 32 */
-
-/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
-   and all platforms support LFS.  */
-# define _POSIX_V7_ILP32_OFF32	1
-# define _POSIX_V7_ILP32_OFFBIG	1
-# define _POSIX_V6_ILP32_OFF32	1
-# define _POSIX_V6_ILP32_OFFBIG	1
-# define _XBS5_ILP32_OFF32	1
-# define _XBS5_ILP32_OFFBIG	1
-
-/* We optionally provide an environment with the above size but an 64-bit
-   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
-
-/* Environments with 64-bit wide pointers can be provided,
-   so these macros aren't defined:
-   # undef _POSIX_V7_LP64_OFF64
-   # undef _POSIX_V7_LPBIG_OFFBIG
-   # undef _POSIX_V6_LP64_OFF64
-   # undef _POSIX_V6_LPBIG_OFFBIG
-   # undef _XBS5_LP64_OFF64
-   # undef _XBS5_LPBIG_OFFBIG
-   and sysconf tests for it at runtime.  */
-
-#endif /* __WORDSIZE == 32 */
-
-#define __ILP32_OFF32_CFLAGS	"-m31"
-#define __ILP32_OFFBIG_CFLAGS	"-m31 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
-#define __ILP32_OFF32_LDFLAGS	"-m31"
-#define __ILP32_OFFBIG_LDFLAGS	"-m31"
-#define __LP64_OFF64_CFLAGS	"-m64"
-#define __LP64_OFF64_LDFLAGS	"-m64"
diff --git a/sysdeps/unix/sysv/linux/s390/bits/environments.in b/sysdeps/unix/sysv/linux/s390/bits/environments.in
new file mode 100644
index 0000000..a66371a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/bits/environments.in
@@ -0,0 +1,96 @@
+/* Copyright (C) 1999, 2001, 2004, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
+   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
+
+   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
+   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
+   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
+   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
+   used in previous versions of the Unix standard and are available
+   only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* Environments with 32-bit wide pointers are optionally provided.
+   Therefore following macros aren't defined:
+   # undef _POSIX_V7_ILP32_OFF32
+   # undef _POSIX_V7_ILP32_OFFBIG
+   # undef _POSIX_V6_ILP32_OFF32
+   # undef _POSIX_V6_ILP32_OFFBIG
+   # undef _XBS5_ILP32_OFF32
+   # undef _XBS5_ILP32_OFFBIG
+   and users need to check at runtime.  */
+
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
+# define _POSIX_V7_LP64_OFF64	1
+# define _POSIX_V6_LP64_OFF64	1
+# define _XBS5_LP64_OFF64	1
+
+#else /* __WORDSIZE == 32 */
+
+/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
+   and all platforms support LFS.  */
+# define _POSIX_V7_ILP32_OFF32	1
+# define _POSIX_V7_ILP32_OFFBIG	1
+# define _POSIX_V6_ILP32_OFF32	1
+# define _POSIX_V6_ILP32_OFFBIG	1
+# define _XBS5_ILP32_OFF32	1
+# define _XBS5_ILP32_OFFBIG	1
+
+/* We optionally provide an environment with the above size but an 64-bit
+   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
+
+/* Environments with 64-bit wide pointers can be provided,
+   so these macros aren't defined:
+   # undef _POSIX_V7_LP64_OFF64
+   # undef _POSIX_V7_LPBIG_OFFBIG
+   # undef _POSIX_V6_LP64_OFF64
+   # undef _POSIX_V6_LPBIG_OFFBIG
+   # undef _XBS5_LP64_OFF64
+   # undef _XBS5_LPBIG_OFFBIG
+   and sysconf tests for it at runtime.  */
+
+#endif /* __WORDSIZE == 32 */
+
+#define __ILP32_OFF32_CFLAGS	"-m31"
+#define __ILP32_OFFBIG_CFLAGS	"-m31 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+#define __ILP32_OFF32_LDFLAGS	"-m31"
+#define __ILP32_OFFBIG_LDFLAGS	"-m31"
+#define __LP64_OFF64_CFLAGS	"-m64"
+#define __LP64_OFF64_LDFLAGS	"-m64"
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/environments.h b/sysdeps/unix/sysv/linux/sparc/bits/environments.h
deleted file mode 100644
index 793a04f..0000000
--- a/sysdeps/unix/sysv/linux/sparc/bits/environments.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Copyright (C) 1999, 2001, 2004, 2009 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _UNISTD_H
-# error "Never include this file directly.  Use <unistd.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-/* This header should define the following symbols under the described
-   situations.  A value `1' means that the model is always supported,
-   `-1' means it is never supported.  Undefined means it cannot be
-   statically decided.
-
-   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
-   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
-
-   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
-   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
-
-   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
-   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
-   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
-   used in previous versions of the Unix standard and are available
-   only for compatibility.
-*/
-
-#if __WORDSIZE == 64
-
-/* Environments with 32-bit wide pointers are optionally provided.
-   Therefore following macros aren't defined:
-   # undef _POSIX_V7_ILP32_OFF32
-   # undef _POSIX_V7_ILP32_OFFBIG
-   # undef _POSIX_V6_ILP32_OFF32
-   # undef _POSIX_V6_ILP32_OFFBIG
-   # undef _XBS5_ILP32_OFF32
-   # undef _XBS5_ILP32_OFFBIG
-   and users need to check at runtime.  */
-
-/* We also have no use (for now) for an environment with bigger pointers
-   and offsets.  */
-# define _POSIX_V7_LPBIG_OFFBIG	-1
-# define _POSIX_V6_LPBIG_OFFBIG	-1
-# define _XBS5_LPBIG_OFFBIG	-1
-
-/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
-# define _POSIX_V7_LP64_OFF64	1
-# define _POSIX_V6_LP64_OFF64	1
-# define _XBS5_LP64_OFF64	1
-
-#else /* __WORDSIZE == 32 */
-
-/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
-   and all platforms support LFS.  */
-# define _POSIX_V7_ILP32_OFF32	1
-# define _POSIX_V7_ILP32_OFFBIG	1
-# define _POSIX_V6_ILP32_OFF32	1
-# define _POSIX_V6_ILP32_OFFBIG	1
-# define _XBS5_ILP32_OFF32	1
-# define _XBS5_ILP32_OFFBIG	1
-
-/* We optionally provide an environment with the above size but an 64-bit
-   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
-
-/* Environments with 64-bit wide pointers can be provided,
-   so these macros aren't defined:
-   # undef _POSIX_V7_LP64_OFF64
-   # undef _POSIX_V7_LPBIG_OFFBIG
-   # undef _POSIX_V6_LP64_OFF64
-   # undef _POSIX_V6_LPBIG_OFFBIG
-   # undef _XBS5_LP64_OFF64
-   # undef _XBS5_LPBIG_OFFBIG
-   and sysconf tests for it at runtime.  */
-
-#endif /* __WORDSIZE == 32 */
-
-#define __ILP32_OFF32_CFLAGS	"-m32"
-#define __ILP32_OFFBIG_CFLAGS	"-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
-#define __ILP32_OFF32_LDFLAGS	"-m32"
-#define __ILP32_OFFBIG_LDFLAGS	"-m32"
-#define __LP64_OFF64_CFLAGS	"-m64"
-#define __LP64_OFF64_LDFLAGS	"-m64"
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/environments.in b/sysdeps/unix/sysv/linux/sparc/bits/environments.in
new file mode 100644
index 0000000..793a04f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/bits/environments.in
@@ -0,0 +1,96 @@
+/* Copyright (C) 1999, 2001, 2004, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
+   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
+
+   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
+   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
+   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
+   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
+   used in previous versions of the Unix standard and are available
+   only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* Environments with 32-bit wide pointers are optionally provided.
+   Therefore following macros aren't defined:
+   # undef _POSIX_V7_ILP32_OFF32
+   # undef _POSIX_V7_ILP32_OFFBIG
+   # undef _POSIX_V6_ILP32_OFF32
+   # undef _POSIX_V6_ILP32_OFFBIG
+   # undef _XBS5_ILP32_OFF32
+   # undef _XBS5_ILP32_OFFBIG
+   and users need to check at runtime.  */
+
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
+# define _POSIX_V7_LP64_OFF64	1
+# define _POSIX_V6_LP64_OFF64	1
+# define _XBS5_LP64_OFF64	1
+
+#else /* __WORDSIZE == 32 */
+
+/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
+   and all platforms support LFS.  */
+# define _POSIX_V7_ILP32_OFF32	1
+# define _POSIX_V7_ILP32_OFFBIG	1
+# define _POSIX_V6_ILP32_OFF32	1
+# define _POSIX_V6_ILP32_OFFBIG	1
+# define _XBS5_ILP32_OFF32	1
+# define _XBS5_ILP32_OFFBIG	1
+
+/* We optionally provide an environment with the above size but an 64-bit
+   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
+
+/* Environments with 64-bit wide pointers can be provided,
+   so these macros aren't defined:
+   # undef _POSIX_V7_LP64_OFF64
+   # undef _POSIX_V7_LPBIG_OFFBIG
+   # undef _POSIX_V6_LP64_OFF64
+   # undef _POSIX_V6_LPBIG_OFFBIG
+   # undef _XBS5_LP64_OFF64
+   # undef _XBS5_LPBIG_OFFBIG
+   and sysconf tests for it at runtime.  */
+
+#endif /* __WORDSIZE == 32 */
+
+#define __ILP32_OFF32_CFLAGS	"-m32"
+#define __ILP32_OFFBIG_CFLAGS	"-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+#define __ILP32_OFF32_LDFLAGS	"-m32"
+#define __ILP32_OFFBIG_LDFLAGS	"-m32"
+#define __LP64_OFF64_CFLAGS	"-m64"
+#define __LP64_OFF64_LDFLAGS	"-m64"
diff --git a/sysdeps/unix/sysv/linux/x86/bits/environments-m32.in b/sysdeps/unix/sysv/linux/x86/bits/environments-m32.in
new file mode 100644
index 0000000..4eb3f17
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/bits/environments-m32.in
@@ -0,0 +1,100 @@
+/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
+   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
+
+   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
+   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
+   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
+   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
+   used in previous versions of the Unix standard and are available
+   only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* Environments with 32-bit wide pointers are optionally provided.
+   Therefore following macros aren't defined:
+   # undef _POSIX_V7_ILP32_OFF32
+   # undef _POSIX_V7_ILP32_OFFBIG
+   # undef _POSIX_V6_ILP32_OFF32
+   # undef _POSIX_V6_ILP32_OFFBIG
+   # undef _XBS5_ILP32_OFF32
+   # undef _XBS5_ILP32_OFFBIG
+   and users need to check at runtime.  */
+
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
+# define _POSIX_V7_LP64_OFF64	1
+# define _POSIX_V6_LP64_OFF64	1
+# define _XBS5_LP64_OFF64	1
+
+#else /* __WORDSIZE == 32 */
+
+/* We have 32-bit wide `int', `long int' and pointers and all platforms
+   support LFS.  -mx32 has 64-bit wide `off_t'.  */
+# define _POSIX_V7_ILP32_OFFBIG	1
+# define _POSIX_V6_ILP32_OFFBIG 1
+# define _XBS5_ILP32_OFFBIG	1
+
+# ifndef __x86_64__
+/* -m32 has 32-bit wide `off_t'.  */
+#  define _POSIX_V7_ILP32_OFF32	1
+#  define _POSIX_V6_ILP32_OFF32	1
+#  define _XBS5_ILP32_OFF32	1
+# endif
+
+/* We optionally provide an environment with the above size but an 64-bit
+   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
+
+/* Environments with 64-bit wide pointers can be provided,
+   so these macros aren't defined:
+   # undef _POSIX_V7_LP64_OFF64
+   # undef _POSIX_V7_LPBIG_OFFBIG
+   # undef _POSIX_V6_LP64_OFF64
+   # undef _POSIX_V6_LPBIG_OFFBIG
+   # undef _XBS5_LP64_OFF64
+   # undef _XBS5_LPBIG_OFFBIG
+   and sysconf tests for it at runtime.  */
+
+#endif /* __WORDSIZE == 32 */
+
+#define __ILP32_OFF32_CFLAGS	"-m32"
+#define __ILP32_OFF32_LDFLAGS	"-m32"
+#define __ILP32_OFFBIG_CFLAGS	"-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+#define __ILP32_OFFBIG_LDFLAGS	"-m32"
+#define __LP64_OFF64_CFLAGS	"-m64"
+#define __LP64_OFF64_LDFLAGS	"-m64"
diff --git a/sysdeps/unix/sysv/linux/x86/bits/environments-mx32.in b/sysdeps/unix/sysv/linux/x86/bits/environments-mx32.in
new file mode 100644
index 0000000..7179b64
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/bits/environments-mx32.in
@@ -0,0 +1,100 @@
+/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
+   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
+
+   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
+   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
+   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
+   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
+   used in previous versions of the Unix standard and are available
+   only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* Environments with 32-bit wide pointers are optionally provided.
+   Therefore following macros aren't defined:
+   # undef _POSIX_V7_ILP32_OFF32
+   # undef _POSIX_V7_ILP32_OFFBIG
+   # undef _POSIX_V6_ILP32_OFF32
+   # undef _POSIX_V6_ILP32_OFFBIG
+   # undef _XBS5_ILP32_OFF32
+   # undef _XBS5_ILP32_OFFBIG
+   and users need to check at runtime.  */
+
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
+# define _POSIX_V7_LP64_OFF64	1
+# define _POSIX_V6_LP64_OFF64	1
+# define _XBS5_LP64_OFF64	1
+
+#else /* __WORDSIZE == 32 */
+
+/* We have 32-bit wide `int', `long int' and pointers and all platforms
+   support LFS.  -mx32 has 64-bit wide `off_t'.  */
+# define _POSIX_V7_ILP32_OFFBIG	1
+# define _POSIX_V6_ILP32_OFFBIG 1
+# define _XBS5_ILP32_OFFBIG	1
+
+# ifndef __x86_64__
+/* -m32 has 32-bit wide `off_t'.  */
+#  define _POSIX_V7_ILP32_OFF32	1
+#  define _POSIX_V6_ILP32_OFF32	1
+#  define _XBS5_ILP32_OFF32	1
+# endif
+
+/* We optionally provide an environment with the above size but an 64-bit
+   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
+
+/* Environments with 64-bit wide pointers can be provided,
+   so these macros aren't defined:
+   # undef _POSIX_V7_LP64_OFF64
+   # undef _POSIX_V7_LPBIG_OFFBIG
+   # undef _POSIX_V6_LP64_OFF64
+   # undef _POSIX_V6_LPBIG_OFFBIG
+   # undef _XBS5_LP64_OFF64
+   # undef _XBS5_LPBIG_OFFBIG
+   and sysconf tests for it at runtime.  */
+
+#endif /* __WORDSIZE == 32 */
+
+#define __ILP32_OFF32_CFLAGS	"-m32"
+#define __ILP32_OFF32_LDFLAGS	"-m32"
+#define __ILP32_OFFBIG_CFLAGS	"-mx32"
+#define __ILP32_OFFBIG_LDFLAGS	"-mx32"
+#define __LP64_OFF64_CFLAGS	"-m64"
+#define __LP64_OFF64_LDFLAGS	"-m64"
diff --git a/sysdeps/unix/sysv/linux/x86/bits/environments.h b/sysdeps/unix/sysv/linux/x86/bits/environments.h
deleted file mode 100644
index 793a04f..0000000
--- a/sysdeps/unix/sysv/linux/x86/bits/environments.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Copyright (C) 1999, 2001, 2004, 2009 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _UNISTD_H
-# error "Never include this file directly.  Use <unistd.h> instead"
-#endif
-
-#include <bits/wordsize.h>
-
-/* This header should define the following symbols under the described
-   situations.  A value `1' means that the model is always supported,
-   `-1' means it is never supported.  Undefined means it cannot be
-   statically decided.
-
-   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
-   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
-
-   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
-   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
-
-   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
-   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
-   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
-   used in previous versions of the Unix standard and are available
-   only for compatibility.
-*/
-
-#if __WORDSIZE == 64
-
-/* Environments with 32-bit wide pointers are optionally provided.
-   Therefore following macros aren't defined:
-   # undef _POSIX_V7_ILP32_OFF32
-   # undef _POSIX_V7_ILP32_OFFBIG
-   # undef _POSIX_V6_ILP32_OFF32
-   # undef _POSIX_V6_ILP32_OFFBIG
-   # undef _XBS5_ILP32_OFF32
-   # undef _XBS5_ILP32_OFFBIG
-   and users need to check at runtime.  */
-
-/* We also have no use (for now) for an environment with bigger pointers
-   and offsets.  */
-# define _POSIX_V7_LPBIG_OFFBIG	-1
-# define _POSIX_V6_LPBIG_OFFBIG	-1
-# define _XBS5_LPBIG_OFFBIG	-1
-
-/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
-# define _POSIX_V7_LP64_OFF64	1
-# define _POSIX_V6_LP64_OFF64	1
-# define _XBS5_LP64_OFF64	1
-
-#else /* __WORDSIZE == 32 */
-
-/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
-   and all platforms support LFS.  */
-# define _POSIX_V7_ILP32_OFF32	1
-# define _POSIX_V7_ILP32_OFFBIG	1
-# define _POSIX_V6_ILP32_OFF32	1
-# define _POSIX_V6_ILP32_OFFBIG	1
-# define _XBS5_ILP32_OFF32	1
-# define _XBS5_ILP32_OFFBIG	1
-
-/* We optionally provide an environment with the above size but an 64-bit
-   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
-
-/* Environments with 64-bit wide pointers can be provided,
-   so these macros aren't defined:
-   # undef _POSIX_V7_LP64_OFF64
-   # undef _POSIX_V7_LPBIG_OFFBIG
-   # undef _POSIX_V6_LP64_OFF64
-   # undef _POSIX_V6_LPBIG_OFFBIG
-   # undef _XBS5_LP64_OFF64
-   # undef _XBS5_LPBIG_OFFBIG
-   and sysconf tests for it at runtime.  */
-
-#endif /* __WORDSIZE == 32 */
-
-#define __ILP32_OFF32_CFLAGS	"-m32"
-#define __ILP32_OFFBIG_CFLAGS	"-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
-#define __ILP32_OFF32_LDFLAGS	"-m32"
-#define __ILP32_OFFBIG_LDFLAGS	"-m32"
-#define __LP64_OFF64_CFLAGS	"-m64"
-#define __LP64_OFF64_LDFLAGS	"-m64"
diff --git a/sysdeps/unix/sysv/linux/x86/configure b/sysdeps/unix/sysv/linux/x86/configure
new file mode 100644
index 0000000..664656b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/configure
@@ -0,0 +1,13 @@
+# Local configure fragment for sysdeps/unix/sysv/x86_64.
+
+case x"$ilp32_large_off_t" in
+xm32|x)
+  environments_in=bits/environments-m32.in
+  ilp32_large_off_t=m32
+  ilp32_large_off_t_used=yes
+  ;;
+xmx32)
+  environments_in=bits/environments-mx32.in
+  ilp32_large_off_t_used=yes
+  ;;
+esac
diff --git a/sysdeps/unix/sysv/linux/x86_64/configure b/sysdeps/unix/sysv/linux/x86_64/configure
new file mode 100644
index 0000000..ea396d5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/configure
@@ -0,0 +1,3 @@
+# Local configure fragment for sysdeps/unix/sysv/linux/x86_64
+
+. $srcdir/sysdeps/unix/sysv/linux/x86/configure
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/configure b/sysdeps/unix/sysv/linux/x86_64/x32/configure
index 51fc1e6..641a563 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/configure
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/configure
@@ -1,4 +1,4 @@
-# Local configure fragment for sysdeps/unix/sysv/linux/86_64/x32.
+# Local configure fragment for sysdeps/unix/sysv/linux/x86_64/x32.
 
 case "$machine" in
 x86_64/x32)
@@ -16,3 +16,15 @@ x86_64/x32)
   esac
   ;;
 esac
+
+case x"$ilp32_large_off_t" in
+xm32)
+  echo The -m32 ILP32 large off_t option of x32 is not supported.
+  exit 1
+  ;;
+xmx32|x)
+  environments_in=bits/environments-mx32.in
+  ilp32_large_off_t=mx32
+  ilp32_large_off_t_used=yes
+  ;;
+esac
-- 
1.7.10.4


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