Commit Graph

2275 Commits

Author SHA1 Message Date
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
aba565d889 debuginfo: Implement %_stripped_files_terminate_build
Terminate build if stripped ELF files are found. Usage:

  %define _stripped_files_terminate_build 1

Formatting suggestions by Dmitry V. Levin <ldv@altlinux.org>.
2020-08-23 17:01:20 +03:00
1f5bc5f866 debuginfo: Warn if stripped ELFs are found 2020-08-23 17:00:58 +03:00
5b7f0b0e50 4.0.4-alt147
- debuginfo: Show warnings if .debug sections are absent.
2020-08-21 23:38:49 +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
0175090680 4.0.4-alt146
- brp-debuginfo: Re-enable processing of kernel modules.
- debuginfo.req: Fix 'vmlinux' processing error on ppc64le.
- process-debuginfo: Do not call eu-elfcompress if it doesn't exist.
2020-07-09 19:23:18 +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
30d528d7bc debuginfo.req: Fix 'vmlinux' processing error on ppc64le
`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>
2020-07-09 19:23:18 +03:00
ce2db3795b brp-debuginfo: fix thinko in the previous fix
Re-enable processing of ELF relocatable objects that *are* kernel modules.

Reported-by: Vitaly Chikunov <vt@altlinux.org>
Fixes: d71728c2c8 ("brp-debuginfo: fix handling of packages containing
ELF relocatable objects")
2020-07-09 08:00:00 +00:00
3d92ea81b8 4.0.4-alt145
- brp-debuginfo: fixed regression (in handling of packages containing
  ELF relocatable objects) introduced in 4.0.4-alt142.
2020-07-08 08:00:00 +00:00
d71728c2c8 brp-debuginfo: fix handling of packages containing ELF relocatable objects
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")
2020-07-08 08:00:00 +00:00
6eb60d94cf 4.0.4-alt144
- debuginfo: Fix processing of hard-linked binaries.
2020-07-07 13:44:54 +03:00
50705f69b7 debuginfo: Fix processing of hard-linked binaries
while-end output into the pipe forgets all set inside variables.

Error message:

  ln: .debuginfo/src/: hard link not allowed for directory
2020-07-07 13:44:03 +03:00
3cc270f50e 4.0.4-alt143
- debuginfo: Improve search for vmlinux binary.
2020-07-07 02:10:01 +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
3bd1e2675b 4.0.4-alt142
- Generate debuginfo for kernel packages.
- Process debuginfo in parallel using process-debuginfo script.
- debugedit -n to avoid recomputing build-id.
2020-07-06 08:48:55 +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
1f2ad272a1 debugedit: Add -n to avoid recomputing of build-id
Avoid `DWARF version 0 unhandled' for compressed ELFs in
find-debuginfo-files.

Based on 6e9fd97f6 ("debugedit: Add -n, --no-recompute-build-id.")
by Mark Wielaard <mark@klomp.org>.
2020-07-05 01:06:16 +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
7aa048df38 Generate debuginfo for kernel packages
- Support uncompressed (std-def) and compressed (un-def) modules. Also,
  support xz(1) compression if we'd switch to it.
- If module is uncompressed it stays in the kernel-image rpm, if it's
  compressed then uncompressed module goes into /usr/lib/debug tree and
  will be in debuginfo rpm. Compressed modules will be re-compressed after
  stripping.
- vmlinuz binary triggers extraction of vmlinux from the kernel-source
  tree, and it's then placed into /usr/lib/debug tree, then processed and
  stripped as usual.
- Logic of processing of vmlinux binary for domU packages is not changed.
  Some flavours do not even pack it. Thus, do not remove your
  `%brp_strip_none'.
- Output of file(1) for vmlinuz is only parsed for filename, because, on
  different architectures it detects completely different things.
- Debug files are compressed with `eu-elfcompress'.
- You still need to enable `CONFIG_DEBUG_INFO=y' in for `.config'.
  No other changes to spec should be needed.

Thanks to Nikita Ermakov for starting this work.
2020-07-05 01:06:16 +03:00
Ivan Zakharyaschev
019977a4d4 4.0.4-alt141
- Added /usr/lib/rpm/armv8l-alt-linux/macros for builds on armv8l machines.
  (Fixes 4.0.4-alt108:
  - installplatform, rpmrc.in: made armv8l compatible with armh.)
2020-07-03 14:42:32 +03:00
Ivan Zakharyaschev
d86252b853 checkinstall subpkg: add the new quick rpminstall-tests-archcompat-checkinstall 2020-07-03 14:42:32 +03:00
Ivan Zakharyaschev
ffd516be0e rpmrc.in: inessential tweaks to follow upstream rpmrc.in more closely
* * *

Add arch_canon statements for "armh", "armv7l", "armv8l". Re-order
them to be more similar to the current upstream rpmrc.in (say,
rpm-4.15 or rpm-4.13.0.1-alt22). Note, however, that this change
doesn't seem to be essential for anything, since "the arch in the lead
[the arch number] is not used for any purpose for most of this
century".[1]

[1]: https://stackoverflow.com/a/39426935/94687 "answer by Jeff Johnson"

* * *

Re-order ARM arch_compat statements to get an order similar to the
upstream (say, rpm-4.15 or rpm-4.13.0.1-alt22) to be able to compare
them more easily; compare to our rpmrc.in:

* the upstream first lists the big-endian archs (noarch -> armv4b);
* then the little-endian ones without hardfloat (noarch -> armv3l -> armv4l ->
  -> armv4tl -> armv5tl -> armv5tel -> armv5tejl -> armv6l -> armv7l -> armv8l);
* the the little-endian ones with hardfloat
  (noarch -> armv6hl -> armv7hl -> armv7hnl -> armv8hl);
* and separately the 64-bit one (noarch -> aarch64).

In our version of rpm-build we don't have any code for the detection
of the 'h' (hardfloat) or 'n' (neon) CPU features, but we actually
insert our "armh" arch into this chain (with 'h' hardfloat) between
what ought to be "armv6hl" and "armv7hl", and drop "armv6hl" from our
chain; in our compatibility chain, 'h' is silently supposed for "armv7l"
and "armv8l".

However, note a bad thing about this discrepancy: when our rpm-build
builds a package on armv8l targeting this arch, it's arch is armv8l.
However, when installing such a package on a normal ARMv8-A machine,
the 'h' feature must have been detected by "rpm -i", so our just built
package must not match the system arch and the installation must be
denied. However, in practice, I don't see such bad behavior in our
Girar builder when rpminstall-test-archcompat-checkinstall is
invoked... (I don't know why. Perhaps, the 'h' detection code doesn't
work as expected in rpm.)

* * *

Re-order similarly buildarch_compat statements.
2020-07-03 14:42:32 +03:00
Ivan Zakharyaschev
9e9b1c497f macros.in: %%arm += armv8l; rpmrc.in: optflags for armv8l target added
Targeting armv8l should trigger all the general ARM conditions in
specfiles and set the custom optflags.

Fixes: c18f1b7d ("installplatform, rpmrc.in: made armv8l compatible with armh")
2020-07-03 14:42:11 +03:00
Ivan Zakharyaschev
142f0fa117 installplatform: drop unsused variables from the script 2020-06-28 19:23:11 +03:00
Ivan Zakharyaschev
6ca12cdba9 add /usr/lib/rpm/armv8l-alt-linux/macros for builds on armv8l machines
If rpmbuild is invoked without --target, it looks for the macros based
on `uname -m`. The resulting error message on armv8l machines (when
building a noarch package) was like this:

> Invalid or unknown architecture: noarch-alt-linux
> Executing(%install): /bin/sh -e /tmp/sh.txFqhrP3/rpm-tmp.63120
> error: Bad exit status from /tmp/sh.txFqhrP3/rpm-tmp.63120 (%install)

--a bit misleading due to the following fallback code from macros.in
being executed:

    %___build_pre	\
    %{warn:Invalid or unknown architecture: %{_target_cpu}-%{_vendor}-%{_target_os}\
    }exit 1\
    %nil

(Are there additional customizations that we might want to enable on
armv8l compared to our armv7l or armh configuration?

armv8l means having AArch32 architecture, typically on a CPU with
AArch64, too. AArch32 means that A32 (ARM) and T32 (Thumb-2)
instruction sets are admitted. See, e.g.,
<https://bgamari.github.io/posts/2019-06-12-arm-terminology.html>.

Currently, our armv8l-alt-linux/macros won't differ essentially from
armv7l-alt-linux/macros. Probably, that's fine, because it seems that
all ARMv8 and all ARMv7 processors support Thumb-2 instructions in the
T32 instruction set, so there are no essential differences in the
optimizations that can be applied.)

Reported-by: Vitaly Chikunov <vt@altlinux.org>
Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
Fixes: c18f1b7d ("installplatform, rpmrc.in: made armv8l compatible with armh")
2020-06-28 19:22:55 +03:00
Andrew Savchenko
7f9d1409c8
4.0.4-alt140
- Export FCFLAGS as modern FFLAGS replacement for gfortran.
2020-05-29 11:50:29 +03:00
Andrew Savchenko
dae6334333
Export FCFLAGS as well as FFLAGS
FCFLAGS is modern replacement of FFLAGS for gfortran.
Details can be found in [1].

Modern Fortran applications use FCFLAGS instead of FFLAGS, so we have
them built without platform-specific and general optimizations.
As an example one may look how libgfortran is being built within gcc-9:
libgfortran/Makefile.in uses only FCFLAGS, not FFLAGS and mary other
applications follow.

[1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Fortran-Compiler.html
2020-05-29 11:46:12 +03:00
48b14cf1b8 4.0.4-alt139
- ldd.in: made preloading of PIE objects work again.
- Set the value of SOURCE_DATE_EPOCH environment variable (if any)
  as the source package buildtime.
2020-04-21 17:37:55 +00:00
56058a3e7d ldd.in: make preloading of PIE objects work again
glibc starting with commit glibc-2.30~85
(elf: Refuse to dlopen PIE objects [BZ #24323])
no longer supports preloading of PIE objects.

Workaround this by swapping the target object and the preloading
PIE object when possible.

Reported-by: ALT beekeeper
Reported-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
2020-04-21 17:37:55 +00:00
d304554617 packageSources: override RPMTAG_BUILDTIME with $SOURCE_DATE_EPOCH
When hasher generates an src.rpm from pkg.tar, it sets $SOURCE_DATE_EPOCH
according to pkg.tar's specfile modification time which in turn is set to
the corresponding commit time.

When hasher builds from an src.rpm, it sets $SOURCE_DATE_EPOCH according
to the src.rpm's RPMTAG_BUILDTIME.

This changes helps to connect these two stages, setting the
RPMTAG_BUILDTIME of the generated src.rpm to $SOURCE_DATE_EPOCH.

Co-Authored-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
2020-04-21 15:54:47 +00:00
Alexey Tourbin
7c77534fe7 4.0.4-alt138
- find-package, shebang.req: introduced RPM_FINDPACKAGE_MANDATORY=1.
  When an interpreter is invoked by name, as in "#!/usr/bin/env python32",
  and is missing, this will now force the dependency on /usr/bin/python32.
2020-04-07 11:11:19 +03:00
Alexey Tourbin
75b044f2cb find-package, shebang.req: introduced RPM_FINDPACKAGE_MANDATORY=1 2020-04-07 11:05:34 +03:00
6c3490a2cf 4.0.4-alt137
- Fixed %autopatch and %patch regression introduced in previous release.
2020-01-04 10:43:44 +00:00
252df9b61a Fix %patch and %autopatch
* build/parsePrep.c (doPatch): Do not pass null pointer to sprintf.
(doAutopatchMacro): Do not pass null pointer to strcmp.

Fixes: 9c18a402 ("Make %autopatch and %patch accept -pg")
2020-01-04 10:43:44 +00:00
6da99494b5 4.0.4-alt136
- Generate requirements on binaries used in systemd service files
  (by Anton V. Boyarshinov)
- Made %autopatch and %patch accept -pg (by Vladimir D. Seleznev).
- Fixed build with new gettext.
2020-01-03 19:33:48 +00:00
a7ed02398b spec: fix license tags 2020-01-03 19:33:48 +00:00
915bc8b5ff spec: remove %if 0'd parts
... because they confuse rpmspec.
2020-01-03 19:33:48 +00:00
0954baaf05 Remove AM_INTL_SUBDIR
This macro is no longer exported by gettext.
2020-01-03 19:33:48 +00:00
Anton V. Boyarshinov
54a2ca259c Auto-requies on binaries used in systemd .service files added 2019-12-26 14:09:03 +00:00
9c18a40269 Make %autopatch and %patch accept -pg
* parsePrep.c (doPatch): Change strip argument type to const char *.
(doPatchMacro, doAutopatchMacro): Change opt_p variable type to char *,
change checking of opt_p: it can be either a number or a 'g' symbol
assuming that -pg is a valid option for patch command.
2019-12-15 21:57:32 +00:00
b0a545f593 4.0.4-alt135
- Fixed build with glibc >= 2.28.
2019-11-24 11:58:18 +00:00
90d5486688 Check for cookie_io_functions_t provided by stdio.h
Do not check for libio.h, it's not included anyway.
Check for cookie_io_functions_t and conditionalize
on HAVE_COOKIE_IO_FUNCTIONS_T instead.
2019-11-24 11:58:18 +00:00
5133ad68aa setcmp: use 'm' instead of 'a' as the assignment-allocation modifier
Support for the 'm' modifier was added to glibc starting with version 2.7,
programs should use that modifier instead of 'a'.
2019-11-24 11:58:18 +00:00
fdd98a7997 Replace all uses of _IO_off64_t with off64_t
Mechanically substitute _IO_off64_t with off64_t using
$ git grep -Fwl _IO_off64_t |xargs -r sed -i s/_IO_off64_t/off64_t/g

This follows glibc-2.28~574 and fixes build with glibc >= 2.28.
2019-11-24 11:58:18 +00:00
9977eae223 4.0.4-alt134
- Backported RPMTAG_VCS support from rpm.org.
2019-11-01 16:16:23 +00:00
Colin Walters
8e0d85c61e Add 'VCS' key
Spec files have a lot of metadata about a project.  However one of the
most key components is the upstream version control system which was
notably lacking.

Resolve this by adding a "VCS" key.  There is no specification
for contents of this key, given that the set of version control
systems (and features thereof) are not well-defined.  However,
recommendations are:

 * git: This URL should be in a form that can be passed to "git clone",
   with the additional feature that an optional fragment identifier "#foo"
   denotes a branch or tag.
2019-11-01 16:16:23 +00:00
ee9e17c3ad 4.0.4-alt133
- Added %autopatch support.
2019-10-03 21:19:34 +03:00
efe5536cfe build: add %autopatch support
%autopatch is a directive to apply all patches, it supports -p<num> and
-F<num> options

%autopatch was initially introduced in rpm.org with version 4.11 but with
different implementation.
2019-10-03 21:14:18 +03:00