Commit Graph

347 Commits

Author SHA1 Message Date
Michal Toman cd02e0675e Add support for MIPS release 6 - Add mips32 mips64 mipsel and mipseb macros 2016-02-19 12:06:39 +01:00
unknown author d39198e14a Transmeta Crusoe is i686
Crusoe CPUs say that their CPU family is "5" but they have enough
features for i686.
(from TurboLinux)
2015-08-28 15:14:50 +02:00
Michal Toman a450ffc4ab Add support for MIPS platform 2015-07-15 10:05:55 +02:00
Panu Matilainen ba5f7cb89a Move rpmrc path defaults tracking into the context as well
- Doesn't make a whole lot of difference, the default variables
  themselves are exported and unprotected... but if nothing else,
  consistencys sake
2014-10-01 15:39:24 +03:00
Panu Matilainen 4ff89adb0d Reset architecture defaults on rpmFreeRpmrc() (RhBug:1115483)
- Move the leftover tracking variable into rpmrc context, reset on
  free to allow personality change after first initialization.
2014-10-01 15:32:41 +03:00
Panu Matilainen cbbfe6388a Fix VFP/Neon detection on armv7
- VFPv3D16 is a specific type of VFP, which AIUI is never a NEON,
  so the test made little sense and, AIUI did not work at all, at
  least for detecting NEON-class system.
  Test for generic VFPv3 support instead (although this doesn't likely
  make a whole lot of sense as AIUI all ARMv7 systems are supposed
  to come with VFPv3 level VFP but guess it doesn't hurt either...)
- The local define for HWCAP_ARM_VFPv3D16 from commit
  5a04330db8 was wrong, (1 << 13) is
  actually HWCAP_ARM_VFPv3. Which is of course exactly what we want here,
  but the commit looks fishy because of this.
- This is all just sooooo wonderfully arbitrary...
2014-07-03 18:11:04 +03:00
Panu Matilainen b52b5b98f2 Only test for ARM FPU on -mfloat-abi=hard builds
- If you dont know, you'll want to keep it that way.
  However if you know this is wrong, let me know...
- If you're still reading, the point here is supposed to be that on ARM
  there are systems with and without a hardware FPU, and then bazillion
  different ABIs which might or might not have to do with the FPU and its
  calling conventions. On any sane system this would be communicated runtime
  via hwcaps but this is ARM so what did you expect? Apparently there is
  a way to get that during runtime by parsing the ELF headers of
  /proc/self/exe but I'll leave that exercise to somebody else. So...
  we only enable the FPU capability tests which determine the arm
  architecture level when we're being compiled to -mfloat-abi=hard.
- If this all sounds crazy and convoluted, I agree. Its also entirely
  possible I've misunderstood some/all of this, uh, subtlety, so dont
  take my word for it. What do I know, I only work here.
- GCC apparently also got this wrong initially, AIUI this
  only works reliably on gcc < 4.5 which dont support hw floating point
  at all, and gcc >= 4.6 where __ARM_PCS_VFP is reliably defined when
  appropriate.
- If you're STILL reading, this glorious one-liner is supposed to
  replace the arch-dependent patch application of the kind of ARM
  detection logic added in commit 2d67ca74c9
2014-06-27 12:29:57 +03:00
Panu Matilainen fd3549fef0 Add detection for Sparc Niagara (aka sun4v, aka sparcv9v / sparc64v)
- Loosely based on similar patch in Fedora, but use hwcap instead
  of parsing /proc/cpuinfo. Untested but hey, its only hardware
  detection. What could possibly go wrong?
2014-06-27 10:57:53 +03:00
Panu Matilainen 5a04330db8 Add copies for the hwcap bits we need in case not present in auxv.h 2014-06-27 10:35:21 +03:00
Lubomir Rintel 2d67ca74c9 Detect arm armv6hl, armv7hl and armv7hnl machines
Read presence of relevant extensions from hwcap. Loosely based on what's
currently in use for Fedora (armv7hl) and Pidora (armv6hl).

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-06-27 10:26:06 +03:00
Panu Matilainen f8868f11d7 Check for sys/auxv.h header, always include if present
- We'll need this to access any HWCAP_* bits for platforms that need it,
  regardless of whether getauxval() is present or not. On glibc
  systems this is likely to be equivalent, on others dunno (Solaris
  appears to have sys/auxv.h header as well)
2014-06-27 10:24:07 +03:00
Panu Matilainen abbf4897db Initialize all the name services we need
- A long time ago in a far away commit, "somebody" had this less than
  brilliant idea that calling gethostbyname() loads all the required
  name service libraries (commit 39b75d24cf).
  This is of course only true if hosts db happens to use the same
  database as passwd and group... which often is the case, but by
  no means guaranteed or always the case.
- Add an explicit initializer for rpmug to force loading the name service
  libraries early in initialization so we dont need to worry about going
  chroot later on. Of course, the "host" name service configuration might
  not actually make sense for the chroot, but this commit doesn't make
  that any worse than it already was.
2014-01-28 09:45:55 +02:00
Tony Breeds ef1497b1f8 rpmrc: Not all linux powerpc builds are big endian.
Without this change rpm incorrectly detects ppc64le systems as ppc64
(or ppc64p7).  Compile time check the Endianness of the build system
to elide these checks on little endian.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-08-21 10:19:10 +03:00
Kirill A. Shutemov 60835b2018 Use getauxval(3) to read auxv data
glibc >= 2.16 provides getauxval(): a reliable way to retrieve a value
from the auxiliary vector. It doesn't rely on /proc filesystem.

Let's switch to it and get rid of /proc dependency.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2013-07-02 12:43:53 +03:00
Panu Matilainen c3a007df80 Bury rpmrc platform path inside defaultMachine(), clarify name 2013-05-23 12:44:24 +03:00
Panu Matilainen 513c7b5808 Move rpmrc platpat into the context and change it into ARGV_t 2013-05-23 10:01:07 +03:00
Panu Matilainen fa25032618 Move rpmrc tables into the context, update related code 2013-05-23 09:56:40 +03:00
Panu Matilainen 787a9ad166 Move rpmrc currTables into the context, update relevant code 2013-05-23 09:52:47 +03:00
Panu Matilainen a000ad6c5f Move rpmrc current array into the context, update relevant code 2013-05-22 17:34:26 +03:00
Panu Matilainen f50ef8c8ec Move rpmrc values table into the context, update relevant code 2013-05-22 17:28:20 +03:00
Panu Matilainen e8c67ce612 Pass rpmrc context around to all internal functions that'll need it
- No functional changes here as we're only paving way for moving
  the real stuff...
2013-05-22 17:26:06 +03:00
Panu Matilainen 418632567c Group exported functions to end of rpmrc.c, no functional changes
- Having the external interfaces together makes it easier to keep
  tracking of locks and all...
2013-05-22 17:16:00 +03:00
Panu Matilainen 87be163dbb Print out our macrofile path on --showrc 2013-04-26 14:05:30 +03:00
Panu Matilainen de39b29572 Eliminate the strange cptr_t "alias" for char *
- Perhaps this had some kind of meaning for the ancient implementors,
  but that meaning has gotten long since lost in the sands of time
  and most likely no longer exists at all...
2013-02-20 13:38:24 +02:00
Panu Matilainen 30e457551a Eliminate the unnecessary rpmGetVar() wrapper function
- Convert the sole user to use rpmGetVarArch() instead...
2013-02-20 11:58:24 +02:00
Panu Matilainen ebe7b1c83a Meep, forgot to acquire locks for rpmFreeRpmrc()
- While adding the outer locks before converting all of internals
  is easier here, it makes it also easier to forget places since
  its not actually forced :-/ oh well...
- Should've been in commit 2870caa14c
2013-02-20 11:57:34 +02:00
Panu Matilainen 2870caa14c Introduce rpmrc context object, use for locking at the outer API
- Similar to the context object in rpmlog, hide the global context
  behind a function call to force controlled context acquisition.
  We're going in the opposite direction here (because its simpler in
  this case): there's nothing but the lock in the context now.
- Acquire and release the context on entry to public API
  entry- and exit points, this should be enough to guarantee basic
  safety (as in "does not crash and burn") wrt threads. Assuming
  there are no hidden writers behind the getter APIs...
- For thread *sanity* all the umphteen globals need to go into the
  context which could be per-thread initialized but that's a longer
  story...
2013-02-20 11:14:51 +02:00
Panu Matilainen b36d4ae0cf Refactor rpmIsKnownArch() for locking friendliness 2013-02-20 10:55:15 +02:00
Panu Matilainen 4a093e4efb Refactor rpmMachineScore() for locking friendliness 2013-02-20 10:53:01 +02:00
Panu Matilainen 7e7564352b Refactor single point of exit for rpmGetArchColor() 2013-02-20 10:41:18 +02:00
Panu Matilainen 2065033a08 Use internal interface for OS and ARCH info in rpmrc.c
- No functional change, just preliminaries wrt locking
2013-02-20 10:36:53 +02:00
Panu Matilainen c47e343aa9 Refactor single exit point for rpmReadConfigFiles() 2013-02-20 10:22:04 +02:00
Panu Matilainen cca91666d0 Failure to initialize crypto is fatal
- Almost nothing works if crypto fails to initialize for whatever reason,
  check and propagate rpmInitCrypto() failure from rpmReadConfigFiles().
- Logging the error left for individual crypto backends to let them
  identify themselves: beecrypt requires no initialization whatsoever
  so it cannot fail at all, but NSS can fail in a number of entertaining
  ways due to missing dlopen()'ed bits and pieces, this should help
  avoiding wild-goose chases in such cases (RhBug:909627, RhBug:909618...)
2013-02-12 05:19:23 +02:00
Panu Matilainen dcd261b9fe Add $RPM_CONFIGDIR/macros.d/ directory to default macro path (RhBug:846679)
- There of course already is a drop-in directory for macro config bits
  in $(sysconfdir)/rpm/ but as /etc is supposed to be per-host admin
  territory, having another place for system package provided rpm config
  doesn't seem unreasonable.
- Whether this early in the path is the best possible or even reasonable
  position for this remains to be seen... but this way it could be used
  for "factory default" config bits by rpm itself as well, while still
  permitting vendor/host/user override.
2012-11-09 08:41:10 +02:00
Phil Knirsch a7248ac1c9 Plain 32bit ppc cannot be a ppc64p7
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2012-06-28 10:15:59 +03:00
Phil Knirsch f9eedd7f69 - Add support for ppc64p7 architecture using new auxv parsing info
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2012-04-17 09:26:03 +03:00
Phil Knirsch 280494cce0 - Add general /proc/self/auxv parsing to rpmrc for better machine detection
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2012-04-17 09:25:53 +03:00
Ales Kozumplik b714dcea37 rpmbuild: warn if header color differs from color of the package architecture.
- For example, warn when building an x86_64 package that only contains 32
  bit binaries.
- This should indicate to the maintainers that they might have gotten the
  architecture wrong.
- Introduces 'archcolor' in rpmrc so we can map architectures to colors.
- Related: RhBug:713323
2012-03-30 13:55:03 +02:00
Panu Matilainen dec729bc3a Eliminate rpmSetTable() from the API
- Presumably the rpmrc internals still need the magic table tennis
  but nobody else should want to mess with this, reconfiguration
  for another (build) arch is done through rpmReadConfigFiles().
2012-03-09 13:13:25 +02:00
Ales Kozumplik ea9d9d68c8 rpmOption.required is not used. 2012-01-04 14:16:59 +01:00
Ales Kozumplik c6a9d0bd60 rpmrc: do not use that nonexistent rpmOptionValue struct. 2012-01-04 14:16:53 +01:00
Panu Matilainen d9063d22f3 Fix up a few strict-prototype warnings on x86 2011-09-15 14:58:19 +03:00
Panu Matilainen aa7a08202c Kick out ppc arch detection leftovers
- This should've been in commit 6e2f56fe25
  all the way back then, unused ever since...
2011-09-15 12:22:55 +03:00
Panu Matilainen 6516a0ffd3 Eliminate hysterical copy-paste comments from rpmrc 2011-09-15 12:06:50 +03:00
Panu Matilainen b61b50cc68 Bit of rpmrc spring-cleaning: nuke detection for some extinct creatures 2011-09-15 12:05:52 +03:00
Panu Matilainen 9f72c7f2cd Eliminate dead NULL-assignments at scope-end in librpm, part III
- Remove NULL-assignments of local variables at the end of scope
  from the low-level helper machinery: fsm, psm, rpmscript and rpmrc
2011-05-28 22:26:39 +03:00
Panu Matilainen 9202f7daa6 Clean up rpmrc include processing a bit
- Eliminate pointless switch-case when we only care about one
  possibility here. Also eliminate a dead-increment which becomes
  more obvious now with the surroundings unobfuscated.
2011-05-27 15:05:22 +03:00
Panu Matilainen e425e75311 Eliminate two dead increments in rpmrc platform processing 2011-05-27 15:05:16 +03:00
Panu Matilainen cf04f4400f Eliminate pointless xx unused error code variable in rpmShowRC()
- An error here from rpmdsRpmlib() would be very much a "can't happen"
  situtation, and there's no point handling it in any special way,
  the loop will silently fall through anyway.
2011-03-04 13:11:22 +02:00
Panu Matilainen b270b38a70 Only force default umask during transaction (RhBug:494440)
- For rpm itself forging global umask on init is kinda convenient, but can
  be troublesome for API users. This is especially bad in python bindings
  where just importing the rpm module silently changes process umask with
  no good reason.
- Instead of global setting on init, only change the umask to 022 default
  for the duration of rpmtsRun() where it's necessary for consistent
  transaction results on implicitly created directories and files created
  by scriptlets. This way we dont affect callers and provide better
  "protection" for ourselves too - we don't know if API users change
  umask again behind our back if we just set it on initialization.
- To make matters more fun, Lua scripts can change our umask. Save
  and restore umask when running Lua scriptlets.
2010-11-18 12:50:55 +02:00