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.
geojsonvt.o is not an object file (not allowed in a library) #2348
Copy link
Copy link
Closed
Description
When running V=1 make android on OS X, the geojsonvt mason build fails with the following errors:
17:09:17 mikemorris:~/Projects/mapbox-gl-native/mason_packages/.build/geojson-vt-cpp-1.1.0/build (master)$ ./gyp-mac-tool filter-libtool libtool -static -o Release/libgeojsonvt.a Release/obj.target/geojsonvt/src/geojsonvt.o Release/obj.target/geojsonvt/src/geojsonvt_clip.o Release/obj.target/geojsonvt/src/geojsonvt_convert.o Release/obj.target/geojsonvt/src/geojsonvt_simplify.o Release/obj.target/geojsonvt/src/geojsonvt_tile.o -arch_only armv7
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: Release/obj.target/geojsonvt/src/geojsonvt.o is not an object file (not allowed in a library)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: Release/obj.target/geojsonvt/src/geojsonvt_clip.o is not an object file (not allowed in a library)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: Release/obj.target/geojsonvt/src/geojsonvt_convert.o is not an object file (not allowed in a library)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: Release/obj.target/geojsonvt/src/geojsonvt_simplify.o is not an object file (not allowed in a library)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: Release/obj.target/geojsonvt/src/geojsonvt_tile.o is not an object file (not allowed in a library)
I noticed that some compiler args seem to be duplicated compared to the make osx build, which sounds like a similar issue to CocoaPods/CocoaPods#826
V=1 make osx
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ '-DNDEBUG' -I../include -fasm-blocks -mpascal-strings -O3 -g
dwarf-2 -isystem /Users/mikemorris/Projects/mapbox-gl-native/mason_packages/.build/geojson-vt-cpp-1.1.0/mason_packages/headers/variant/1.0/include -I/Users/mi
kemorris/Projects/mapbox-gl-native/mason_packages/.build/geojson-vt-cpp-1.1.0/mason_packages/headers/variant/1.0/include -I/Users/mikemorris/Projects/mapbox-g
l-native/mason_packages/.build/geojson-vt-cpp-1.1.0/mason_packages/headers/rapidjson/1.0.2/include -std=c++1y -MMD -MF ./Release/.deps/Release/obj.target/geoj
sonvt/src/geojsonvt.o.d.raw -fPIC -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -arch x86_64 -
mmacosx-version-min=10.8 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -arch x86_64 -mmacosx-v
ersion-min=10.8 -fvisibility-inlines-hidden -stdlib=libc++ -std=c++11 -c -o Release/obj.target/geojsonvt/src/geojsonvt.o ../src/geojsonvt.cpp
V=1 make android
arm-linux-androideabi-clang++ '-DNDEBUG' -I../include -fasm-blocks -mpascal-strings -O3 -gdwarf-2 -isystem /Users/mikemorris/Projects/mapbox-gl-native/maso
n_packages/.build/geojson-vt-cpp-1.1.0/mason_packages/headers/variant/1.0/include -I/Users/mikemorris/Projects/mapbox-gl-native/mason_packages/.build/geojson-
vt-cpp-1.1.0/mason_packages/headers/variant/1.0/include -I/Users/mikemorris/Projects/mapbox-gl-native/mason_packages/.build/geojson-vt-cpp-1.1.0/mason_package
s/headers/rapidjson/1.0.2/include -std=c++1y -MMD -MF ./Release/.deps/Release/obj.target/geojsonvt/src/geojsonvt.o.d.raw -fPIC -target armv7-none-linux-androi
deabi -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -D_LITTLE_ENDIAN -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-pref
ixes -fno-integrated-as -O2 -g -DNDEBUG -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -target ar
mv7-none-linux-androideabi -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -D_LITTLE_ENDIAN -fpic -ffunction-sections -funwind-tables -fstack-protector-stro
ng -no-canonical-prefixes -fno-integrated-as -O2 -g -DNDEBUG -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-lin
e-argument -c -o Release/obj.target/geojsonvt/src/geojsonvt.o ../src/geojsonvt.cpp
From https://developer.android.com/ndk/guides/standalone_toolchain.html#wwc (which looks like a useful resource, but a bit over my head):
These scripts invoke the real clang binary with default target architecture flags.
The .o files themselves look okay...
file mason_packages/.build/geojson-vt-cpp-1.1.0/build/Release/obj.target/geojsonvt/src/geojsonvt.o
ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
Activity
incanus commentedon Sep 16, 2015
Refs #2344
jfirebaugh commentedon Sep 16, 2015
I'm suspicious of two things:
geojsonvt.oeven exist? Mason should be picking up a prebuiltgeojsonvtbinary.V=1 make androidoutput refer to libtool from Xcode? IIRC, the android build should be entirely using android NDK build toolchain (arm-linux-androideabi-clang++and so forth).mikemorris commentedon Sep 16, 2015
This was patched to build
geojsonvtfrom source specifically because of C++ stdlib conflicts. We could possibly limit that to onlygccbuilds I suppose?It sounds like the "bundled" build tools are just script wrappers around the Xcode tools?
jfirebaugh commentedon Sep 16, 2015
@mikemorris The command you ran was
./gyp-mac-tool ...? Where did that come from?ljbade commentedon Sep 16, 2015
@mikemorris ah building mason from source on android. I would say we don't support that currently.
All mason Android modules have ever been built from Travis on Linux.
I'd say the mason build scripts need modifications to check if they are running on OSX and implement some work around.
This smells like a PATH issue by the way. Picking up the wrong commands.
mikemorris commentedon Sep 16, 2015
From
mason_packages/.build/geojson-vt-cpp-1.1.0/build/@jfirebaughlucaswoj commentedon Sep 16, 2015
@jfirebaugh explained the fundamental issue:
While we do force
geojsonvtto build from source, we don't use the correct toolchain for Android builds,building with the host system's C++ standard library instead of the target system's C++ standard librarybuilding with XCode'slibtoolinstead of Android NDK'slibtool.The planned short-term resolution is
master(Revert "Enable npm install from source" #2349)npm-buildbranch based on 4e1ead3 in which we fix Android builds (either by adding features to Mason or by invoking the correct toolchain in the Android build script)jfirebaugh commentedon Sep 16, 2015
@lucaswoj Correct, except for "building with the host system's C++ standard library instead of the target system's C++ standard library". The build issue on android is unrelated to C++ standard libraries; instead it appears to be caused by using Xcode's libtool rather than the libtool provided by the android NDK.
incanus commentedon Sep 16, 2015
#2344
springmeyer commentedon Oct 2, 2015
👍 Want to highlight this. When I first read this ticket it seemed like stdlib issues were related, but its not so. Also over at #2237 (comment) we've ruled out stdlib issue (mostly) as well.