Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] Check disable-nxcompat flag for standalone
A Win32 executable binary needs to disable NXCOMPAT mode to allow AVS to execute code from writeable memory. Marking a binary with NXCOMPAT disallows write-exec permissions for it. By default (at least in newer binutils releases) binaries will automatically be marked as such. Alternatively the linker may mark binaries with "NXCOMPAT:NO", meaning they do not support the write-exec prevention. This is meant for compiling legacy applications (such as AVS). Binutils 2.36 is the oldest version that supports --disable-nxcompat. MSVC should generally support /NXCOMPAT:NO. If the linker does not support the flag, don't add the "avs-cli" target, i.e. the standalone test CLI written in C. This is a Win32 feature, so on Linux the CLI is built unconditionally. Bump the required CMake version to 3.18 to use `check_linker_flag()`. Side note: There are versions of binutils (e.g. 2.35 as shipped in Ubuntu 21.04's mingw-w64 package) that have a differently named flag "--no-nxcompat", probably doing the same as "--disable-nxcompat". This flag does not seem to be in any upstream binutils release and is not tested for or supported at all.
- Loading branch information