From: "Rémi Bernon" Subject: Re: [PATCH v2 2/2] makefiles: Split PE debug sections to separate files. Message-Id: <69fe3648-0eb2-4b60-500f-895439117eff@codeweavers.com> Date: Thu, 3 Oct 2019 19:21:38 +0200 In-Reply-To: References: <20191002182625.5788-3-rbernon@codeweavers.com> <20191002182625.5788-1-rbernon@codeweavers.com> <770cc4262d304767a24cbf3377fb2306@codeweavers.com> On 10/3/19 5:53 PM, Chip Davis wrote: > October 3, 2019 3:29 AM, "Rémi Bernon" wrote: > >> On 10/2/19 8:53 PM, Chip Davis wrote: >> >>> October 2, 2019 1:39 PM, "Rémi Bernon" wrote: >>> diff --git a/tools/makedep.c b/tools/makedep.c >>>> index 6d74507661e..4b1d68f71f6 100644 >>>> --- a/tools/makedep.c >>>> +++ b/tools/makedep.c >>>> @@ -3189,6 +3189,7 @@ static void output_module( struct makefile *make ) >>>> struct strarray dep_libs = empty_strarray; >>>> char *module_path = obj_dir_path( make, make->module ); >>>> char *spec_file = NULL; >>>> + char const *bfd_format = strstr( crosstarget, "x86_64" ) ? "elf64-x86-64" : "elf32-i386"; >>>> unsigned int i; >>>> >>>> if (!make->is_exe) spec_file = src_dir_path( make, replace_extension( make->module, ".dll", >>>> ".spec")); >>>> @@ -3249,6 +3250,9 @@ static void output_module( struct makefile *make ) >>>> output_filename( make->is_cross ? "$(CROSSLDFLAGS)" : "$(LDFLAGS)" ); >>>> output_filename( make->is_cross ? "-Wl,--file-alignment,4096" : "" ); >>>> output( "\n" ); >>>> + if (make->is_cross && !make->is_win16) >>>> + output( "\tmkdir -p $(@D)/.debug && %s-objcopy -O %s --only-keep-debug" >>>> + " --file-alignment=4096 $@ $(@D)/.debug/$(@F)\n", crosstarget, bfd_format ); >>> >>> We really don't want to do this on Mac OS. >> >> Sure, it's not useful on MacOS but is it an issue? Or is it because of mkdir? > > It's because of objcopy, which may not be available--and the fact that the Mac OS native binary format is Mach-O, not ELF. > > Chip > Here objcopy is prefixed by crosstarget and it should be the one provided with MinGW binutils, as %s-ranlib or %s-ar in the output_static_lib function. Of course, it still may not be available and it could be checked during configure - and the other tools maybe too. -- Rémi Bernon