Skip to content

Commit

Permalink
PR #1816: Random: use getauxval() via <sys/auxv.h>
Browse files Browse the repository at this point in the history
Imported from GitHub PR #1816

Make the use of  `getauxval()` consistent with other parts of abseil and use it via the `<sys/auxv.h>` header instead of a local declaration.

The current situation is causing some weird symbol visibility issues at least in Firefox, see https://bugzilla.mozilla.org/show_bug.cgi?id=1942917 for details.
Merge 61a56f3 into 20a1220

Merging this change closes #1816

COPYBARA_INTEGRATE_REVIEW=#1816 from sharkcz:random 61a56f3
PiperOrigin-RevId: 721365575
Change-Id: I99d0fc6fd9abd3b8ba175af88f4a1b7f6862e589
  • Loading branch information
sharkcz authored and copybara-github committed Jan 30, 2025
1 parent 5f9f2cf commit 0f102ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion absl/random/internal/randen_detect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static void __cpuid(int cpu_info[4], int info_type) {
// On linux, just use the c-library getauxval call.
#if defined(ABSL_INTERNAL_USE_LINUX_GETAUXVAL)

extern "C" unsigned long getauxval(unsigned long type); // NOLINT(runtime/int)
#include <sys/auxv.h>

static uint32_t GetAuxval(uint32_t hwcap_type) {
return static_cast<uint32_t>(getauxval(hwcap_type));
Expand Down

0 comments on commit 0f102ad

Please sign in to comment.