[patch] Unify AC_SYS_LARGEFILE exception across dirs (+GDB new largefile support)

Jan Kratochvil
2009-11-09T14:10:50Z

Hi,

there is AC_SYS_LARGEFILE present in some */configure.{ac,in} files,
its import history is listed at:
[patch, configures] Unify AC_SYS_LARGEFILE exception across dirs
http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00230.html

There was found a problem as it is required to have the largefile support
active/inactive exactly the same in all the subdirectories due to ABI
compatibility as shown in PR 9992 fixed by Nick Clifton.

Therefore got now accepted config/largefile.m4 for it to make it unified:
Re: [patch, configures] Unify AC_SYS_LARGEFILE exception across dirs
http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00353.html
http://gcc.gnu.org/ml/gcc-cvs/2009-11/msg00206.html

There is a bug in this (currently unused) config/largefile.m4 as it depends on
${plugins} which is never set there. One would have to always call AC_PLUGINS
beforehand. Therefore config/largefile.m4 should call AC_PLUGINS itself.
After this patch gets approved for binutils I will ask for an update of
config/largefile.m4 in GCC SVN (+sourceware CVS).

bfd/ + binutils/ + ld/ have ABI dependency on bfd/ interface, patched here.
At least bfd_stat() has such dependency.

libiberty/ has no largefile-lreated ABI differences in its interface so it is
not patched. It already has AC_SYS_LARGEFILE but with no exceptions.
Discussed at:
[patch, configures] Unify AC_SYS_LARGEFILE exception across dirs
http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00230.html

gas/ + gprof/ have no found dependencies on bfd/ but as they use it they could
easily start to have (such as if they would start to use bfd_stat()), patched.

gdb/ patched with new largefile support as this patch is a blocker for fix of
a regression of mine:
http://sourceware.org/ml/gdb-patches/2009-11/msg00084.html

Regression tested on i386-fedora11-linux-gnu for gas/ld/binutils.

Diff of the the generated parts is at:
http://people.redhat.com/jkratoch/largefile/acx-largefile-generated.patch

Thanks,
Jan

config/
2009-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>

* largefile.m4 (ACX_LARGEFILE): Call AC_PLUGINS.

bfd/
2009-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>

* configure.in: Call ACX_LARGEFILE. Stop calling AC_PLUGINS,
AC_SYS_LARGEFILE and checking the Solaris largefile exception.
* aclocal.m4: Regenerate.
* configure: Regenerate.

binutils/
2009-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>

* configure.in: Call ACX_LARGEFILE. Stop calling AC_PLUGINS,
AC_SYS_LARGEFILE and checking the Solaris largefile exception.
* aclocal.m4: Regenerate.
* configure: Regenerate.

gas/
2009-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>

* configure.in: Call ACX_LARGEFILE. Stop calling AC_SYS_LARGEFILE.
* aclocal.m4: Regenerate.
* configure: Regenerate.

gprof/
2009-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>

* configure.in: Call ACX_LARGEFILE. Stop calling AC_SYS_LARGEFILE.
* aclocal.m4: Regenerate.
* configure: Regenerate.

ld/
2009-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>

* configure.in: Call ACX_LARGEFILE. Stop calling AC_SYS_LARGEFILE.
* aclocal.m4: Regenerate.
* configure: Regenerate.

gdb/
2009-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>

* configure.ac: Call ACX_LARGEFILE.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.

--- a/config/largefile.m4
+++ b/config/largefile.m4
@@ -4,6 +4,12 @@
# of structures used to describe files.

AC_DEFUN([ACX_LARGEFILE],[dnl
+
+# As the $enable_largefile decision depends on --enable-plugins we must set it
+# even in directories otherwise not depending on the $plugins option.
+
+AC_PLUGINS
+
case "${host}" in
changequote(,)dnl
sparc-*-solaris*|i[3-7]86-*-solaris*)
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -25,7 +25,8 @@ AC_USE_SYSTEM_EXTENSIONS

LT_INIT([dlopen])

-AC_PLUGINS
+# AC_PLUGINS setting $plugins is called by ACX_LARGEFILE.
+ACX_LARGEFILE

AM_CONDITIONAL(PLUGINS, test "$plugins" = "yes")

@@ -37,26 +38,6 @@ if test "$plugins" = "yes"; then
enable_targets="$enable_targets plugin"
fi

-case "${target}" in
-changequote(,)dnl
- sparc-*-solaris*|i[3-7]86-*-solaris*)
-changequote([,])dnl
- # On native 32bit sparc and ia32 solaris, large-file and procfs support
- # are mutually exclusive; and without procfs support, the elf module
- # cannot provide certain routines such as elfcore_write_prpsinfo
- # or elfcore_write_prstatus. So unless the user explicitly requested
- # large-file support through the --enable-largefile switch, disable
- # large-file support in favor of procfs support.
- if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
- if test "$plugins" = "no"; then
- enable_largefile="no"
- fi
- fi
- ;;
-esac
-
-AC_SYS_LARGEFILE
-
AC_ARG_ENABLE(64-bit-bfd,
[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
[case "${enableval}" in
--- a/binutils/configure.in
+++ b/binutils/configure.in
@@ -16,25 +16,7 @@ AC_PROG_CC
AC_GNU_SOURCE
AC_USE_SYSTEM_EXTENSIONS

-AC_PLUGINS
-
-case "${target}" in
-changequote(,)dnl
- sparc-*-solaris*|i[3-7]86-*-solaris*)
-changequote([,])dnl
- # See comment in bfd/configure.in for the reason for this test.
- # PR 9992/binutils: We have to duplicate the behaviour of bfd's
- # configure script so that the utilities in this directory agree
- # on the size of structures used to describe files.
- if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
- if test "$plugins" = "no"; then
- enable_largefile="no"
- fi
- fi
- ;;
-esac
-
-AC_SYS_LARGEFILE
+ACX_LARGEFILE
LT_INIT

AC_ARG_ENABLE(targets,
--- a/gas/configure.in
+++ b/gas/configure.in
@@ -24,7 +24,7 @@ AM_INIT_AUTOMAKE(gas, ${BFD_VERSION})
AC_PROG_CC
AC_GNU_SOURCE
AC_USE_SYSTEM_EXTENSIONS
-AC_SYS_LARGEFILE
+ACX_LARGEFILE

LT_INIT

--- a/gprof/configure.in
+++ b/gprof/configure.in
@@ -20,7 +20,7 @@ AC_CONFIG_HEADERS([gconfig.h:gconfig.in])
AC_PROG_CC
AC_GNU_SOURCE
AC_USE_SYSTEM_EXTENSIONS
-AC_SYS_LARGEFILE
+ACX_LARGEFILE
AC_PROG_INSTALL

LT_INIT
--- a/ld/configure.in
+++ b/ld/configure.in
@@ -110,7 +110,7 @@ fi
AC_PROG_CC
AC_GNU_SOURCE
AC_USE_SYSTEM_EXTENSIONS
-AC_SYS_LARGEFILE
+ACX_LARGEFILE
AC_PROG_INSTALL

LT_INIT
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -28,6 +28,7 @@ AM_MAINTAINER_MODE
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
gl_EARLY
+ACX_LARGEFILE
AM_PROG_CC_STDC

AC_CONFIG_AUX_DIR(..)