There might be a cleaner way to enable these tests running on FreeBSD,
I'm open to suggestions.
Co-authored-by: Alexander Richardson <mail@alexrichardson.me>
In the libc++ test suite, we consistently declare main() functions with
full parameters and explicitly return from the function. This helps code
that compiles the tests with -ffreestanding, where main() is not a
special function (with an implicit return and special mangling).
This patch fixes a few stray declarations, including in libunwind and
libc++abi.
Previously, we only used `objcopy`, which is not available for some
build configurations. With this patch, we not only try to use `objcopy`,
but also try to use `llvm-objcopy` if available.
This is a follow-up of https://github.com/llvm/llvm-project/pull/156383.
In https://github.com/llvm/llvm-project/pull/154902, the test failed
with llvm-clang-win-x-aarch64(it is a cross-build, which builds on
Windows and run on Linux, "Win to Aarch64 Linux Ubuntu Cross
Toolchain"), and objdump is not available on Windows(the build env).
Set to require x86 Linux instead.
There is an off-by-one error with current condition check for PC fallen
into the range or not. There is another check within libunwind that use
the correct checks in
5050da7ba1/libunwind/src/UnwindCursor.hpp (L2757)
```
if ((fdeInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd))
```