Misc #18153
closedShould `make install` copy the `ruby.dSYM` folder on macOS?
Description
If I build Ruby with --enable-shared
on Linux, bin/ruby
and lib/libruby.so
both have DWARF information embedded in the ELF file. However, if I do the same thing on macOS, there is no DWARF information. All DWARF information seems to stay in the ruby.dSYM folder and is never installed.
Should we copy the ruby.dSYM
folder during make install
so that macOS can have the DWARF information too?
Here is objdump
on ELF:
[aaron@tc ~/D/o/x64]$ objdump --section-headers lib/libruby.so
lib/libruby.so: file format elf64-x86-64
Sections:
Idx Name Size VMA Type
0 00000000 0000000000000000
1 .note.gnu.build-id 00000024 0000000000000200
2 .gnu.hash 00003364 0000000000000228
3 .dynsym 0000bfd0 0000000000003590
4 .dynstr 0000891a 000000000000f560
5 .gnu.version 00000ffc 0000000000017e7a
6 .gnu.version_r 000001d0 0000000000018e78
7 .rela.dyn 0000e9d0 0000000000019048
8 .rela.plt 000084c0 0000000000027a18
9 .init 00000017 000000000002fed8 TEXT
10 .plt 00005890 000000000002fef0 TEXT
11 .plt.got 000002a0 0000000000035780 TEXT
12 .text 0029af8e 0000000000035a20 TEXT
13 .fini 00000009 00000000002d09b0 TEXT
14 .rodata 000ab806 00000000002d09c0 DATA
15 .eh_frame_hdr 0000c464 000000000037c1c8 DATA
16 .eh_frame 000494f0 0000000000388630 DATA
17 .tbss 00000010 00000000005d28d0 BSS
18 .init_array 00000008 00000000005d28d0
19 .fini_array 00000008 00000000005d28d8
20 .data.rel.ro 00005bc8 00000000005d28e0 DATA
21 .dynamic 00000250 00000000005d84a8
22 .got 00000900 00000000005d86f8 DATA
23 .got.plt 00002c58 00000000005d9000 DATA
24 .data 00000268 00000000005dbc60 DATA
25 .bss 00010898 00000000005dbee0 BSS
26 .comment 00000029 0000000000000000
27 .debug_aranges 000006ca 0000000000000000
28 .debug_info 002dbb55 0000000000000000
29 .debug_abbrev 00006e97 0000000000000000
30 .debug_line 0008d709 0000000000000000
31 .debug_str 000433f4 0000000000000000
32 .debug_loc 0018093e 0000000000000000
33 .debug_ranges 0004aada 0000000000000000
34 .debug_macro 0002e14d 0000000000000000
35 .symtab 00033528 0000000000000000
36 .strtab 000247e4 0000000000000000
37 .shstrtab 0000016a 0000000000000000
Here os objdump
on Mach-O:
[aaron@tc ~/D/o/x64]$ objdump --section-headers lib/libruby.3.0.dylib
lib/libruby.3.0.dylib: file format mach-o 64-bit x86-64
Sections:
Idx Name Size VMA Type
0 __text 0029e842 0000000000002bd0 TEXT
1 __stubs 0000071a 00000000002a1412 TEXT
2 __stub_helper 00000be6 00000000002a1b2c TEXT
3 __const 0007da40 00000000002a2720 DATA
4 __cstring 0002230c 0000000000320160 DATA
5 __ustring 0000005e 0000000000342470 DATA
6 __dof_ruby 00001b93 00000000003424ce DATA
7 __unwind_info 00003f9c 0000000000344064 DATA
8 __got 00000098 0000000000348000 DATA
9 __const 000061a0 00000000003480a0 DATA
10 __la_symbol_ptr 00000978 0000000000350000 DATA
11 __data 00000278 0000000000350978 DATA
12 __thread_vars 00000030 0000000000350bf0 DATA
13 __thread_bss 00000010 0000000000350c20 DATA
14 __common 000003c0 0000000000350c30 BSS
15 __bss 0000f8f8 0000000000350ff0 BSS
The Mach-O version is missing the .debug_* sections.
Updated by nobu (Nobuyoshi Nakada) almost 3 years ago
I agree that it will help debugging much, but also don't like such directories under bin
and lib
.
I'd love to install them if there is a way to locate them a separate place.
Updated by nobu (Nobuyoshi Nakada) almost 3 years ago
- Status changed from Open to Closed
Applied in changeset git|0b9242ffacd92fe02e640efb8640041e6838cb8b.
[Misc #18153] Install debug symbol files/directories by the option