[PATCH] Fix PR 59447: --with-dwarf2 should mention or later.

Richard Biener richard.guenther@gmail.com
Mon Jan 10 08:32:12 GMT 2022


On Fri, Jan 7, 2022 at 1:43 AM apinski--- via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> From: Andrew Pinski <apinski@marvell.com>
>
> Dwarf3/4/5 are really just extensions (well not fully) on
> top of dwarf2 and the option --with-dwarf2 just changes the
> default to emit dwarf 2, 3, 4, or 5 by default.
> On the trunk, dwarf 5 is enabled by this configure option.

I wonder if just saying "DWARF" would be more to the point?
The documentation can then say that the actual DWARF standard
selected by default with -g varies with the target and is documented
in the target specific section (hopefully).

--with-dwarf2 should also be largely obsolete now given that STABS
is deprecated.  IIRC I fiddled somewhat with the configure but
ended up keeping it as its used by other bits.

> gcc/ChangeLog:
>
>         PR bootstrap/59447
>         * configure: Regenerate.
>         * configure.ac: Add (or later) to the --with-dwarf2
>         option documentation
>         * doc/install.texi: Likewise.
> ---
>  gcc/configure        | 50 ++++++++++++++++++++++++++++++++++++--------
>  gcc/configure.ac     |  2 +-
>  gcc/doc/install.texi |  2 +-
>  3 files changed, 43 insertions(+), 11 deletions(-)
>
> diff --git a/gcc/configure b/gcc/configure
> index 992a9d70092..fa0724f4f3a 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -914,6 +914,7 @@ infodir
>  docdir
>  oldincludedir
>  includedir
> +runstatedir
>  localstatedir
>  sharedstatedir
>  sysconfdir
> @@ -1088,6 +1089,7 @@ datadir='${datarootdir}'
>  sysconfdir='${prefix}/etc'
>  sharedstatedir='${prefix}/com'
>  localstatedir='${prefix}/var'
> +runstatedir='${localstatedir}/run'
>  includedir='${prefix}/include'
>  oldincludedir='/usr/include'
>  docdir='${datarootdir}/doc/${PACKAGE}'
> @@ -1340,6 +1342,15 @@ do
>    | -silent | --silent | --silen | --sile | --sil)
>      silent=yes ;;
>
> +  -runstatedir | --runstatedir | --runstatedi | --runstated \
> +  | --runstate | --runstat | --runsta | --runst | --runs \
> +  | --run | --ru | --r)
> +    ac_prev=runstatedir ;;
> +  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
> +  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
> +  | --run=* | --ru=* | --r=*)
> +    runstatedir=$ac_optarg ;;
> +
>    -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
>      ac_prev=sbindir ;;
>    -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
> @@ -1477,7 +1488,7 @@ fi
>  for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
>                 datadir sysconfdir sharedstatedir localstatedir includedir \
>                 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
> -               libdir localedir mandir
> +               libdir localedir mandir runstatedir
>  do
>    eval ac_val=\$$ac_var
>    # Remove trailing slashes.
> @@ -1630,6 +1641,7 @@ Fine tuning of the installation directories:
>    --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
>    --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
>    --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
> +  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
>    --libdir=DIR            object code libraries [EPREFIX/lib]
>    --includedir=DIR        C header files [PREFIX/include]
>    --oldincludedir=DIR     C header files for non-gcc [/usr/include]
> @@ -1823,7 +1835,8 @@ Optional Packages:
>    --with-stack-clash-protection-guard-size=size
>                            Set the default stack clash protection guard size
>                            for specific targets as a power of two in bytes.
> -  --with-dwarf2           force the default debug format to be DWARF 2
> +  --with-dwarf2           force the default debug format to be DWARF 2 (or
> +                          later)
>    --with-specs=SPECS      add SPECS to driver command-line processing
>    --with-pkgversion=PKG   Use PKG in the version string in place of "GCC"
>    --with-bugurl=URL       Direct users to URL to report a bug
> @@ -5352,7 +5365,26 @@ else
>    GDC="$ac_cv_prog_GDC"
>  fi
>
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the D compiler works" >&5
> +$as_echo_n "checking whether the D compiler works... " >&6; }
> +if ${acx_cv_d_compiler_works+:} false; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +  cat >conftest.d <<EOF
> +module conftest; int main() { return 0; }
> +EOF
> +acx_cv_d_compiler_works=no
>  if test "x$GDC" != xno; then
> +  errors=`(${GDC} -I"$srcdir"/d -c conftest.d) 2>&1 || echo failure`
> +  if test x"$errors" = x && test -f conftest.$ac_objext; then
> +    acx_cv_d_compiler_works=yes
> +  fi
> +  rm -f conftest.*
> +fi
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_d_compiler_works" >&5
> +$as_echo "$acx_cv_d_compiler_works" >&6; }
> +if test "x$GDC" != xno && test x$acx_cv_d_compiler_works != xno; then
>    have_gdc=yes
>  else
>    have_gdc=no
> @@ -6127,7 +6159,7 @@ else
>      We can't simply define LARGE_OFF_T to be 9223372036854775807,
>      since some C++ compilers masquerading as C compilers
>      incorrectly reject 9223372036854775807.  */
> -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
> +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
>    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
>                        && LARGE_OFF_T % 2147483647 == 1)
>                       ? 1 : -1];
> @@ -6173,7 +6205,7 @@ else
>      We can't simply define LARGE_OFF_T to be 9223372036854775807,
>      since some C++ compilers masquerading as C compilers
>      incorrectly reject 9223372036854775807.  */
> -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
> +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
>    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
>                        && LARGE_OFF_T % 2147483647 == 1)
>                       ? 1 : -1];
> @@ -6197,7 +6229,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
>      We can't simply define LARGE_OFF_T to be 9223372036854775807,
>      since some C++ compilers masquerading as C compilers
>      incorrectly reject 9223372036854775807.  */
> -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
> +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
>    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
>                        && LARGE_OFF_T % 2147483647 == 1)
>                       ? 1 : -1];
> @@ -6242,7 +6274,7 @@ else
>      We can't simply define LARGE_OFF_T to be 9223372036854775807,
>      since some C++ compilers masquerading as C compilers
>      incorrectly reject 9223372036854775807.  */
> -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
> +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
>    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
>                        && LARGE_OFF_T % 2147483647 == 1)
>                       ? 1 : -1];
> @@ -6266,7 +6298,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
>      We can't simply define LARGE_OFF_T to be 9223372036854775807,
>      since some C++ compilers masquerading as C compilers
>      incorrectly reject 9223372036854775807.  */
> -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
> +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
>    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
>                        && LARGE_OFF_T % 2147483647 == 1)
>                       ? 1 : -1];
> @@ -19561,7 +19593,7 @@ else
>    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>    lt_status=$lt_dlunknown
>    cat > conftest.$ac_ext <<_LT_EOF
> -#line 19564 "configure"
> +#line 19596 "configure"
>  #include "confdefs.h"
>
>  #if HAVE_DLFCN_H
> @@ -19667,7 +19699,7 @@ else
>    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>    lt_status=$lt_dlunknown
>    cat > conftest.$ac_ext <<_LT_EOF
> -#line 19670 "configure"
> +#line 19702 "configure"
>  #include "confdefs.h"
>
>  #if HAVE_DLFCN_H
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 247371e6537..78c9bb15531 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -1002,7 +1002,7 @@ fi,
>  objc_boehm_gc='')
>
>  AC_ARG_WITH(dwarf2,
> -[AS_HELP_STRING([--with-dwarf2], [force the default debug format to be DWARF 2])],
> +[AS_HELP_STRING([--with-dwarf2], [force the default debug format to be DWARF 2 (or later)])],
>  dwarf2="$with_dwarf2",
>  dwarf2=no)
>
> diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
> index 54ad7c7b47c..56136ff0e7f 100644
> --- a/gcc/doc/install.texi
> +++ b/gcc/doc/install.texi
> @@ -1872,7 +1872,7 @@ should not be built.
>
>  @item --with-dwarf2
>  Specify that the compiler should
> -use DWARF 2 debugging information as the default.
> +use DWARF 2 (or later) debugging information as the default.
>
>  @item --with-advance-toolchain=@var{at}
>  On 64-bit PowerPC Linux systems, configure the compiler to use the
> --
> 2.17.1
>


More information about the Gcc-patches mailing list