[PATCH] configure.ac: allow expressing dwarf version in CFLAGS and CROSSCFLAGS
Jacek Caban
jacek at codeweavers.com
Tue Nov 2 14:07:09 CDT 2021
On 11/2/21 9:45 AM, Eric Pouech wrote:
> usage:
> configure CFLAGS="-gdwarf-4 -O2"
> will enable dwarf4 compilation for ELF parts
> (and CROSSCFLAGS="-gdwarf-4 -O2" for PE parts)
>
> evolution from current behavior:
> - when CFLAGS contains "-gdwarf-X", -gdwarf-X option is not tested with
> WINE_TRY_CFLAGS (the option remains anyway in CFLAGS -so WINE_TRY is
> useless- and is not copied in EXTRACFLAGS) (ditto for CROSSCFLAGS)
> - using CROSSCFLAGS=-gdwarf is no longer converted to Wine's default
> format, but is kepts as is, hence will boil down to compiler's
> preferred dwarf version
> - CROSSDEBUG=split used to pick up compiler's default format
> (while CROSSDEBUG=split-dwarf picked up wine's default format).
> They both now pick up the format derived from or specified in
> CROSSCLAGS (if any)
>
> what remains undone (and could be improved):
> - no test that the final configuration is suitable for Wine (ie
> if WINE_TRY_CFLAGS fails on -gdwarf-2, compilation is done with
> compilers's default format => dwarf5 on Linux)
>
> Changes from previous version:
> - fixed handling of "-g -gcodeview" in CROSSCFLAGS
> - fixed CROSSDEBUG=split* (mixup between split-dwarf and dwarf-split)
>
> open question:
> - I kept the original behavior, when providing as configure args (and
> not providing CROSSCFLAGS in configure args):
> CROSSDEBUG=pdb
> to add -gcodeview to EXTRACROSSCFLAGS
> It could be simplified with no longer supporting CROSSDEBUG from
> command line, but:
> + set CROSSDEBUG=pdb in configure when -gcodeview
> option is present is CROSSCFLAGS
> + set CROSSDEBUG=split in configure when -gsplit-dwarf
> option is present is CROSSCFLAGS
>
> Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
>
> ---
> configure.ac | 40 ++++++++++++++++++++++++----------------
> 1 file changed, 24 insertions(+), 16 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 7c1e446814b..99347813a13 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1008,21 +1008,24 @@ then
>
> dnl Determine debug info format
> AC_SUBST(CROSSDEBUG)
> - if test -z "$CROSSDEBUG"
> + ac_debug_format_seen=
> + for ac_flag in $CROSSCFLAGS; do
> + case $ac_flag in
> + -gdwarf*) ac_debug_format_seen=yes ;;
> + -g) ac_debug_format_seen=${ac_debug_format_seen:-default} ;;
> + -gcodeview) ac_debug_format_seen=yes ;;
> + esac
> + done
> + if test "x$ac_debug_format_seen" = "xdefault" -a "x$CROSSDEBUG" = "xpdb"
> then
> - for ac_flag in $CROSSCFLAGS; do
> - case $ac_flag in
> - -gdwarf*) CROSSDEBUG=dwarf ;;
> - -gcodeview) CROSSDEBUG=pdb ;;
> - -g) CROSSDEBUG=${CROSSDEBUG:-dwarf} ;;
> - esac
> - done
> + WINE_TRY_CROSSCFLAGS([-gcodeview])
> + ac_debug_format_seen=yes
> + fi
> + if test "x$ac_debug_format_seen" = "xdefault"
> + then
> + WINE_TRY_CROSSCFLAGS([-gdwarf-2])
> + WINE_TRY_CROSSCFLAGS([-gstrict-dwarf])
> fi
> - case $CROSSDEBUG in
> - *dwarf) WINE_TRY_CROSSCFLAGS([-gdwarf-2])
> - WINE_TRY_CROSSCFLAGS([-gstrict-dwarf]) ;;
> - pdb) WINE_TRY_CROSSCFLAGS([-gcodeview]) ;;
> - esac
>
This version does not set CROSSDEBUG when -gcodeview is present in
CROSSCFLAGS (while CROSSDEBUG needs to be set for makedep). What do you
think about simplified (barely tested) version of the patch that I attached?
Thanks,
Jacek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 1040 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20211102/3738e07a/attachment.bin>
More information about the wine-devel
mailing list