diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2015-02-13 15:21:32 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2015-02-24 18:21:41 +0800 |
commit | 81696d2de5b29f6c3c160b4c949c48e0002559d2 (patch) | |
tree | 58480b132e431f586d20aa8ad798403866b567f9 /build | |
parent | 22bac99c54fcb53a6b0d049417ecd793aa1fb728 (diff) | |
download | ndk-81696d2de5b29f6c3c160b4c949c48e0002559d2.tar.gz |
Compile x86/x86_64 STL with -mstackrealign
x86/x86_64 compilers since r10d stop adding -mstackrealign
implicitly for performance reason: compilers assume stack is properly
aligned BEFORE call, and manipulate stack pointer to observe this
invariance already. This does assume stack pointer is properly aligned
to begin with, and there is no rogue hand-coded assembly in the call
chains...
Unfortunately not all x86-based device call JNI with stack 16-byte
aligned (eg. ASUS_T00F). This CL compiles x86 prebuilt STL libraries
with -mstackrealign regardless.
Note that x86 STL libraries in r10d already compiled with -mstackrealign
Change-Id: I7a74799b5a5d845672b0206954829eb46e81fd78
Diffstat (limited to 'build')
-rwxr-xr-x | build/tools/build-cxx-stl.sh | 6 | ||||
-rwxr-xr-x | build/tools/build-gnu-libstdc++.sh | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/build/tools/build-cxx-stl.sh b/build/tools/build-cxx-stl.sh index eaf6a9ffe..ce16e9bc7 100755 --- a/build/tools/build-cxx-stl.sh +++ b/build/tools/build-cxx-stl.sh @@ -537,6 +537,12 @@ build_stl_libs_for_abi () EXTRA_CFLAGS="-mfix-cortex-a53-835769" EXTRA_CXXFLAGS="-mfix-cortex-a53-835769" ;; + x86|x86_64) + # ToDo: remove the following once all x86-based device call JNI function with + # stack aligned to 16-byte + EXTRA_CFLAGS="-mstackrealign" + EXTRA_CXXFLAGS="-mstackrealign" + ;; mips32r6) EXTRA_CFLAGS="-mips32r6" EXTRA_CXXFLAGS="-mips32r6" diff --git a/build/tools/build-gnu-libstdc++.sh b/build/tools/build-gnu-libstdc++.sh index 90c8ee214..6e24871a6 100755 --- a/build/tools/build-gnu-libstdc++.sh +++ b/build/tools/build-gnu-libstdc++.sh @@ -184,9 +184,15 @@ build_gnustl_for_abi () ;; x86) BUILD_HOST=i686-linux-android + # ToDo: remove the following once all x86-based device call JNI function with + # stack aligned to 16-byte + EXTRA_CFLAGS="$EXTRA_CFLAGS -mstackrealign" ;; x86_64) BUILD_HOST=x86_64-linux-android + # ToDo: remove the following once all x86-based device call JNI function with + # stack aligned to 16-byte + EXTRA_CFLAGS="$EXTRA_CFLAGS -mstackrealign" ;; mips) BUILD_HOST=mipsel-linux-android |