Solved by solvingPuzzles in post #2 
              
              
                Figured it out. The solution is to use -DCMAKE_BUILD_TYPE=Debug in build_android.sh. Otherwise, it defaults to Release, which seems to add the -O2 flag.