Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android cross-compilation errors #813

Open
therealjmj opened this issue Jun 30, 2022 · 1 comment
Open

Android cross-compilation errors #813

therealjmj opened this issue Jun 30, 2022 · 1 comment

Comments

@therealjmj
Copy link

therealjmj commented Jun 30, 2022

After successful building for months, we are hitting a new cross-compilation build error on multiple machines, while building leveldown-nodejs-mobile (and leveldown) as a native module across all Android architectures.

...
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/options.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/leveldb/deps/leveldb/leveldb-1.20/util/status.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/leveldb/deps/leveldb/leveldb-1.20/port/port_posix.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/leveldb/deps/leveldb/leveldb-1.20/util/env_posix.o is not an object file (not allowed in a library)
make: *** [Release/leveldb.a] Error 1

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/<HOME>/.nvm/versions/node/v16.15.1/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.5.0
gyp ERR! command "/Users/<HOME>/.nvm/versions/node/v16.15.1/bin/node" "/Users/johnnym/.nvm/versions/node/v16.15.1/bin/node-gyp" "rebuild" "--build-from-source" "--verbose"
gyp ERR! cwd /Users/<PROJ>/android/build/nodejs-native-assets-temp-build/nodejs-native-assets-armeabi-v7a/nodejs-project/node_modules/leveldown
gyp ERR! node -v v16.15.1
gyp ERR! node-gyp -v v9.0.0

Wondering if anyone has seen this, or has any ideas for debugging?

@therealjmj
Copy link
Author

The above "not an object file" errors follow a variety of these build warnings:

~/Library/Android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang++ -o Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/env_posix.o ../deps/leveldb/leveldb-1.20/util/env_posix.cc '-DNODE_GYP_MODULE_NAME=leveldb' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DSNAPPY=1' '-DLEVELDB_PLATFORM_POSIX=1' '-DOS_ANDROID=1' '-D_REENTRANT=1' '-D_GLIBCXX_USE_C99_MATH' -I/Users/johnnym/railway-private/node_modules/nodejs-mobile-react-native/android/libnode/include/node -I/Users/johnnym/railway-private/node_modules/nodejs-mobile-react-native/android/libnode/src -I/Users/johnnym/railway-private/node_modules/nodejs-mobile-react-native/android/libnode/deps/openssl/config -I/Users/johnnym/railway-private/node_modules/nodejs-mobile-react-native/android/libnode/deps/openssl/openssl/include -I/Users/johnnym/railway-private/node_modules/nodejs-mobile-react-native/android/libnode/deps/uv/include -I/Users/johnnym/railway-private/node_modules/nodejs-mobile-react-native/android/libnode/deps/zlib -I/Users/johnnym/railway-private/node_modules/nodejs-mobile-react-native/android/libnode/deps/v8/include -I../deps/leveldb/leveldb-1.20 -I../deps/leveldb/leveldb-1.20/include -I../deps/snappy/linux -I../deps/snappy/snappy  -fasm-blocks -mpascal-strings -O3 -gdwarf-2 -arch x86_64  -MMD -MF ./Release/.deps/Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/env_posix.o.d.raw   -c
clang++: warning: argument unused during compilation: '-arch x86_64' [-Wunused-command-line-argument]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant