[PATCH 3/3] winegcc: Use ELF format for split debug file.

Rémi Bernon rbernon at codeweavers.com
Mon May 25 09:32:40 CDT 2020


When not using PDB, as Linux perf is only able to read debug info from
ELF files.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 tools/winegcc/winegcc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index b59d9c2c81b7..22e902073595 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -1412,9 +1412,13 @@ static void build(struct options* opts)
 
     if (opts->debug_file && !strendswith(opts->debug_file, ".pdb"))
     {
+        char const *bfd_format = (opts->target_cpu == CPU_x86_64) ? "-Oelf64-x86-64" :
+                                 (opts->target_cpu == CPU_x86) ? "-Oelf32-i386" :
+                                 NULL;
         strarray *tool, *objcopy = build_tool_name(opts, TOOL_OBJCOPY);
 
         tool = strarray_dup(objcopy);
+        if (bfd_format) strarray_add(tool, bfd_format);
         strarray_add(tool, "--only-keep-debug");
         strarray_add(tool, output_path);
         strarray_add(tool, opts->debug_file);
-- 
2.26.1




More information about the wine-devel mailing list