Commit Graph

15 Commits

Author SHA1 Message Date
Gleb Fotengauer-Malinovskiy
7a87954821 process-debuginfo.in: sync xz compression flags with the Linux kernel 2021-11-03 03:11:44 +03:00
Gleb Fotengauer-Malinovskiy
b996912c5d brp-debuginfo.in, process-debuginfo.in: add support for zstd-compressed modules 2021-11-03 03:11:44 +03:00
Gleb Fotengauer-Malinovskiy
b07d68eab5 process-debuginfo.in: rewrite module (de)compression logic
This change makes easier to add support of zstd-compressed modules in
the next commit.
2021-11-03 02:33:13 +03:00
89e3f8b764 Use system provided debugedit
Debugedit is split into a separate package, use it.

References:
  https://sourceware.org/bugzilla/show_bug.cgi?id=27351
  http://lists.rpm.org/pipermail/rpm-ecosystem/2021-February/000734.html
  https://sourceware.org/debugedit/
2021-04-29 22:39:21 +03:00
457fef1d64 debuginfo: strip --reloc-debug-sections for kernel modules
`--reloc-debug-sections` resolves trivial relocs between debug
sections and designed for use on kernel modules debug (.ko.debug)
reducing their sizes.
2020-12-18 03:45:22 +03:00
309af2d59e debuginfo: Create empty src/debug directories for paths with `..'
Create empty directories under `/usr/src/debug` tree for source paths
containing `..` (for example `../../src` in elfutils). This should fix
debuginfo sources for autotools builds in subdir.

Fixes: https://bugzilla.altlinux.org/39175
2020-11-12 22:08:42 +03:00
4738619b15 debuginfo: Allow kbuilds with the output directory
Consider another directory level when searching for vmlinux, for kernel
builds in sub-directory using `make O=output_dir'. Also, improve warning
message making it more understandable.
2020-11-06 15:16:45 +03:00
453b0907f5 debuginfo: Do not try to use eu-elfcompress if it does not exist
Reason: ae1ecef8 ("process-debuginfo: Do not call eu-elfcompress if it doesn't exist")
Fixes: 8682814b ("debuginfo: Try to uncompress if debugedit failed to extract sources list")
2020-08-28 03:09:00 +03:00
8682814b04 debuginfo: Try to uncompress if debugedit failed to extract sources list
If debugedit failed to extract sources list, uncompress and try again.
Then compress back.

ps. Interesting relevant reading:
  https://blogs.oracle.com/solaris/elf_section_compression-v2

Spelling suggestions by Dmitry V. Levin <ldv@altlinux.org>.
2020-08-23 17:02:20 +03:00
a64fcaf7a3 process-debuginfo: Change 'echo Warning' to 'Warning' call
Use dedicated `Warning' function instead of `echo'.

Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
2020-08-21 23:38:49 +03:00
deaca8d8e3 debuginfo: Show warnings if .debug sections are absent
Actually, `.debug_line` section is checked (implicitly by debugedit)
which should go together with all `.debug_*` sections. This
simplification will make check faster.

Note: Only non-stripped binaries are checked.

Spelling fixes, usage of `Warning' function, and redirect to stderr is
suggested by Dmitry V. Levin <ldv@altlinux.org>.
2020-08-21 23:37:05 +03:00
ae1ecef8bd process-debuginfo: Do not call eu-elfcompress if it doesn't exist
E2K arch have old elfutils-0.159 which doesn't have eu-elfcompress.
Error:

  /usr/lib/rpm/process-debuginfo: line 68: eu-elfcompress: command not found

Reported-by: Andrey Savchenko <bircoph@altlinux.org>
2020-07-09 19:23:18 +03:00
ea366ac608 process-debuginfo: Better search for vmlinux
Find first file, in any dir name, three levels max from $RPM_BUILD_DIR.

Fix incompatibility found by building ovz kernel.
2020-07-07 02:09:44 +03:00
f73a3de55c process-debuginfo: Do not eu-elfcompress vmlinux.debug
Allow `crash` (gdb-7.6 based) to work out of the box.

Otherwise it will fail with the error:

  Dwarf Error: wrong version in compilation unit header (is 0, should be 2, 3, or 4)

Alas, it will not be able to load debuginfo for the ko modules, but, advanced
user can `eu-elfcompress -t none` them manually.

We can't keep modules uncompressed due to `cpio archive too big - 4136M'
RPM build error.
2020-07-06 08:48:55 +03:00
5cc014bed6 Process debuginfo in parallel
- Split processing of single binary into separate script.
- Call it from xargs -P.
2020-07-05 01:06:16 +03:00