Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Arm detection improvements #946

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 2 additions & 16 deletions lib/rpmrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ struct rpmOption {
static struct rpmat_s {
const char *platform;
uint64_t hwcap;
uint64_t hwcap2;
} rpmat;

typedef struct defaultEntry_s {
Expand Down Expand Up @@ -949,11 +948,7 @@ static int is_geode(void)
}
#endif


#if defined(__linux__)
#ifndef AT_HWCAP2 /* glibc < 2.18 */
#define AT_HWCAP2 26
#endif
/**
* Populate rpmat structure with auxv values
*/
Expand All @@ -967,7 +962,6 @@ static void read_auxv(void)
if (!rpmat.platform)
rpmat.platform = "";
rpmat.hwcap = getauxval(AT_HWCAP);
rpmat.hwcap2 = getauxval(AT_HWCAP2);
#else
rpmat.platform = "";
int fd = open("/proc/self/auxv", O_RDONLY);
Expand All @@ -989,9 +983,6 @@ static void read_auxv(void)
case AT_HWCAP:
rpmat.hwcap = auxv.a_un.a_val;
break;
case AT_HWCAP2:
rpmat.hwcap2 = auxv.a_un.a_val;
break;
}
}
close(fd);
Expand Down Expand Up @@ -1224,9 +1215,6 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
# endif
# if !defined(HWCAP_ARM_VFPv3)
# define HWCAP_ARM_VFPv3 (1 << 13)
# endif
# if !defined(HWCAP2_AES)
# define HWCAP2_AES (1 << 0)
# endif
/*
* un.machine is armvXE, where X is version number and E is
Expand All @@ -1238,11 +1226,9 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
/* keep armv7, armv8, armv9, armv10, ... */
while(risdigit(*modifier))
modifier++;
if (rpmat.hwcap & HWCAP_ARM_VFPv3)
if (rpmat.hwcap & (HWCAP_ARM_VFP || HWCAP_ARM_VFPv3))
*modifier++ = 'h';
if (rpmat.hwcap2 & HWCAP2_AES)
*modifier++ = 'c';
if (rpmat.hwcap & HWCAP_ARM_NEON)
if ((atoi(un.machine+4) == 7) && (rpmat.hwcap & HWCAP_ARM_NEON))
*modifier++ = 'n';
*modifier++ = endian;
*modifier++ = 0;
Expand Down