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

Remove HAVE_GETAUXVAL check for FreeBSD #410

Merged
merged 1 commit into from Aug 7, 2022
Merged

Remove HAVE_GETAUXVAL check for FreeBSD #410

merged 1 commit into from Aug 7, 2022

Conversation

pkubaj
Copy link
Contributor

@pkubaj pkubaj commented Aug 4, 2022

FreeBSD doesn't have getauxval().

@@ -251,7 +251,7 @@ ppc_cpu_info (FLAC__CPUInfo *info)
} else if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) {
info->ppc.arch_2_07 = true;
}
#elif defined(__FreeBSD__) && defined(HAVE_GETAUXVAL)
#elif defined(__FreeBSD__)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be the following?

Suggested change
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__) && defined(HAVE_SYS_AUXV_H)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected.
However, elf_aux_info() is available since FreeBSD 12.0. Branches before 12 are already unsupported and frankly, so much happened in the powerpc* land in FreeBSD 13.0 that no one should use anything before 13.0.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is, that HAVE_SYS_AUXV_H check was added for uclibc here: #292 I made the mistake to suggest to check for HAVE_GETAUXVAL, I see now that HAVE_SYS_AUXV_H must be checked.

I really don't know anything about uclibc nor FreeBSD, it seems uclibc is only compatible with linux, but perhaps other libc's have something similar, omitting sys/auxv.h on FreeBSD as well? In that case, this check would make sense even on FreeBSD 12 and later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is any other libc available on FreeBSD for powerpc*. There actually are GNU/kFreeBSD distros (FreeBSD kernel with GNU userland), but since they use GNU, they probably use glibc (and all of them are only for amd64 / i386 anyway). I don't think anyone has ever attempted to run uclibc on FreeBSD and the probability of that happening on powerpc* is even lower.

I think you can just assume that FreeBSD 12.0 and newer have sys/auxv.h.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we can leave it in though, just in case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure you can, it doesn't hurt.

FreeBSD doesn't have getauxval().
@ktmf01 ktmf01 merged commit 349cc07 into xiph:master Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants