Read presence of relevant extensions from hwcap. Loosely based on what's currently in use for Fedora (armv7hl) and Pidora (armv6hl). sys/auxv.h inclusion is made unconditional -- HAVE_GETAUXVAL signals presence of getauxval() call, not the header and AT_* macros defined from it are already used unconditionally anyways. Signed-off-by: Lubomir Rintel <lkundrak@xxxxx> --- lib/rpmrc.c | 17 ++++++++++++++--- macros.in | 2 +- rpmrc.in | 17 +++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/lib/rpmrc.c b/lib/rpmrc.c index fab9339..c93c6a2 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -20,9 +20,7 @@ #define __power_pc() 0 #endif -#ifdef HAVE_GETAUXVAL #include <sys/auxv.h> -#endif #include <rpm/rpmlib.h> /* RPM_MACTABLE*, Rc-prototypes */ #include <rpm/rpmmacro.h> @@ -734,7 +732,6 @@ exit: return rc; } - # if defined(__linux__) && defined(__i386__) #include <setjmp.h> #include <signal.h> @@ -1137,6 +1134,20 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os) # endif /* __ORDER_BIG_ENDIAN__ */ # endif /* ppc64*-linux */ +# if defined(__linux__) && defined(__arm__) + if (rstreq(un.machine, "armv7l")) { + if (rpmat.hwcap & HWCAP_ARM_VFPv3D16) { + if (rpmat.hwcap & HWCAP_ARM_NEON) + strcpy(un.machine, "armv7hnl"); + else + strcpy(un.machine, "armv7hl"); + } + } else if (rstreq(un.machine, "armv6l")) { + if (rpmat.hwcap & HWCAP_ARM_VFP) + strcpy(un.machine, "armv6hl"); + } +# endif /* arm*-linux */ + # if defined(__GNUC__) && defined(__alpha__) { unsigned long amask, implver; diff --git a/macros.in b/macros.in index 2805024..2ada48b 100644 --- a/macros.in +++ b/macros.in @@ -1001,7 +1001,7 @@ done \ #------------------------------------------------------------------------------ # arch macro for all supported ARM processors -%arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l +%arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl #------------------------------------------------------------------------------ # arch macro for all supported Sparc processors diff --git a/rpmrc.in b/rpmrc.in index 4dd2e68..20b531a 100644 --- a/rpmrc.in +++ b/rpmrc.in @@ -67,7 +67,11 @@ optflags: armv4tl -O2 -g -march=armv4t optflags: armv5tel -O2 -g -march=armv5te optflags: armv5tejl -O2 -g -march=armv5te optflags: armv6l -O2 -g -march=armv6 +optflags: armv6hl -O2 -g -march=armv6 -mfloat-abi=hard -mfpu=vfp + optflags: armv7l -O2 -g -march=armv7 +optflags: armv7hl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 +optflags: armv7hnl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=neon optflags: m68k -O2 -g -fomit-frame-pointer @@ -184,7 +188,10 @@ arch_canon: armv4l: armv4l 12 arch_canon: armv5tel: armv5tel 12 arch_canon: armv5tejl: armv5tejl 12 arch_canon: armv6l: armv6l 12 +arch_canon: armv6hl: armv6hl 12 arch_canon: armv7l: armv7l 12 +arch_canon: armv7hl: armv7hl 12 +arch_canon: armv7hnl: armv7hnl 12 arch_canon: m68kmint: m68kmint 13 arch_canon: atarist: m68kmint 13 @@ -297,7 +304,10 @@ buildarchtranslate: armv4tl: armv4tl buildarchtranslate: armv5tel: armv5tel buildarchtranslate: armv5tejl: armv5tejl buildarchtranslate: armv6l: armv6l +buildarchtranslate: armv6hl: armv6hl buildarchtranslate: armv7l: armv7l +buildarchtranslate: armv7hl: armv7hl +buildarchtranslate: armv7hnl: armv7hnl buildarchtranslate: m68k: m68k @@ -392,6 +402,9 @@ arch_compat: armv5tel: armv4tl arch_compat: armv4tl: armv4l arch_compat: armv4l: armv3l arch_compat: armv3l: noarch +arch_compat: armv7hnl: armv7hl +arch_compat: armv7hl: armv6hl +arch_compat: armv6hl: noarch arch_compat: m68k: noarch @@ -505,6 +518,10 @@ buildarch_compat: armv4tl: armv4l buildarch_compat: armv4l: armv3l buildarch_compat: armv3l: noarch +buildarch_compat: armv7hnl: armv7hl +buildarch_compat: armv7hl: armv6hl +buildarch_compat: armv6hl: noarch + buildarch_compat: hppa2.0: hppa1.2 buildarch_compat: hppa1.2: hppa1.1 buildarch_compat: hppa1.1: hppa1.0 -- 1.8.3.1 _______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxxxxx http://lists.rpm.org/mailman/listinfo/rpm-list