mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-04-25 17:25:17 +02:00
#9135 Fix lzfse build on FreeBSD by setting _XOPEN_SOURCE=600 in gradle
On FreeBSD 15 with clang 19 and -std=c99, <sys/time.h> only exposes gettimeofday() when __XSI_VISIBLE is set, which requires a feature test macro to be defined before system headers are included. Without it, clang 19 errors out on the implicit declaration. Rather than modify the third-party lzfse source, set _XOPEN_SOURCE=600 via b.cCompiler.define in buildNatives.gradle, scoped to the FreeBSD target under the Clang toolchain. Linux, macOS and Windows builds are untouched, and the lzfse source stays bit-identical to upstream.
This commit is contained in:
@@ -83,6 +83,9 @@ model {
|
||||
b.cCompiler.args "-std=c99"
|
||||
b.cCompiler.args "-Wall"
|
||||
b.cCompiler.args "-O2"
|
||||
if (b.targetPlatform.operatingSystem.name == "freebsd") {
|
||||
b.cCompiler.define "_XOPEN_SOURCE", "600"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user