我正在尝试构建https://github.com/iiordanov/remote-desktop-clients/tree/master/eclipse_projects/Opaque的源代码。
现在构建gstreamer库时出现错误:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
Error while executing 'D:\Entwicklung\Android\ndk-bundle\ndk-build.cmd' with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=D:\Entwicklung\Android-Projekte\app\Spice-Client\app\jni\src\Android.mk APP_ABI=mips64 NDK_ALL_ABIS=mips64 NDEBUG=1 APP_PLATFORM=android-21 NDK_OUT=D:/Entwicklung/Android-Projekte/app/Spice-Client/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=D:\Entwicklung\Android-Projekte\app\Spice-Client\app\build\intermediates\ndkBuild\debug\lib gst-build-mips64/libgstreamer_android.so}
Android NDK: WARNING:D:\Entwicklung\Android-Projekte\app\Spice-Client\app\jni\src\Android.mk:spice: non-system libraries in linker flags: D:/Entwicklung/Android-Projekte/app/Spice-Client/app/jni/src/../libs/deps/lib/libssl.a D:/Entwicklung/Android-Projekte/app/Spice-Client/app/jni/src/../libs/deps/lib/libcrypto.a D:/Entwicklung/Android-Projekte/app/Spice-Client/app/jni/src/../libs/deps/lib/libcelt051.a D:/Entwicklung/Android-Projekte/app/Spice-Client/app/jni/src/../libs/deps/lib/libgovirt.a D:/Entwicklung/Android-Projekte/app/Spice-Client/app/jni/src/../libs/deps/lib/librest-0.7.a D:/Entwicklung/Android-Projekte/app/Spice-Client/app/jni/src/../libs/deps/lib/libjpeg.a D:/Entwicklung/Android-Projekte/app/Spice-Client/app/jni/src/../libs/deps/lib/libusb.a D:/Entwicklung/Android-Projekte/app/Spice-Client/app/jni/src/../libs/deps/lib/libusbredirhost.a D:/Entwicklung/Android-Projekte/app/Spice-Client/app/jni/src/../libs/deps/lib/libusbredirparser.a
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
Android NDK: current module
GStreamer : [GEN] => gst-build-mips64/gstreamer_android.c
GStreamer : [COMPILE] => gst-build-mips64/gstreamer_android.c
GStreamer : [LINK] => gst-build-mips64/libgstreamer_android.so
clang.exe: error: invalid linker name in argument '-fuse-ld=gold'
make: *** [buildsharedlibrary_mips64] Error 1
我还尝试将链接器重命名为" gold.exe",但它没有改变任何东西 我目前正在使用ARM Build of GStreamer版本1.9.2 https://gstreamer.freedesktop.org/data/pkg/android/1.9.2/
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LIB_PATH := $(LOCAL_PATH)/../../libs/armeabi
SPICE_CLIENT_ANDROID_DEPS := $(LOCAL_PATH)/../libs/deps
GSTREAMER_ROOT := $(LOCAL_PATH)/../../libs/gstreamer
CROSS_DIR := $(LOCAL_PATH)/../../libs/gstreamer
spice_objs := \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/libssl.a \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/libcrypto.a \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/libcelt051.a \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/libgovirt.a \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/librest-0.7.a \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/libjpeg.a \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/libusb.a \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/libusbredirhost.a \
$(SPICE_CLIENT_ANDROID_DEPS)/lib/libusbredirparser.a
LOCAL_MODULE := spice
LOCAL_SRC_FILES := gtk/spice-uri.c gtk/channel-record.c gtk/channel-playback.c gtk/channel-cursor.c \
gtk/channel-webdav.c gtk/spice-cmdline.c gtk/coroutine_gthread.c gtk/spice-util.c \
gtk/spice-session.c gtk/spice-channel.c gtk/spice-marshal.c gtk/spice-glib-enums.c \
gtk/gio-coroutine.c gtk/channel-base.c gtk/channel-main.c gtk/spice-proxy.c gtk/bio-gsocket.c \
gtk/glib-compat.c gtk/channel-display.c gtk/channel-display-mjpeg.c gtk/channel-inputs.c \
gtk/decode-glz.c gtk/decode-jpeg.c gtk/decode-zlib.c gtk/wocky-http-proxy.c gtk/channel-port.c \
gtk/spice-client.c gtk/spice-audio.c gtk/spice-gstaudio.c gtk/vmcstream.c \
gtk/channel-usbredir.c gtk/usb-device-manager.c gtk/usbutil.c gtk/bio-gio.c \
spice-common/common/generated_client_demarshallers.c spice-common/common/generated_client_demarshallers1.c \
spice-common/common/generated_client_marshallers.c spice-common/common/generated_client_marshallers1.c \
spice-common/common/mem.c spice-common/common/marshaller.c spice-common/common/canvas_utils.c \
spice-common/common/backtrace.c spice-common/common/sw_canvas.c spice-common/common/pixman_utils.c \
spice-common/common/lines.c spice-common/common/rop3.c spice-common/common/quic.c spice-common/common/lz.c \
spice-common/common/region.c spice-common/common/ssl_verify.c spice-common/common/log.c \
spice-common/common/snd_codec.c \
virt-viewer/virt-viewer-file.c virt-viewer/virt-viewer-util.c \
android/android-service.c android/android-spicy.c android/android-spice-widget.c \
android/android-io.c
LOCAL_LDLIBS += $(spice_objs) \
-ljnigraphics -llog -ldl -lstdc++ -lz \
-malign-double -malign-loops
LOCAL_CPPFLAGS += -DG_LOG_DOMAIN=\"GSpice\" \
-DSW_CANVAS_CACHE \
-DHAVE_CONFIG_H -UHAVE_SYS_SHM_H -DSW_CANVAS_CACHE \
-D_REENTRANT -DWITH_GSTAUDIO
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/gtk \
$(LOCAL_PATH)/spice-common \
$(LOCAL_PATH)/spice-common/common \
$(LOCAL_PATH)/spice-common/spice-protocol \
$(LOCAL_PATH)/virt-viewer \
$(SPICE_CLIENT_ANDROID_DEPS)/include \
$(SPICE_CLIENT_ANDROID_DEPS)/include/govirt-1.0 \
$(SPICE_CLIENT_ANDROID_DEPS)/include/rest-0.7 \
$(SPICE_CLIENT_ANDROID_DEPS)/include/jpeg-turbo \
$(SPICE_CLIENT_ANDROID_DEPS)/include/libusb \
$(SPICE_CLIENT_ANDROID_DEPS)/include/usbredirparser \
$(SPICE_CLIENT_ANDROID_DEPS)/include/usbredirhost \
$(CROSS_DIR)/include \
$(CROSS_DIR)/include/glib-2.0 \
$(CROSS_DIR)/include/libxml2 \
$(CROSS_DIR)/include/pixman-1 \
$(CROSS_DIR)/include/spice-1 \
$(CROSS_DIR)/lib/glib-2.0/include
LOCAL_CFLAGS := $(LOCAL_CPPFLAGS) \
-std=gnu99 -Wall -Wno-sign-compare -Wno-deprecated-declarations -Wl,--no-undefined \
-fPIC -DPIC -O3 -funroll-loops -ffast-math
LOCAL_EXPORT_CFLAGS += $(LOCAL_CFLAGS)
LOCAL_EXPORT_LDLIBS += $(LOCAL_LDLIBS)
LOCAL_ARM_MODE := arm
LOCAL_SHARED_LIBRARIES := gstreamer_android
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
GSTREAMER_SDK_ROOT_ANDROID := $(LOCAL_PATH)/../../libs/gstreamer
ifndef GSTREAMER_SDK_ROOT
ifndef GSTREAMER_SDK_ROOT_ANDROID
$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
endif
GSTREAMER_SDK_ROOT := $(GSTREAMER_SDK_ROOT_ANDROID)
endif
GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build/
include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_SYS)
G_IO_MODULES := gnutls
GSTREAMER_EXTRA_DEPS := pixman-1 gstreamer-app-1.0 libsoup-2.4 libxml-2.0 gthread-2.0 gobject-2.0 glib-2.0 gio-unix-2.0
TARGET_LDFLAGS := -z muldefs
include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk
那么有人知道如何解决这个错误吗?
答案 0 :(得分:1)
看起来gstreamer无条件通过-fuse-ld=gold
:
$ grep -rI fuse-ld .
...
./share/gst-android/ndk-build/gstreamer-1.0.mk:GSTREAMER_LD := -fuse-ld=gold -Wl,-soname,lib$(GSTREAMER_ANDROID_MODULE_NAME).so
NDK没有为mips / mips64发货ld.gold。您需要对-fuse-ld=gold
使用TARGET_ARCH
,如此:
# mips/mips64 don't have ld.gold.
ifeq (,$(filter mips mips64,$(TARGET_ARCH)))
LOCAL_LDFLAGS += -fuse-ld=gold
endif
或者,不要通过-fuse-ld=gold
。对于其他架构,NDK将默认使用它(除了aarch64,其中bfd仍然是默认值)。
答案 1 :(得分:0)
预编译的gstreamer二进制文件还不包括mips支持。你应该从构建中排除mips ..