Commit Graph

87 Commits

Author SHA1 Message Date
Michal Čihař 652ee3c889 installplatform: log when a platform file is created
Eases debugging problems when creating platform files, especially
on exotic architectures
2024-08-06 16:47:42 +02:00
Panu Matilainen 8535694599 Add proper logic for debuginfo enablement
All these years, enabling debuginfo has required distros to hijack the
spec %install section with a macro like this:

    %install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
    %%install\
    %{nil}

This for a widely used, longtime upstream supported feature is just
gross, and also very non-obvious, feeble and whatnot. And totally
prevents the new append/prepend options from being used with %install.

Take advantage of several newish features to make this happen: we need
expressions to properly handle the numeric %_enable_debug_packages value
from a macro, and if enabled, output the debuginfo template as a dynamic
.specpart.

Enable debuginfo on Linux by default in the platform configuration.
Notably noarch should not have debuginfo so it's disabled in the
platform configuration - since 96467dce18
we can now actually rely on the platform configuration being valid,
so we can drop the "%ifnarch noarch" from the debug package check.
Further streamlining should be possible.

Note that the old %install hack MUST BE REMOVED from distros now.

As a nice bonus, this makes debuginfo work for packages that don't use
%setup. Add an explicit test for this in the "rpmbuild %caps" test.
specstep.spec needs to be made noarch here, otherwise it'll now try
to produce debuginfo and fail.

Co-authored-by: Florian Festi <ffesti@redhat.com>

Fixes: #2204
Fixes: #1878
2024-05-13 10:38:09 +02:00
Zoltán Böszörményi fde03ae33d
Allow setting platform macro settings externally (#2585)
* Allow setting platform macro settings externally

By default, rpm installs a series of default platforms based on
the CPU architecture names in subdirectories called

    /usr/lib/platform/<arch>-<os>

This is enough for regular Linux distributions. However, some
distributions may use more specific platform names that refer to
particular computer systems, like SBCs or specific CPU tuning when
compiling.

If the platform subdirectory does not exist in /usr/lib/platform
then rpmbuild does not work.

Allow creating such custom platform subdirectory with feeding
the necessary data using external variables: RPM_CUSTOM_ARCH,
RPM_CUSTOM_ISANAME, RPM_CUSTOM_ISABITS, RPM_CUSTOM_CANONARCH
and RPM_CUSTOM_CANONCOLOR

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>

---------

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Co-authored-by: Florian Festi <ffesti@redhat.com>
2023-07-28 12:16:56 +02:00
Wenlong Zhang a4a0a10b1f Revise ISANAME for loongarch
%_isa is already adding -64. No need to have 64 twice.

Signed-off-by: Wenlong Zhang <zhangwenlong@loongson.cn>
2023-01-11 14:56:29 +01:00
Fabian Vogt cd46c1704c Add x86-64 architecture levels (v2-v4) as architectures
The x86_64 SysV psABI defines four levels of x86_64 with certain CPU
features required for each level. Those definitions are meant to be
generically useful and recognized as such by glibc and gcc as well.

For backward-compatibility and to avoid surprises, default to building
x86_64 even on v2+ capable machines.
2023-01-09 11:05:29 +02:00
Panu Matilainen ada7e2af94 Differentiate autoconf processed replacements from our own
Some of the replacements in platform.in are expected to be processed
by the build system configuration file, whereas others are replaced
by installplatform at the time of install. Use =VAR= notation instead
of @VAR@ to differentiate the latter from the former.

No functional changes, just makes it easier to understand and handle.
2022-06-13 12:05:14 +03:00
zhangwenlong 7a014dae73
Add support for loongarch64
* add support for loongarch64

Signed-off-by: Zhang Wenlong <zhangwenlong@loongson.cn>
2022-01-18 17:16:54 +01:00
Richard W.M. Jones d9d47e0114 RISCV 64-bit (riscv64) support.
Based on Mark Salter's aarch64 support patch (commit 8e1ca16c58).

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2016-08-22 21:16:48 +01:00
Lubos Kardos 5d5dd569d0 Use armv7hl isa for all armhfp (armv7h*l) arches (#1326871)
Patch from Dennis Gilmore <dennis@ausil.us>
2016-05-19 13:12:42 +02:00
Michal Toman cd02e0675e Add support for MIPS release 6 - Add mips32 mips64 mipsel and mipseb macros 2016-02-19 12:06:39 +01:00
Michal Toman a450ffc4ab Add support for MIPS platform 2015-07-15 10:05:55 +02:00
Panu Matilainen 46993cd384 Sometimes a smaller hammer is better (but only sometimes)
- The sed-munger added in commit ccd6281e69
  causes bigger breakage than it fixes, perhaps because the hammer
  applied was disproportionally large. The only thing needing adjustment
  is ${prefix} in case when localstatedir is not explicitly set, so
  we fixup just that instead of "everything".
- Discovered via RhBug:921973 testing
2014-05-09 11:02:19 +03:00
Andreas Schwab bc66cb3480 Add support for m68k
Tested on m68k-suse-linux.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-03-24 10:37:58 +02:00
Tony Breeds cf07feda05 Update support to installplatform and rpmrc for ppc64le
IBM recently announced the OpenPOWER Consortium, part of this initiative
means now powerpc hardware can run the little endian mode.  Create a new
platform for that mode of opperation.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-08-21 10:19:03 +03:00
Panu Matilainen ccd6281e69 Main macros needs similar sed-love on install as platform macros
- Autoconf leaves things like @localstatedir@ unexpanded at build-time
  on purpose so the paths can be overridden during "make install".
  However this leaves %{_var} in macros in its unexpanded state
  unless --localstatedir is explicitly passed in, which does not
  work very well for rpm.
- Process the main macros file through the same meat grinder as
  the platform macros. Ugly as sin but... it brings the casual
  "./configure; make; make check" sequence much closer to working.
2013-03-06 14:35:41 +02:00
Mark Salter 8e1ca16c58 AArch64 support v2
Here is my updated patch adding AArch64 support. The main change was to
use CANONCOLOR=3 rather than 2.

--Mark

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-03-05 06:45:08 +02:00
Panu Matilainen 90dd517432 Fix noarch __isa_* macro filter in installplatform (RhBug:865436)
- The filter wasn't doing what it was supposed to due to extra single
  quotes getting inserted, causing "rpmbuild --target noarch foo.spec"
  to whine about empty macro bodies. This is a regression introduced
  in rpm 4.10, commit 07ec480c18 to be
  precise.
2012-10-11 17:57:10 +03:00
Panu Matilainen 7c39c65da4 Axe leftover CANONARCH assignment messing up our "base" archs (RhBug:808250)
- This should've been in commit 2a8d036697,
  the leftover CANONARCH resets the "base arch" we just set to a wrong
  value.
2012-03-30 10:04:33 +03:00
Panu Matilainen d283046c0a Use canoncolor to determine lib vs lib64 2011-03-25 14:49:05 +02:00
Panu Matilainen 2a8d036697 Push platform config out of main rpm macros file
- canon arch & color stuff is now calculated per each known arch in
  installplatform, and just a single place where arch name mangling
  is done
2011-03-25 14:48:49 +02:00
Panu Matilainen 07ec480c18 Generate platform configuration for all known architectures
- loop over all archs known by rpmrc but only generate the platform config
  if all necessary parameters (such as ISA information) are known, this
  gives a reasonable idea of what archs are *really* in use and supported
- at least in theory, the platform configuration could now move to
  $datadir as the contents no longer depend on which are rpm was built on
- also gets rid of the big sed-monster in install-platform
2011-03-25 14:03:23 +02:00
Panu Matilainen ad0da75a0d Simplify the hysterical per-platform vendor-sed thing 2011-03-25 13:22:53 +02:00
Michal Čihař 8a9e1e34da Fix generating platform config for arm
- We need to generate platform/arm-linux as well, not only all substitutes.
2010-10-06 10:26:37 +03:00
Panu Matilainen 0766138ee9 Minor cleanups to installplatform script
- eliminate unused target and target_platform variables
- eliminate unnecessary temporary rpmrc (used to make a difference when
  macro path was in there, not anymore)
2009-04-22 17:12:37 +03:00
Panu Matilainen d39a6c7de5 Add ISA bits for alpha (Oliver Falk) 2009-03-03 08:49:00 +02:00
Alexandr D. Kanevskiy d55660aaf0 Added ARMv7 architecture support 2009-01-26 10:53:43 +02:00
Panu Matilainen bb45458b6e Include isaname support for arm (Kedar Sovani) 2009-01-08 12:07:54 +02:00
Jindrich Novy 02274eecfc Apply patch for sh arch from CHIKAMA Masaki 2008-10-22 09:22:05 +02:00
Panu Matilainen d34646ab10 Trash more unused junk from installplatform 2008-10-19 20:08:35 +03:00
Panu Matilainen b4d6e18a98 Trash unused MULTILIBNO hackery in installplatform 2008-10-19 19:59:57 +03:00
Panu Matilainen cbbb03e3a3 Trash the horrible brp-sparc64-linux hack from the ancient past
- kludgery like this might've been necessary back in 2000 to get started
  with multilib setup but it certainly isn't needed now
2008-10-17 15:00:01 +03:00
Panu Matilainen 927f384a9b Kick out the dumb defaultdocdir logic from installplatform
- defaultdocdir is simply %{_datadir}/doc
2008-10-17 08:11:10 +03:00
Panu Matilainen 65e06b2013 Tweaks to how ISA-macros are generated (rhbz#464754)
- for ppc and sparc, move the check for 64bit version first and use a
  wildcards to cover more field automatically
2008-10-01 10:06:27 +03:00
Panu Matilainen 97fe9f138e Add ISA-stuff for ia64 2008-07-08 12:59:51 +03:00
Panu Matilainen 48ff62a529 First crack at adding ISA provides to packages (rhbz#235755)
- Horrible kludgery to get the isa names and bits into platform specific
  macros from installplatform script. That beast needs to die. I mean really

- In build, add provides: name(isa) = evr automatically when it makes
  sense (similarly to name = evr provides). ISA consists of ISA name and
  bitness (or wordsize). This can be used to correctly
  express multilib dependencies without resorting to (expensive!) file
  dependency kludges, eg for dlopen()'ed libraries where automatic
  dep extraction doesn't force dependency on 32bit vs 64bit version, you
  can now use:
      Requires: foo-plugin%{?_isa}
  This expands to foo-plugin(x86-32) for i?86 packages, foo-plugin(x86-64)
  to x86_64 etc, and permits spec to be shared with older distros which
  don't have ISA provides.

- The same could be expressed with "canon arch" just as well, but
  using the ISA to differentiate from %_arch and the like:
  eg i386 could be used instead of x86-32 but it's overloaded with meanings
  (the actual i386 processor vs i386 compatible cpu family etc)
2008-04-10 19:36:03 +03:00
Panu Matilainen 61189cb868 Add super-H arch support (rhbz#432496)
Patch from Masaki Chikama
2008-03-04 08:16:02 +02:00
Panu Matilainen db3f67ed5b Fix platform dir creation, doh 2008-02-01 20:28:31 +02:00
Panu Matilainen 7a77e1fd9f Move platform specific macros under RPMCONFIGDIR/platform/
- reduce the clutter in RPMCONFIGDIR, nicer for packaging too..
2008-02-01 20:18:23 +02:00
Panu Matilainen f2c6bef540 Urgh, add geode to x86_64 secondary arch subst-crack... 2008-01-25 17:33:35 +02:00
Panu Matilainen acf2fef308 Hackery to get secondary arch macros included on x86_64 (rhbz#194123) 2008-01-25 12:20:56 +02:00
Panu Matilainen 240b2d3441 Add support for Geode CPU (rhbz#428979)
Patch from Dennis Gilmore
2008-01-19 11:40:59 +02:00
Panu Matilainen 6ea6e02bdf Fix installplatform now that rpmrc no longer contains macrofiles 2007-09-07 12:09:11 +03:00
Panu Matilainen 3ba25ca399 Add Sparc Niagara support (rhbz#263521)
Patch from Dennis Gilmore.
2007-09-05 16:11:04 +03:00
Panu Matilainen 0d71bb125f Create x86_64 compat macros for ia32e and amd64 (rhbz#211119, 223355) 2007-08-28 09:10:11 +03:00
Panu Matilainen b0fcfbb19b Couple of ARM-related typo fixes from Lennert Buytenhek. 2007-08-06 14:47:43 +03:00
Panu Matilainen 82885665ce ARM arch update.
Adds more ARM sub-archs, and adds some bits to deal properly with the new
ARM ABI (EABI). Patch from  Lennert Buytenhek.
2007-06-21 15:13:04 +03:00
jbj 84d6a9cac5 macosx/opendarwin hackery, take 1.
CVS patchset: 7710
CVS date: 2005/01/25 05:24:40
2005-01-25 05:24:40 +00:00
arekm 9c20832828 Do amd64-linux|ia32e-linux, too.
CVS patchset: 7322
CVS date: 2004/06/14 16:50:14
2004-06-14 16:50:14 +00:00
arekm b07c0fbce4 pentium3/pentium4 support by Pawe³ Sikora <pluto/at/pld-linux.org>.
Modified Files: installplatform macros.in rpmrc.in lib/rpmrc.c lib/rpmts.c

CVS patchset: 7198
CVS date: 2004/03/28 02:41:32
2004-03-28 02:41:32 +00:00
jbj 752cac72e2 - only internal Berkeley db from now on.
- revive "make dist".

CVS patchset: 6971
CVS date: 2003/12/11 19:09:58
2003-12-11 19:09:58 +00:00