- added support in CROSSDEBUG for choosing which dwarf version is used for cross compiling Wine - added DEBUGFORMAT option to pick dwarf version for regular compilation
Default for both is still 2
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- configure | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++------- configure.ac | 15 +++-- 2 files changed, 158 insertions(+), 25 deletions(-)
diff --git a/configure b/configure index 7c2f53f5655..a984df5fa15 100755 --- a/configure +++ b/configure @@ -631,6 +631,7 @@ RT_LIBS POLL_LIBS TOOLSEXT MSVCRTFLAGS +DEBUGFORMAT EXTRACFLAGS VKD3D_SHADER_LIBS VKD3D_SHADER_CFLAGS @@ -7013,7 +7014,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 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -7059,7 +7060,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 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -7083,7 +7084,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 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -7128,7 +7129,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 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -7152,7 +7153,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 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -10491,14 +10492,138 @@ fi ;; then for ac_flag in $CROSSCFLAGS; do case $ac_flag in - -gdwarf*) CROSSDEBUG=dwarf ;; + -gdwarf*) CROSSDEBUG=$ac_flag ;; -gcodeview) CROSSDEBUG=pdb ;; -g) CROSSDEBUG=${CROSSDEBUG:-dwarf} ;; esac done fi case $CROSSDEBUG in - *dwarf) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gdwarf-2" >&5 + *dwarf-3) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gdwarf-3" >&5 +$as_echo_n "checking whether the cross-compiler supports -gdwarf-3... " >&6; } +if ${ac_cv_crosscflags__gdwarf_3+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +ac_wine_try_cflags_saved_cc=$CC +ac_wine_try_cflags_saved_exeext=$ac_exeext +CFLAGS="$CFLAGS $EXTRACROSSCFLAGS -nostartfiles -nodefaultlibs -gdwarf-3" +CC="$CROSSCC" +ac_exeext=".exe" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int __cdecl mainCRTStartup(void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_crosscflags__gdwarf_3=yes +else + ac_cv_crosscflags__gdwarf_3=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +CC=$ac_wine_try_cflags_saved_cc +ac_exeext=$ac_wine_try_cflags_saved_exeext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_crosscflags__gdwarf_3" >&5 +$as_echo "$ac_cv_crosscflags__gdwarf_3" >&6; } +if test "x$ac_cv_crosscflags__gdwarf_3" = xyes; then : + EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gdwarf-3" +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gstrict-dwarf" >&5 +$as_echo_n "checking whether the cross-compiler supports -gstrict-dwarf... " >&6; } +if ${ac_cv_crosscflags__gstrict_dwarf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +ac_wine_try_cflags_saved_cc=$CC +ac_wine_try_cflags_saved_exeext=$ac_exeext +CFLAGS="$CFLAGS $EXTRACROSSCFLAGS -nostartfiles -nodefaultlibs -gstrict-dwarf" +CC="$CROSSCC" +ac_exeext=".exe" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int __cdecl mainCRTStartup(void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_crosscflags__gstrict_dwarf=yes +else + ac_cv_crosscflags__gstrict_dwarf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +CC=$ac_wine_try_cflags_saved_cc +ac_exeext=$ac_wine_try_cflags_saved_exeext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_crosscflags__gstrict_dwarf" >&5 +$as_echo "$ac_cv_crosscflags__gstrict_dwarf" >&6; } +if test "x$ac_cv_crosscflags__gstrict_dwarf" = xyes; then : + EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gstrict-dwarf" +fi ;; + *dwarf-4) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gdwarf-4" >&5 +$as_echo_n "checking whether the cross-compiler supports -gdwarf-4... " >&6; } +if ${ac_cv_crosscflags__gdwarf_4+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +ac_wine_try_cflags_saved_cc=$CC +ac_wine_try_cflags_saved_exeext=$ac_exeext +CFLAGS="$CFLAGS $EXTRACROSSCFLAGS -nostartfiles -nodefaultlibs -gdwarf-4" +CC="$CROSSCC" +ac_exeext=".exe" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int __cdecl mainCRTStartup(void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_crosscflags__gdwarf_4=yes +else + ac_cv_crosscflags__gdwarf_4=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +CC=$ac_wine_try_cflags_saved_cc +ac_exeext=$ac_wine_try_cflags_saved_exeext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_crosscflags__gdwarf_4" >&5 +$as_echo "$ac_cv_crosscflags__gdwarf_4" >&6; } +if test "x$ac_cv_crosscflags__gdwarf_4" = xyes; then : + EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gdwarf-4" +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gstrict-dwarf" >&5 +$as_echo_n "checking whether the cross-compiler supports -gstrict-dwarf... " >&6; } +if ${ac_cv_crosscflags__gstrict_dwarf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +ac_wine_try_cflags_saved_cc=$CC +ac_wine_try_cflags_saved_exeext=$ac_exeext +CFLAGS="$CFLAGS $EXTRACROSSCFLAGS -nostartfiles -nodefaultlibs -gstrict-dwarf" +CC="$CROSSCC" +ac_exeext=".exe" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int __cdecl mainCRTStartup(void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_crosscflags__gstrict_dwarf=yes +else + ac_cv_crosscflags__gstrict_dwarf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +CC=$ac_wine_try_cflags_saved_cc +ac_exeext=$ac_wine_try_cflags_saved_exeext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_crosscflags__gstrict_dwarf" >&5 +$as_echo "$ac_cv_crosscflags__gstrict_dwarf" >&6; } +if test "x$ac_cv_crosscflags__gstrict_dwarf" = xyes; then : + EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gstrict-dwarf" +fi ;; + *dwarf|*dwarf-2) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gdwarf-2" >&5 $as_echo_n "checking whether the cross-compiler supports -gdwarf-2... " >&6; } if ${ac_cv_crosscflags__gdwarf_2+:} false; then : $as_echo_n "(cached) " >&6 @@ -10529,7 +10654,7 @@ $as_echo "$ac_cv_crosscflags__gdwarf_2" >&6; } if test "x$ac_cv_crosscflags__gdwarf_2" = xyes; then : EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gdwarf-2" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gstrict-dwarf" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gstrict-dwarf" >&5 $as_echo_n "checking whether the cross-compiler supports -gstrict-dwarf... " >&6; } if ${ac_cv_crosscflags__gstrict_dwarf+:} false; then : $as_echo_n "(cached) " >&6 @@ -10560,7 +10685,7 @@ $as_echo "$ac_cv_crosscflags__gstrict_dwarf" >&6; } if test "x$ac_cv_crosscflags__gstrict_dwarf" = xyes; then : EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -gstrict-dwarf" fi ;; - pdb) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gcodeview" >&5 + pdb) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -gcodeview" >&5 $as_echo_n "checking whether the cross-compiler supports -gcodeview... " >&6; } if ${ac_cv_crosscflags__gcodeview+:} false; then : $as_echo_n "(cached) " >&6 @@ -17543,32 +17668,35 @@ $as_echo "$wine_cv_64bit_compare_swap" >&6; } *) EXTRACFLAGS="$EXTRACFLAGS $wine_cv_64bit_compare_swap" ;; esac
- for ac_flag in $CFLAGS; do + + for ac_flag in $CFLAGS; do case $ac_flag in - -g) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -gdwarf-2" >&5 -$as_echo_n "checking whether the compiler supports -gdwarf-2... " >&6; } -if ${ac_cv_cflags__gdwarf_2+:} false; then : + -g) as_ac_var=`$as_echo "ac_cv_cflags_-g${DEBUGFORMAT:-dwarf-2}" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -g${DEBUGFORMAT:-dwarf-2}" >&5 +$as_echo_n "checking whether the compiler supports -g${DEBUGFORMAT:-dwarf-2}... " >&6; } +if eval ${$as_ac_var+:} false; then : $as_echo_n "(cached) " >&6 else ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -gdwarf-2" +CFLAGS="$CFLAGS -g${DEBUGFORMAT:-dwarf-2}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(int argc, char **argv) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_cflags__gdwarf_2=yes + eval "$as_ac_var=yes" else - ac_cv_cflags__gdwarf_2=no + eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ac_wine_try_cflags_saved fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__gdwarf_2" >&5 -$as_echo "$ac_cv_cflags__gdwarf_2" >&6; } -if test "x$ac_cv_cflags__gdwarf_2" = xyes; then : - EXTRACFLAGS="$EXTRACFLAGS -gdwarf-2" +eval ac_res=$$as_ac_var + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test "x$"$as_ac_var"" = x"yes"; then : + EXTRACFLAGS="$EXTRACFLAGS -g${DEBUGFORMAT:-dwarf-2}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -gstrict-dwarf" >&5 $as_echo_n "checking whether the compiler supports -gstrict-dwarf... " >&6; } diff --git a/configure.ac b/configure.ac index c0a126293c4..a019b4ac2d6 100644 --- a/configure.ac +++ b/configure.ac @@ -1036,16 +1036,20 @@ then then for ac_flag in $CROSSCFLAGS; do case $ac_flag in - -gdwarf*) CROSSDEBUG=dwarf ;; + -gdwarf*) CROSSDEBUG=$ac_flag ;; -gcodeview) CROSSDEBUG=pdb ;; -g) CROSSDEBUG=${CROSSDEBUG:-dwarf} ;; esac done fi case $CROSSDEBUG in - *dwarf) WINE_TRY_CROSSCFLAGS([-gdwarf-2]) - WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;; - pdb) WINE_TRY_CROSSCFLAGS([-gcodeview]) ;; + *dwarf-3) WINE_TRY_CROSSCFLAGS([-gdwarf-3]) + WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;; + *dwarf-4) WINE_TRY_CROSSCFLAGS([-gdwarf-4]) + WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;; + *dwarf|*dwarf-2) WINE_TRY_CROSSCFLAGS([-gdwarf-2]) + WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;; + pdb) WINE_TRY_CROSSCFLAGS([-gcodeview]) ;; esac
WINE_TRY_CROSSCFLAGS([-fexcess-precision=standard],[AC_SUBST(EXCESS_PRECISION_CFLAGS,"-fexcess-precision=standard")]) @@ -2040,9 +2044,10 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy= esac
dnl Default to dwarf-2 debug info + AC_SUBST(DEBUGFORMAT) for ac_flag in $CFLAGS; do case $ac_flag in - -g) WINE_TRY_CFLAGS([-gdwarf-2]) + -g) WINE_TRY_CFLAGS([-g${DEBUGFORMAT:-dwarf-2}]) WINE_TRY_CFLAGS([-gstrict-dwarf]) ;; esac done