Commit Graph

698 Commits

Author SHA1 Message Date
Florian Weimer
f824dc72a1 buildflags.md: Document LTO and how to disable it 2021-11-15 15:44:56 +01:00
Florian Weimer
4a0c38832e buildflags.md: Document build_cc, build_cxx, build_cpp 2021-11-15 15:34:32 +01:00
Florian Weimer
a9123ea1ac buildflags.md: Move toolchain selection documentation from macros file 2021-11-15 15:34:15 +01:00
Florian Weimer
ac57cc99aa buildflags.md: Mention optional -fcommon under compiler flags 2021-11-15 15:26:05 +01:00
Florian Weimer
92959df563 buildflags.md: Document _ld_as_needed, --as-needed 2021-11-15 15:25:49 +01:00
Florian Weimer
76114fa60e buildflags.md: Document -mbranch-protection=standard for aarch64 2021-11-15 12:32:38 +01:00
Florian Weimer
92261d7c20 buildflags.md: Drop mentions of ppc64
The ppc64 architecture is no longer built.
2021-11-15 12:31:16 +01:00
Ville Skyttä
8a2e388e10 dist.sh: use grep -E instead of egrep
`egrep` has been deprecated in GNU grep since 2007, and in current
post 3.7 Git it has been made to emit obsolescence warnings:
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1
2021-11-13 15:16:45 +02:00
Michal Domonkos
cf47bde9b6 Drop {fpc,gnat,nim}-srpm-macros deps on RHEL
We did this in RHEL-8 [1] so let's not re-introduce the packages in RHEL-9.

Previously, we did that by keeping a downstream-only patch - let's just
have a conditional here, to make the maintenance simpler.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1588575
2021-11-09 15:27:54 -06:00
David Benoit
ac2ca1dbba
Add llvm-lto-elf-check script
The brp-llvm-compile-lto-elf script uses PCRE in grep to match
for the -flto flag in bitcode object dumps, using negative
lookahead to exclude the case where -fno-lto is specified after.
When lines in the bitcode dump exceed the length that PCRE can
match against, grep will error out causing brp-llvm-compile-lto-elf
to fail.

This script implements an equivalent regex match in python to avoid
the limit in PCRE grep.

Resolves: rhbz#2017193
2021-11-08 11:52:34 -05:00
Jason Tibbitts
804722591a Release and changelog. 2021-11-01 16:49:51 -05:00
Jason Tibbitts
4cf75bdaf9 Add better error checking to %constrain_build 2021-11-01 16:35:33 -05:00
Jason Tibbitts
4a171cb3bf Release and changelog entry 2021-10-19 20:11:39 -05:00
Jason Tibbitts
9131051920 Add %constrain_build macro
Adds a simple macro which limits the CPU count which is used in the
various build-related macro.  Using this macro at the beginning of the
specfile to limit the CPU count directly, or to set the CPU count based
on the amount of memory in the system and a "job size".

The default action if no options are provided is to limit builds to a
single CPU.
2021-10-19 20:11:39 -05:00
Miro Hrončok
71f61e78a9 CI: Rebuild redhat-rpm-config to assert we did not break the world 2021-10-19 22:54:13 +00:00
Tom Stellard
17a3cd024b Drop annobin-plugin-clang dependency
The annobin clang plugin is not actually used anywhere, so we don't
need to have a dependency on it.

This was also creating a circular dependency that was blocking the
latest clang update.
2021-09-21 18:23:33 +00:00
Florian Weimer
2dd8d4cbdf ELN: Enable -march=x86-64-v2 for Clang as well 2021-08-30 14:45:07 +02:00
Tom Stellard
3ec329b234 Add build_ prefix to cc, cxx, and cpp macros
RPM requires macros to be at least 3 characters, so we need to
rename the cc macro anyway and using the build_ prefix is consistent
with other macros like build_cflags.
2021-08-17 21:15:06 +00:00
Tom Stellard
73aefaaac7 Add cc, cxx, and cpp macros
These macros are being added as part of this Fedora change:
https://fedoraproject.org/wiki/Changes/CompilerPolicy
2021-08-16 16:41:58 +00:00
Michel Alexandre Salim
43dfe7d6f0 Fix macros.build-constraints' %limit_build
number of CPUs will never be set to less than 1
  this now outputs build flag overrides to be used with %make_build etc.
  add documentation

Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org>
2021-08-15 13:39:55 -07:00
Florian Weimer
bc8fa85e90 Active GCC plugin during LTO linking
See the downstream bug for details:

  https://bugzilla.redhat.com/show_bug.cgi?id=1983727
2021-08-02 12:43:26 +02:00
Michel Alexandre Salim
dbb1278523 Add macros.build-constraints
Keep the misc macros in alphabetical order

Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org>
2021-07-24 14:58:08 -07:00
e0cfcc0fc7 Make vpath builddir not include arch-specific info
A number of cases have cropped up where things like documentation
builds fail with out of tree builds because tools like Doxygen like
encoding the build path into the documentation metadata.

This causes failures in Koji and other places where noarch documentation
subpackages from archful packages fail because they fail the comparison
check due to this.
2021-07-10 09:43:26 -04:00
Miro Hrončok
cfdc80c51a Require python-srpm-macros with Python related BuildRoot Policy scripts 2021-07-08 12:56:48 +02:00
Miro Hrončok
74e11b4fa8 Move Python related BuildRoot Policy scripts from redhat-rpm-config to python-srpm-macros
This allows us to maintain our own BuildRoot Policy scripts in an easier way.

This change needs to be coordinated with the addition of the files to python-srpm-macros.

redhat-rpm-config requires python-srpm-macros, so no significant change is expected for the packagers.

This also moves the Python BRPs to the end of the list which should be fine.
2021-07-08 12:56:15 +02:00
Ben Burton
fdce9c67af Adapt macros and BRP scripts for %topdir with spaces
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1947416
2021-06-28 11:33:07 +02:00
Panu Matilainen
def9a339d2 Drop reference to now extinct brp-python-hardlink script
The script was dropped in rpm 4.17.0 beta1, so we can't very well
try to use it on builds. For now I'm intentionally dropping just the
macro definition: in case the Python community wants to bring it
back, all they need to do is revive the script and add the macro
definition for it.
2021-06-22 15:57:21 +03:00
Stephen Coady
bd8637f7c3 add Requires: rpmautospec-rpm-macros
Signed-off-by: Stephen Coady <scoady@redhat.com>
2021-06-08 11:17:40 +01:00
Charalampos Stratakis
139bc590fb Enable RPATH check after %install
Part of https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild

Resolves: rhbz#1964548
2021-05-31 17:39:22 +02:00
Arjun Shankar
b6b865f3d5 Disable annobin on armv7hl
On armv7hl, enabling annobin can in some cases lead to corrupt unwind
information in generated object files:
https://bugzilla.redhat.com/show_bug.cgi?id=1951492

The root-cause of this is still unclear and until this is sorted out,
it is best to disable annobin on the architecture.
2021-05-26 21:36:44 +02:00
Nick Clifton
7581d21caa Change 'Requires: annobin' to 'Requires: annobin-plugin-gcc'. 2021-04-14 16:01:37 +00:00
Marek Marczykowski-Górecki
3d7758a2f0 Use _changelog_trimage instead of _changelog_trimtimeUpdate macros
_changelog_trimtime is deprecated in favor of _changelog_trimage.
Furthermore, _changelog_trimage is relative to the newest entry
instead of the build time - which helps with package reproducibility.
Details:
 - https://github.com/rpm-software-management/rpm/commit/a587258
 - https://bugzilla.redhat.com/1722806
2021-04-14 15:59:48 +00:00
David Benoit
391eca3508 add brp-llvm-compile-lto-elf 2021-04-06 21:25:50 -04:00
Lumir Balhar
27a8c7a7c2 Fix handling of files without newlines in brp-mangle-shebang
If the file we are trying to mangle a shebang in has
0 lines (as reported by `wc`) `read` command fails
to read the first line and the script fails silently.

Text files without newlines should not be executable as there
is no way for them to contain a shebang.
2021-03-22 14:33:37 +01:00
Kalev Lember
61b19ee1b2 BRP Python Bytecompile: Avoid hardcoding /usr/bin prefix for python
Avoid using the full path and instead rely on PATH being correctly set
up to find the executable.

This fixes byte compilation for python2.7 when doing flatpak module
builds where python2.7 can be in either /usr/bin or /app/bin, depending
on how it's compiled.
2021-03-10 21:30:12 +01:00
Tom Stellard
de1fe58a50 Add some gating CI tests 2021-01-19 22:17:21 +00:00
Florian Weimer
d8287391e7 Use -march=x86-64-v2 only for the gcc toolchain
LLVM 12 is required for -march=x86-64-v2.
2021-01-19 20:34:39 +01:00
Florian Weimer
0ce9e05ca9 x86_64: Enable -march=x86-64-v2 for ELN, following GCC. 2021-01-19 20:10:22 +01:00
Miro Hrončok
c0fba28f76 BRP Python Bytecompile: Also detect Python files in /app/lib/pythonX.Y
This is needed for flatpaks.

Alternatively, we could pass %{_prefix} as an argument to this script,
but that could make things a tad more complicated.

This solution is less general, but more pragmatic.

See https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/4FBBB3C5E63VDNGUJRLLW27LPZ74SEJH/
2020-11-29 17:44:37 +01:00
Tom Stellard
f97705d6fd Add back -fcf-protection flag for x86_64
This was accidentally removed in c18bafdecc.
2020-10-27 13:35:19 +00:00
Florian Weimer
5c9060a85e s390x: Tune for z14 (as in Red Hat Enterprise Linux 8) 2020-10-20 12:23:29 +02:00
Florian Weimer
6854161259 Fix another syntax issue in the macros file 2020-10-05 14:30:56 +02:00
Florian Weimer
e6fe6513ee Fix syntax error in macros file 2020-10-05 14:09:46 +02:00
Florian Weimer
db291b8b29 redhat-rpm-config 173-1 2020-10-05 13:43:07 +02:00
Florian Weimer
9bbf519889 s390x: Switch Fedora ELN to z13 baseline
This matches Red Hat Enterprise Linux 8.  Reportedly, the Fedora
infrastructure is ready for this change.
2020-10-05 13:38:25 +02:00
Miro Hrončok
0d621460ce Filter out LTO flags from %%extension flags macros
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1877652
2020-09-11 20:42:36 +02:00
Michel Alexandre Salim
ee8888f636 Add Requires: lua-srpm-macros
Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org>
2020-09-02 19:03:55 -07:00
Tom Stellard
c18bafdecc Enable -fstack-clash-protection for clang on x86, s390x, and ppc64le
This is supported with LLVM >= 11
2020-08-21 16:50:54 +00:00
Igor Raits
72a5199a5f
Fixup changelog
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-08-20 19:05:06 +02:00
Tom Stellard
d698d04313
Add -flto to ldflags for clang toolchain
Also, add a gating CI tests to ensure that future macro changes work
with clang.
2020-08-20 19:03:54 +02:00