IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
This script is designed to ignore lines that don't follow the expected
format, but it is widely known that the output format of readelf utility
from the binutils project can be quite unreliable. The output format
may vary on certain architectures and ELFs created with certain build
tools may contain symbols with peculiar bits that affect the output.
Here is a couple of examples illustrating these issues:
* On PowerPC, ELF symbols frequently include the localentry bit.
For instance:
$ readelf --wide --dyn-syms /lib64/libcrypto.so.1.1 | grep ASN1_VISIBLESTRING_new
157: 00000000000938c0 60 FUNC GLOBAL DEFAULT [<localentry>: 8] 11 ASN1_VISIBLESTRING_new@@OPENSSL_1_1_0
* On x86_64, a proprietary blob /usr/lib64/libjcPKCS11ds.so (distributed
as an ELF) and on armh /usr/lib/libLLVM-16.so, contain symbols with
OS-specific bits:
$ readelf --wide --dyn-syms /usr/lib64/libjcPKCS11ds.so | grep _ZNSt7collateIwE2idE
2572: 00000000002df9c8 8 OBJECT <OS specific>: 10 DEFAULT 26 _ZNSt7collateIwE2idE
$ readelf --wide --dyn-syms /usr/lib/libLLVM-16.so | grep _ZN4llvm13AllAnalysesOnINS_6ModuleEE6SetKeyE
45060: 05af0478 8 OBJECT <OS specific>: 10 DEFAULT 26 _ZN4llvm13AllAnalysesOnINS_6ModuleEE6SetKeyE@@LLVM_16
The issue related to PowerPC localentry bits was resolved in the commit
4f4a1d146 ("lib.prov, lib.req: enhance ProvidedSymbols") a long time
ago. The issue related to OS-specific bits was discovered recently [1].
Instead of attempting to resolve the output issues of binutils' readelf
utility concerning OS-specific bits, it is more convenient to use
readelf from elfutils. It has more reliable output (including the
handling of the cases described earlier) and is extensively utilized
within the project anyway.
[1] https://bugzilla.altlinux.org/46447
Reported-by: Konstantin A. Lepikhov <lakostis@altlinux.ru>
Reported-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Fixes: https://bugzilla.altlinux.org/46447
Starting with systemd-239, Exec*= lines of unit files
are no longer required to reference absolute paths.
systemd-services.req, however, was expecting an absolute paths.
Given the new system-update-cleanup.service:
ExecStart=rm -fv /system-update
systemd-services.req used to find "/system-update" requirement:
systemd-services.req: /usr/src/tmp/systemd-buildroot/lib/systemd/system/system-update-cleanup.service: /system-update -> /system-update (raw, not installed)
This change updates systemd-services.req to the new systemd unit files
semantics, and also cleanups the code by removing redundant grep.
`.BTF' section is needed to load kernel modules if
`CONFIG_DEBUG_INFO_BTF_MODULES' is enabled. This requirement is
introduced in Linux commit c446fdacb10d ("bpf: fix
register_btf_kfunc_id_set for !CONFIG_DEBUG_INFO_BTF").
`--keep-section=.BTF' is added also for vmlinux processing, because
commit seems to affect vmlinux (in case of `CONFIG_DEBUG_INFO_BTF').
Encountered error message:
# modprobe nf_nat; dmesg | tail -1
modprobe: ERROR: could not insert 'nf_nat': Unknown symbol in module, or unknown parameter (see dmesg)
[16781.315808] missing module BTF, cannot register kfuncs
Reported-by: Andrew A. Vasilyev <andy@altlinux.org>
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
It means that we support all module compression methods supported by
the modern Linux kernel because the v5.15 version supports gzip-, xz-,
zstd-compressed and uncompressed modules.
SC2162 ("read without -r will mangle backslashes") and SC2086: ("Double
quote to prevent globbing and word splitting"). These actually seem to
be harmless in our case.
While strip is verbose when it fails to process files,
it's not quite obvious that it exits with a non-zero status,
hence an explicit diagnostics message might be useful.
Strip LTO sections and symbols from objects and archives (static
libraries). %brp_strip_none macro is respected.
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
There was two forgotten file instances. Fix error such as:
/root/tmp/rpm-tmp.80ZNEF: line 1: /usr/sbin/post_service: No such file or directory
error: %post(traefik-2.4.14-alt1.x86_64) scriptlet failed, exit status 127
error: traefik-2.4.14-alt1.x86_64: install failed
Fixes: 5ef5c8ff4 ("Use file4 instead of file")
`strip' is called by `install -s` that could occur in unpatched
Makefiles, breaking debuginfo generation.
Try to catch `install` invocations via:
- %__install macro used in `make INSTALL=`.
- Prefix PATH with `/usr/libexec/rpm-build` with install and strip
wrappers.
Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
debugedit sometimes output top level directory, since we do not filter
regular files in process-debuginfo since 309af2d59 ("debuginfo: Create
empty src/debug directories for paths with `..'") we need to filter
them out before passing into %files for debuginfo package.
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Fixes: 309af2d59 ("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
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.
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")
Do not add (uncompressed) module (or vmlinux) into debuginfo package if
it does not actually exists.
Due to other bugs there could be compressed kernel module, (which
implies adding uncompressed module into debuginfo), but, uncompressed
version (which brp-debuginfo should create) does not exist, making
build errors such as:
error: No such file or directory: /usr/src/tmp/kernel-image-std-def-buildroot/usr/lib/debug/lib/modules/5.8.0-std-def-alt1/kernel/fs/nfs/flexfilelayout/nfs_layout_flexfiles.ko
Reported-by: Anton V. Boyarshinov <boyarsh@altlinux.org>
Fixes: 7aa048df ("Generate debuginfo for kernel packages")
`%dir /' would cause errors (ALT#38842):
error: No such file or directory: /usr/src/tmp/broken-debug-buildroot/usr/lib/debug/lib/modules
error: No such file or directory: /usr/src/tmp/broken-debug-buildroot/usr/lib/debug/lib/modules/vmlinux
Reported-by: Vitaly Lipatov <lav@altlinux.org>
BZ: https://bugzilla.altlinux.org/show_bug.cgi?id=38842
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>.
Terminate build if stripped ELF files are found. Usage:
%define _stripped_files_terminate_build 1
Formatting suggestions by Dmitry V. Levin <ldv@altlinux.org>.
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>.
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>
`vmlinux' on ppc appears to have `Dynamic Section', this triggers its
processing with `/usr/lib/rpm/ldd' which returns error:
ldd: ERROR: /usr/src/tmp/kernel-image-std-test-buildroot/usr/lib/debug/lib/modules/5.4.49-std-test-alt4/vmlinux: failed to find the program interpreter
find-requires: ERROR: /usr/lib/rpm/debuginfo.req failed
error: /bin/sh failed
error: Failed to find Requires
Reported-by: Anton V. Boyarshinov <boyarsh@altlinux.org>
Do not try to process ELF relocatable objects that are not kernel
modules, this fixes the following regression:
/usr/lib/rpm/debugedit: ./usr/lib64/gcc/x86_64-alt-linux/9/crtfastmath.o: DWARF version 0 unhandled
objdump: ./usr/lib64/gcc/x86_64-alt-linux/9/crtfastmath.o: bad value
verify-elf: ERROR: ./usr/lib64/gcc/x86_64-alt-linux/9/crtfastmath.o: objdump failed
Fixes: 7aa048df38 ("Generate debuginfo for kernel packages")