bionic: Add flag to restore legacy mmap behavior
* Pre-lollipop mmap would not care whether offset was signed
or unsigned.
* Lollipop adds 64-bit support which results in sign extension
of offset, causing a negative offset when
a positive offset > 2^31 is given.
Change-Id: I5d19d898fc131cf848217974915d1b466a474f99
diff --git a/libc/Android.mk b/libc/Android.mk
index 1ca84c1..8c6903c 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -639,6 +639,10 @@
libc_malloc_src := bionic/jemalloc_wrapper.cpp
libc_common_c_includes += external/jemalloc/include
+ifeq ($(BOARD_USES_LEGACY_MMAP),true)
+ libc_common_cflags += -DLEGACY_MMAP
+endif
+
# Define some common conlyflags
libc_common_conlyflags := \
-std=gnu99