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
Conversation
src/libFLAC/cpu.c
Outdated
@@ -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__) |
There was a problem hiding this comment.
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?
#elif defined(__FreeBSD__) | |
#elif defined(__FreeBSD__) && defined(HAVE_SYS_AUXV_H) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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().
FreeBSD doesn't have getauxval().