Closed Bug 1609181 Opened 6 years ago Closed 6 years ago

Detect ARM (32-bit) CPU features on FreeBSD

Categories

(NSS :: Libraries, enhancement, P3)

ARM
FreeBSD
enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jbeich, Assigned: jbeich)

Details

Attachments

(1 file, 2 obsolete files)

FreeBSD 12.0 has a function similar to getauxval, see https://github.com/freebsd/freebsd/commit/990c7fb0441b. elf_aux_info uses KERN_PROC_AUXV under the hood but AT_HWCAP isn't available before FreeBSD 11.2.

Priority: -- → P3

Implement getauxval via elf_aux_info to avoid code duplication.
AT_HWCAP* can be used on powerpc* and riscv64 as well.

https://treeherder.mozilla.org/#/jobs?repo=nss-try&revision=8dd1916016d9ff25914e32d6ba7b8cee677c5ff1

Attachment #9120820 - Flags: review?(jjones)
Attachment #9120820 - Attachment is patch: true

Oops, explicitly exclude on FreeBSD aarch64 after bug 1575843.

blinit.c:118:22: error: unused function 'freebl_getauxval' [-Werror,-Wunused-function]
static unsigned long getauxval(unsigned long type)
                     ^
blinit.c:117:19: note: expanded from macro 'getauxval'
#define getauxval freebl_getauxval
                  ^
1 error generated.
Assignee: nobody → jbeich
Attachment #9120820 - Attachment is obsolete: true
Attachment #9120820 - Flags: review?(jjones)
Attachment #9120822 - Flags: review?(jjones)

Oops, bad style but clang-format doesn't warn:

  • When tabs are used instead of spaces
  • When if doesn't end with {
Attachment #9120822 - Attachment is obsolete: true
Attachment #9120822 - Flags: review?(jjones)
Attachment #9120823 - Flags: review?(jjones)
Comment on attachment 9120823 [details] [diff] [review] Use getauxval paths if not protected by #ifdef __linux__ (non-aarch64), v1.2 Pushed this version downstream to get more exposure: https://github.com/freebsd/freebsd-ports/commit/72da66e8ccdc114da1df6939bff67ecb84381bda
Comment on attachment 9120823 [details] [diff] [review] Use getauxval paths if not protected by #ifdef __linux__ (non-aarch64), v1.2 Review of attachment 9120823 [details] [diff] [review]: ----------------------------------------------------------------- Looks good here, thanks!
Attachment #9120823 - Flags: review?(jjones) → review+
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.50
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: