FBSD: Remove support for 8.x and 9.x According to <https://www.freebsd.org/security/unsupported.html>, FreeBSD 8.x EoL was on August 1, 2015, and FreeBSD 9.x EoL was on December 31, 2016. Remove our support for these versions, since they haven't been supported by FreeBSD itself for a while. FreeBSD 10.x EoL was on October 31, 2018, which has passed, but was less than a year ago. So keep 10.x in for now. Adjust our preprocessor checks accordingly: - In FBSD-specific dirs, assume AFS_FBSD100_ENV and lower is always true. Assume __FreeBSD_version is always at least 1000000. - In non-FBSD dirs, convert AFS_FBSD100_ENV and lower to AFS_FBSD_ENV. Change-Id: I965e65d3b95573bb374661217b24b686c7b68ed2 Reviewed-on: https://gerrit.openafs.org/13842 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
FBSD: Remove pre-8 code Commit 123f0fb1 (config: remove support for old FreeBSD releases) removed our support for FreeBSD releases before FreeBSD 8. However, various areas of code still reference the symbols from those old versions (e.g. AFS_FBSD53_ENV). Remove our ifdef logic for these old symbols, according to the following rules: - In FBSD-specific dirs, assume AFS_FBSD80_ENV is always true (as well as the symbols for earlier versions) - In non-FBSD dirs, convert AFS_FBSD80_ENV to AFS_FBSD_ENV (and do the same for all earlier versions) This allows us to remove code that was specific to older FreeBSD versions, and simplify some ifdef conditionals. Also remove the definitions for AFS_FBSD80_ENV and earlier versions in our existing param.h files. With this commit, the functions afs_start, afs_vop_lock, afs_vop_unlock, and afs_vop_islocked are now always unreferenced, so remove them. Change-Id: Ia5a5ba5ee5b71a86cb4514305e20f1bb34487100 Reviewed-on: https://gerrit.openafs.org/13812 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Tim Creech <tcreech@tcreech.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
FBSD: Use ucontext for FreeBSD 10+ on amd64 Currently, running any LWP program on recent FreeBSD on amd64 causes (or can cause) a SIGBUS very quickly. This is possibly because our stack management code in LWP only ensures our stacks are 4 or 8-byte aligned in most cases (except DARWIN, which gets 16-byte-aligned stacks), according to the value of STACK_ALIGN. The amd64 ABI mandates that stacks be 16-byte-aligned, and some function calls assume that this is followed, causing a SIGBUS when it is not. FreeBSD on amd64 currently uses process.amd64.s for its savecontext() implementation, which does not do any checking or fixup of the stack alignment. This behavior has been observed on amd64 with FreeBSD 11 specifically, but it probably happens on any FreeBSD release when using clang. FreeBSD switched to clang as the default compiler with FreeBSD 10, so this probably occurs with FreeBSD 10 and newer. We could perhaps try to fix this by changing our stack management code, but we can also avoid most of this nonsense by just using ucontext instead of our custom assembly code. So, do that, by setting USE_UCONTEXT for FreeBSD 10+. Also enable the same 'stackvar'-based workaround in savecontext() as Linux uses, since otherwise 'topstack' appears to always be NULL, and triggers our stack overflow checks. Note that while LWP use is deprecated, as of this commit many small utilities (like 'fs') are still linked to LWP, and so are unusable without a fix like this. Change-Id: Ie8e928bd71e7f6e9c0fb1379259c55527b6ccdf3 Reviewed-on: https://gerrit.openafs.org/13691 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Add param.h files and sysnames for FreeBSD 11.2 Thanks to Måns Nilsson for filing the bug. Note that this change differs from the proposed patch in the report, in that it doesn't define the 10.4 symbols in the 11.2 param.h files. FIXES 134850 Change-Id: I83b3a81609c109eef243533b0e1defa3aca0d526 Reviewed-on: https://gerrit.openafs.org/13534 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>