Skip to content

Commit ffed34e

Browse files
committed
[libc] Fix getauxval being defined in a namespace
1 parent 2cf2f1b commit ffed34e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

libc/test/IntegrationTest/test.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include <stddef.h>
1111
#include <stdint.h>
1212

13+
#ifdef LIBC_TARGET_ARCH_IS_AARCH64
14+
#include "src/sys/auxv/getauxval.h"
15+
#endif
16+
1317
// Integration tests rely on the following memory functions. This is because the
1418
// compiler code generation can emit calls to them. We want to map the external
1519
// entrypoint to the internal implementation of the function used for testing.
@@ -82,8 +86,6 @@ void *realloc(void *ptr, size_t s) {
8286
void *__dso_handle = nullptr;
8387

8488
#ifdef LIBC_TARGET_ARCH_IS_AARCH64
85-
#include "src/sys/auxv/getauxval.h"
86-
8789
// Due to historical reasons, libgcc on aarch64 may expect __getauxval to be
8890
// defined. See also https://gcc.gnu.org/pipermail/gcc-cvs/2020-June/300635.html
8991
unsigned long __getauxval(unsigned long id) {

libc/test/UnitTest/HermeticTestUtils.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include <stddef.h>
1111
#include <stdint.h>
1212

13+
#ifdef LIBC_TARGET_ARCH_IS_AARCH64
14+
#include "src/sys/auxv/getauxval.h"
15+
#endif
16+
1317
namespace LIBC_NAMESPACE {
1418

1519
int bcmp(const void *lhs, const void *rhs, size_t count);
@@ -110,8 +114,6 @@ void __cxa_pure_virtual() {
110114
void *__dso_handle = nullptr;
111115

112116
#ifdef LIBC_TARGET_ARCH_IS_AARCH64
113-
#include "src/sys/auxv/getauxval.h"
114-
115117
// Due to historical reasons, libgcc on aarch64 may expect __getauxval to be
116118
// defined. See also https://gcc.gnu.org/pipermail/gcc-cvs/2020-June/300635.html
117119
unsigned long __getauxval(unsigned long id) {

0 commit comments

Comments
 (0)