From: Jacek Caban jacek@codeweavers.com
--- configure.ac | 28 ++++++++++++++++++---------- tools/makedep.c | 19 +++++++++++-------- 2 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/configure.ac b/configure.ac index 056d18b378b..cae44286dc4 100644 --- a/configure.ac +++ b/configure.ac @@ -587,13 +587,18 @@ This is an error since --enable-archs=$wine_arch was requested.])]) wine_crossdebug=$CROSSDEBUG if test -z "$wine_crossdebug" then + ac_g_flag_seen="" for ac_flag in $CFLAGS; do case $ac_flag in - -gdwarf*) wine_crossdebug=dwarf ;; - -gcodeview) wine_crossdebug=pdb ;; - -g) wine_crossdebug=${wine_crossdebug:-dwarf} ;; + -gdwarf*) AS_VAR_APPEND(wine_crossdebug, " dwarf") ;; + -gcodeview) AS_VAR_APPEND(wine_crossdebug, " pdb") ;; + -g) ac_g_flag_seen=$ac_flag ;; esac done + if test -n "$ac_g_flag_seen" -a -z "$wine_crossdebug" + then + wine_crossdebug=dwarf + fi fi
ac_debug_format_seen="" @@ -604,13 +609,16 @@ This is an error since --enable-archs=$wine_arch was requested.])]) done if test "x$ac_debug_format_seen" = x then - case $wine_crossdebug in - *dwarf) dnl clang emits a warning without -Wl,-debug:dwarf, so ensure linker option is present - WINE_TRY_PE_CFLAGS([-Wl,-debug:dwarf],[AS_VAR_APPEND([${wine_arch}_LDFLAGS],[" -Wl,-debug:dwarf"]) - CFLAGS="$CFLAGS -Wl,-debug:dwarf"]) - WINE_TRY_PE_CFLAGS([-gdwarf-4]) ;; - pdb) WINE_TRY_PE_CFLAGS([-gcodeview]) ;; - esac + for wine_debug_format in $wine_crossdebug + do + case $wine_debug_format in + *dwarf) dnl clang emits a warning without -Wl,-debug:dwarf, so ensure linker option is present + WINE_TRY_PE_CFLAGS([-Wl,-debug:dwarf],[AS_VAR_APPEND([${wine_arch}_LDFLAGS],[" -Wl,-debug:dwarf"]) + CFLAGS="$CFLAGS -Wl,-debug:dwarf"]) + WINE_TRY_PE_CFLAGS([-gdwarf-4]) ;; + pdb) WINE_TRY_PE_CFLAGS([-gcodeview]) ;; + esac + done fi AS_VAR_SET([${wine_arch}_DEBUG],[$wine_crossdebug])
diff --git a/tools/makedep.c b/tools/makedep.c index 7cfc6ff5106..bf20cbc16e3 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -168,7 +168,7 @@ static const char *arch_dirs[MAX_ARCHS]; static const char *arch_pe_dirs[MAX_ARCHS]; static const char *arch_install_dirs[MAX_ARCHS]; static const char *strip_progs[MAX_ARCHS]; -static const char *debug_flags[MAX_ARCHS]; +static struct strarray debug_flags[MAX_ARCHS]; static const char *delay_load_flags[MAX_ARCHS]; static struct strarray target_flags[MAX_ARCHS]; static struct strarray extra_cflags[MAX_ARCHS]; @@ -2448,12 +2448,15 @@ static struct strarray remove_warning_flags( struct strarray flags ) */ static void output_debug_files( struct makefile *make, const char *name, unsigned int arch ) { - const char *debug_file = NULL; - if (!debug_flags[arch]) return; - if (!strcmp( debug_flags[arch], "pdb" )) debug_file = strmake( "%s.pdb", get_base_name( name )); - else if (!strncmp( debug_flags[arch], "split", 5 )) debug_file = strmake( "%s.debug", name ); - if (debug_file) + unsigned int i; + + for (i = 0; i < debug_flags[arch].count; i++) { + const char *debug_file = NULL; + const char *flag = debug_flags[arch].str[i]; + if (!strcmp( flag, "pdb" )) debug_file = strmake( "%s.pdb", get_base_name( name )); + else if (!strncmp( flag, "split", 5 )) debug_file = strmake( "%s.debug", name ); + if (!debug_file) continue; strarray_add( &make->debug_files, debug_file ); output_filename( strmake( "-Wl,--debug-file,%s", obj_dir_path( make, debug_file ))); } @@ -4730,13 +4733,13 @@ int main( int argc, char *argv[] ) disabled_dirs[arch] = get_expanded_arch_var_array( top_makefile, "DISABLED_SUBDIRS", arch ); if (!is_multiarch( arch )) continue; delay_load_flags[arch] = get_expanded_arch_var( top_makefile, "DELAYLOADFLAG", arch ); - debug_flags[arch] = get_expanded_arch_var( top_makefile, "DEBUG", arch ); + debug_flags[arch] = get_expanded_arch_var_array( top_makefile, "DEBUG", arch ); }
if (unix_lib_supported) { delay_load_flags[0] = "-Wl,-delayload,"; - debug_flags[0] = NULL; + debug_flags[0].count = 0; }
top_makefile->src_dir = root_src_dir;