This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
issue with MIPS API #5126
Copy link
Copy link
Closed
Milestone
Description
Trying to build the SNAPSHOT on bitrise failed, with a little more investigating with @bleege we were able to determine that this issue is specific to MIPS ABI, all others seem to work fine. Running make apackage locally resulted in this output:
...
CXX(target) Debug/obj.target/core/src/mbgl/geometry/static_vertex_buffer.o
CXX(target) Debug/obj.target/core/src/mbgl/geometry/text_buffer.o
CXX(target) Debug/obj.target/core/src/mbgl/geometry/vao.o
CXX(target) Debug/obj.target/core/src/mbgl/gl/debugging.o
CXX(target) Debug/obj.target/core/src/mbgl/gl/gl.o
CXX(target) Debug/obj.target/core/src/mbgl/gl/gl_config.o
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-84c2c5.s: Assembler messages:
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-84c2c5.s:166400: Warning: no .cprestore pseudo-op used in PIC code
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-84c2c5.s:166400: Warning: macro instruction expanded into multiple instructions
CXX(target) Debug/obj.target/core/src/mbgl/gl/gl_object_store.o
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-84c2c5.s:220949: Warning: no .cprestore pseudo-op used in PIC code
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-84c2c5.s:220949: Warning: macro instruction expanded into multiple instructions
CXX(target) Debug/obj.target/core/src/mbgl/gl/texture_pool.o
CXX(target) Debug/obj.target/core/src/mbgl/layer/background_layer.o
clang36++: error: unable to execute command: Segmentation fault: 11
clang36++: error: assembler command failed due to signal (use -v to see invocation)
clang version 3.6
Target: mipsel-none-linux-android
Thread model: posix
clang36++: note: diagnostic msg: PLEASE submit a bug report to http://source.android.com/source/report-bugs.html and include the crash backtrace, preprocessed source, and associated run script.
CXX(target) Debug/obj.target/core/src/mbgl/layer/circle_layer.o
clang36++: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang36++: note: diagnostic msg: /var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-cd4044.cpp
clang36++: note: diagnostic msg: /var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/annotation_manager-cd4044.sh
clang36++: note: diagnostic msg:
********************
make[1]: *** [Debug/obj.target/core/src/mbgl/annotation/annotation_manager.o] Error 254
make[1]: *** Waiting for unfinished jobs....
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-bf683d.s: Assembler messages:
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-bf683d.s:20314: Warning: no .cprestore pseudo-op used in PIC code
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-bf683d.s:20314: Warning: macro instruction expanded into multiple instructions
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-bf683d.s:23187: Warning: no .cprestore pseudo-op used in PIC code
/var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-bf683d.s:23187: Warning: macro instruction expanded into multiple instructions
clang36++: error: unable to execute command: Segmentation fault: 11
clang36++: error: assembler command failed due to signal (use -v to see invocation)
clang version 3.6
Target: mipsel-none-linux-android
Thread model: posix
clang36++: note: diagnostic msg: PLEASE submit a bug report to http://source.android.com/source/report-bugs.html and include the crash backtrace, preprocessed source, and associated run script.
clang36++: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang36++: note: diagnostic msg: /var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-7df367.cpp
clang36++: note: diagnostic msg: /var/folders/5r/8wwfkz3n4x11bcfpqjly7fjh0000gn/T/feature_index-7df367.sh
clang36++: note: diagnostic msg:
********************
make[1]: *** [Debug/obj.target/core/src/mbgl/geometry/feature_index.o] Error 254
make: *** [android-lib-mips] Error 2
Activity
jfirebaugh commentedon May 24, 2016
Looks like a compiler bug. My first instinct would be to try upgrading to clang 3.7 or later.
bleege commentedon May 24, 2016
Noting that this can be duplicated quicker using
make android-lib-mipsinstead of running the full ABI buildingmake apackage.jfirebaugh commentedon May 24, 2016
Does this still occur after the NDK revert in 6abd3d7?
bleege commentedon May 24, 2016
Yep, that's actually how @cammace discovered it when he went to roll a new SNAPSHOT build from
masterafter the NDK revert this afternoon.bleege commentedon May 25, 2016
I'm looking into this, but so far haven't found were the compiler is configured. So far I've looked in:
Makefilembgl.gypiplatform/android/scripts/configure.shplatform/android/scripts/debug.shplatform/android/scripts/toolchain.shWill continue looking.
bleege commentedon May 25, 2016
Running
make androidproduces the following output from theMakefile. It looks like the Mason is actually setting the Clang version via theCXXandCCenvironment variables and that it's setting them to use the Clang that comes with the Android NDK. I'll dig into the Android NDK docs to see how customizable this version is.MASON_PLATFORM="android" MASON_ANDROID_ABI="arm-v7" CXX="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang++" CC="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang" LD="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ld" LINK="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang++" AR="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ar" RANLIB="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ranlib" STRIP="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-strip" LDFLAGS="-target armv7-none-linux-androideabi -march=armv7-a -Wl,--fix-cortex-a8 -fuse-ld=gold -no-canonical-prefixes -Wl,--warn-shared-textrel -Wl,--fatal-warnings ${LDFLAGS:-}" CFLAGS="-target armv7-none-linux-androideabi -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -D_LITTLE_ENDIAN -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CFLAGS:-}" CXXFLAGS="-target armv7-none-linux-androideabi -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -D_LITTLE_ENDIAN -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CXXFLAGS:-}" CPPFLAGS="-D__ANDROID__ ${CPPFLAGS:-}" JNIDIR="armeabi-v7a" ./configure platform/android/scripts/configure.sh build/android-arm-v7/config.gypi android arm-v7bleege commentedon May 25, 2016
Android NDK Doc called "Working With Clang" -->
https://developer.android.com/ndk/guides/standalone_toolchain.html#wwc
bleege commentedon May 25, 2016
Getting MIPS compiler name from Mason via
make android-lib-mips, which is going to correspond to the following configs on Mason -->https://github.com/mapbox/mason/tree/master/scripts/android-ndk/mips-9-r10e
MASON_PLATFORM="android" MASON_ANDROID_ABI="mips" CXX="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-clang++" CC="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-clang" LD="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-ld" LINK="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-clang++" AR="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-ar" RANLIB="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-ranlib" STRIP="/Users/brad/development/mapbox-gl-android/mason_packages/osx-x86_64/android-ndk/mips-9-r10e/bin/mipsel-linux-android-strip" LDFLAGS="-target mipsel-none-linux-android -no-canonical-prefixes -Wl,--warn-shared-textrel -Wl,--fatal-warnings ${LDFLAGS:-}" CFLAGS="-target mipsel-none-linux-android -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CFLAGS:-}" CXXFLAGS="-target mipsel-none-linux-android -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CXXFLAGS:-}" CPPFLAGS="-D__ANDROID__ ${CPPFLAGS:-}" JNIDIR="mips" ./configure platform/android/scripts/configure.sh build/android-mips/config.gypi android mipsbleege commentedon May 25, 2016
So looking at the
script.shfor the MIPS compiler on Mason, it looks like we need to alter the LLVM version here in order to change LLVM / Clang to Version 3.7. I'm not quite sure how to make this change and test it without committing this change tomasteron Mason (aka, "how do I point my local Mason file at branch?"). I'll need some help on this one.From another angle, every time I run the MIPS compiler it consistently errors on the same file called
background_layer.oas it did in @cammace's original debug log. I'm wondering if there's something that has recently changed (since Monday) in the source that MIPS isn't cool with? The reason being is that the last good nightly 4.1.0-SNAPSHOT is from Monday morning (Number 34 on the repo). Per commit CI only compiles on the default arm7 ABI to save a ton of processing time, while the nightly one builds for the entire 6 ABI suite (arm-v5, arm-v7, arm-v8, x86, x86-64, mips) so that it can produce a SNAPSHOT release.bleege commentedon May 25, 2016
Picking this up this morning, since I don't know much about the finer points of Mason I'm going to see if I can timebox when MIPS stopped compiling so that we can get some insight into what likely is causing this pain. To do this I'm first going to get the last commit before @kkaefer's NDK update ( 7272d7c ) and run
make android-lib-mipson it. If it compiles then we have a baseline for when things stopped and I can then try again with a commit a little further in the future to narrow in on it.bleege commentedon May 25, 2016
Yep, we've found our baseline!
make android-lib-mipscompiles at 7272d7c. So something has changed since Monday morning that has caused MIPS to break. I'm going to try building next with @jfirebaugh's commit from the end of Monday 1f8de2b. This will use the new NDK stuff, but the issue there wasn't that it wouldn't compile but that it would crash at run time. Depending on how this goes I'll try to revert the NDK build locally again at that commit and see if it still compiles.bleege commentedon May 25, 2016
I just ran
make android-lib-mipson 1f8de2b and it compiled. I noticed that it was using Clang 3.8 which is likely related to the NDK bump. I'm going to revert the NDK bump locally now and try compiling with the old NDK to see if things are still good.22 remaining items
tobrun commentedon May 31, 2016
@bleege
per commitdoesn't build mipsbleege commentedon May 31, 2016
@tobrun Right. Just establishing a baseline here. 😉
bleege commentedon May 31, 2016
Looking at the
bitrise.ymlon therelease-android-v4.1.0branch shows that it's building theReleaseBuild type as it should. I'm going to update my local repo and try to build there to see if I can get more details than what Bitrise is sharing.https://github.com/mapbox/mapbox-gl-native/blob/release-android-v4.1.0/platform/android/bitrise.yml#L77
bleege commentedon May 31, 2016
When building locally for MIPS with the latest commit from
release-android-v4.1.0c66cf0f it fails (as expected) but when I change the/Makefileback toReleasefromDebugit does compile as expected. This makes me wonder if somehow thebitrise.ymlis having trouble setting theBUILDTYPEenvironment variable in time (or at all) for the build process to run.tmpsantos commentedon May 31, 2016
Works locally for me on Release too.
bleege commentedon May 31, 2016
I just tried to recreate the Bitrise process locally by reverting
/Makefileback to it'sDebugstate and setting theBUILDTYPEenvironment variable via the command line before firing off amake android-lib-mipsbuild. This worked and produced a MIPS .so file. The issue has to be something with Bitrise. To test it out I'm running a newscheduledworkflow on Bitrise right now to produce a new SNAPSHOT. This is the same process I originally used to verify that the reconfiguredbitrise.ymlwas working. If it works then we're back to square one (but with a new fresh SNAPSHOT for the first time since last Friday), and if it doesn't then at least things are consistently broken. 😉tmpsantos commentedon May 31, 2016
It turns out that the issue is disabling optimization when building Debug. I managed to build Debug just fine with the change below. Definitely a compiler bug.
bleege commentedon May 31, 2016
The manually kicked off
scheduledrelease in Bitrise just failed at the MIPS process again. @tmpsantos and I discussed this and it looks like it may actually be something with one of the arm ABIs but can't tell for sure as the Bitrise command is using compiled parallelization to do faster builds. To help bring clarity to this I'm going to change this to back to use the sequential build process and kick off anotherscheduledbuild (all from therelease-android-v4.1.0branch to minimize changes introduced to this debug effort). @tmpsantos was also able to confirm that the Bitrise process IS being compiled inReleasemode based off the logs shown.[android] #5126 - Serialize Bitrise Scheduled Build Process
bleege commentedon May 31, 2016
@tmpsantos was able to use the failure in the Serialized Build process to isolate the issue. He's working on a solution now and will merge when complete.
bleege commentedon May 31, 2016
@tmpsantos was able to find a solution this afternoon (evening in Finland!) and we tested it out locally. I'm going to merge the PR #5198 into
masterand the cherry pick torelease-android-v4.1.0. After that I'll kick off a newscheduledbuild to produce a new SNAPSHOT.bleege commentedon May 31, 2016
Merged #5198 into
masterand cherry picked torelease-android-v4.1.0. Time to kick off a SNAPSHOT build!bleege commentedon May 31, 2016
The SNAPSHOT build worked! It's build number 40 on SNAPSHOT server (see link below). We should be good to go again, but I'm going to leave this ticket open until we can confirm that tonight's automated build process works as expected again and produces a new SNAPSHOT. Will check tomorrow morning and hopefully close then.
https://oss.sonatype.org/content/repositories/snapshots/com/mapbox/mapboxsdk/mapbox-android-sdk/4.1.0-SNAPSHOT/
bleege commentedon Jun 1, 2016
Yep, last night's automated build ran on Bitrise and produced a brand new SNAPSHOT as expected from
release-android-v4.1.0. We're back on track here!