Include __BIONIC_NO_PAGE_SIZE_MACRO flag to avoid breaking libraries

The __BIONIC_NO_PAGE_SIZE_MACRO flag has to be passed to
the build system because there are C/C++ libraries using
__BIONIC_NO_PAGE_SIZE_MACRO to decide whether to use getpagesize()
or PAGE_SIZE macro.

Bug: 333973679
Test: Build manually
Change-Id: Ie5d71f4b2b256ab8f429ed4724b8d249b364d5da
This commit is contained in:
Juan Yescas 2024-04-11 23:58:29 -07:00
parent a115e2615b
commit fc5cdcbdf5
2 changed files with 6 additions and 2 deletions

View file

@ -101,7 +101,9 @@ func init() {
pctx.VariableFunc("Arm64Cflags", func(ctx android.PackageVarContext) string { pctx.VariableFunc("Arm64Cflags", func(ctx android.PackageVarContext) string {
flags := arm64Cflags flags := arm64Cflags
if !ctx.Config().NoBionicPageSizeMacro() { if ctx.Config().NoBionicPageSizeMacro() {
flags = append(flags, "-D__BIONIC_NO_PAGE_SIZE_MACRO")
} else {
flags = append(flags, "-D__BIONIC_DEPRECATED_PAGE_SIZE_MACRO") flags = append(flags, "-D__BIONIC_DEPRECATED_PAGE_SIZE_MACRO")
} }
return strings.Join(flags, " ") return strings.Join(flags, " ")

View file

@ -110,7 +110,9 @@ func init() {
// Clang cflags // Clang cflags
pctx.VariableFunc("X86_64Cflags", func(ctx android.PackageVarContext) string { pctx.VariableFunc("X86_64Cflags", func(ctx android.PackageVarContext) string {
flags := x86_64Cflags flags := x86_64Cflags
if !ctx.Config().NoBionicPageSizeMacro() { if ctx.Config().NoBionicPageSizeMacro() {
flags = append(flags, "-D__BIONIC_NO_PAGE_SIZE_MACRO")
} else {
flags = append(flags, "-D__BIONIC_DEPRECATED_PAGE_SIZE_MACRO") flags = append(flags, "-D__BIONIC_DEPRECATED_PAGE_SIZE_MACRO")
} }
return strings.Join(flags, " ") return strings.Join(flags, " ")