16k: soong: Add the C flag -D__BIONIC_NO_PAGE_SIZE_MACRO flag to x86-64
To simulate 16k page size in x86-64 cuttefish, it is necessary
to compile the shared libraries and binaries with max-page-size greater
than 4096.
Bug: 309816695
Test: source build/envsetup.sh
lunch aosp_cf_x86_64_phone_pgagnostic-trunk-userdebug
m
Change-Id: I32670ef2c25fdcefec11bd07ba41cd0ea96c92bd
diff --git a/cc/config/x86_64_device.go b/cc/config/x86_64_device.go
index ee7d472..00a395f 100644
--- a/cc/config/x86_64_device.go
+++ b/cc/config/x86_64_device.go
@@ -104,7 +104,15 @@
})
// Clang cflags
- exportedVars.ExportStringListStaticVariable("X86_64Cflags", x86_64Cflags)
+ exportedVars.ExportStringList("X86_64Cflags", x86_64Cflags)
+ pctx.VariableFunc("X86_64Cflags", func(ctx android.PackageVarContext) string {
+ flags := x86_64Cflags
+ if ctx.Config().PageSizeAgnostic() {
+ flags = append(flags, "-D__BIONIC_NO_PAGE_SIZE_MACRO")
+ }
+ return strings.Join(flags, " ")
+ })
+
exportedVars.ExportStringListStaticVariable("X86_64Cppflags", x86_64Cppflags)
// Yasm flags