私は、スタンドアロンのツールチェーンNDK13b、api19、LLVM 3.8コンパイラを持っている32ビットの腕、libcpp(LLVM C++ライブラリ)欠落sync_val_compare_and_swap_1
と私はlibgccの依存を避けるためにしたいので、私は、コンパイラ-RTを構築します。
-nodefaultlibs
がlibgccのためにリンクを避けるために、そして:(最低未定義のシンボルで私を残しているが)、私が見つけることができる最高のバージョンは、私のリンク行でhttps://android.googlesource.com/platform/external/compiler-rt/
から来ている私が持っている
-lc++_static -lc++abi -lunwind -latomic -ldl -lm -lc -landroid -landroid_support -lclang_rt.builtins-arm -latomic
すべての標準ライブラリにリンクします。
私は私のプログラムをリンクしようとすると、私は以下の未定義の参照を取得します:
/usr/local/google/buildbot/src/android/ndk-r13-release/external/libcxx/src/algorithm.cpp:83: error: undefined reference to '__sync_val_compare_and_swap_1' /usr/local/google/buildbot/src/android/ndk-r13-release/external/libcxx/src/ios.cpp:74: error: undefined reference to '__sync_val_compare_and_swap_1' /usr/local/google/buildbot/src/android/ndk-r13-release/external/libcxx/src/locale.cpp:53: error: undefined reference to '__sync_val_compare_and_swap_1' /usr/local/google/buildbot/src/android/ndk-r13-release/external/libcxx/src/locale.cpp:464: error: undefined reference to '__sync_val_compare_and_swap_1'
は、これを回避する方法は自分自身の関数を定義することにより例えば、または余分なライブラリをリンクすることで、ありますか?私は(_1
なしsync_val_compare_and_swap
のために実際にある)hereからのコードを使用しようとしました
、私が得た:
../lib/builtins/sync_val_compare_and_swap_1.c ../lib/builtins/sync_val_compare_and_swap_1.c:6:16: error: conflicting types for '__sync_val_compare_and_swap_1' inline int32_t __sync_val_compare_and_swap_1(volatile int32_t* ptr, int32_t oldval, int32_t newval)
^
../lib/builtins/sync_val_compare_and_swap_1.c:6:16: note: '__sync_val_compare_and_swap_1' is a builtin with type 'char (volatile char *, char, char, ...)'