Skip to content

Conversation

@DimitryAndric
Copy link
Collaborator

This is a follow-up to #75635 which broke the build for FreeBSD on AArch64:

compiler-rt/lib/builtins/cpu_model/aarch64/lse_atomics/freebsd.inc:3:16: error: call to undeclared function 'elf_aux_info'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    3 |   int result = elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap);
      |                ^

Using elf_aux_info() requires including <sys/auxv.h> first. To prevent redeclaration issues with hwcap.inc attempting to define HWCAP_xxx macros before <sys/auxv.h> does so, include <sys/auxv.h> before any of the .inc files on FreeBSD.

This is a follow-up to #75635 which broke the build for FreeBSD on
AArch64:

```
compiler-rt/lib/builtins/cpu_model/aarch64/lse_atomics/freebsd.inc:3:16: error: call to undeclared function 'elf_aux_info'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    3 |   int result = elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap);
      |                ^
```

Using `elf_aux_info()` requires including `<sys/auxv.h>` first. To
prevent redeclaration issues with `hwcap.inc` attempting to define
`HWCAP_xxx` macros before `<sys/auxv.h>` does so, include `<sys/auxv.h>`
before any of the `.inc` files on FreeBSD.
@github-actions
Copy link

github-actions bot commented Dec 28, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

@DimitryAndric DimitryAndric merged commit 953ae94 into main Dec 29, 2023
@DimitryAndric DimitryAndric deleted the users/DimitryAndric/compiler-rt-cpumodel-fix-freebsd branch December 29, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants