简体   繁体   中英

GStreamer linking error

I'm trying to build the source code of https://github.com/iiordanov/remote-desktop-clients/tree/master/eclipse_projects/Opaque .

Now there's an error while building the gstreamer library:

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

I also tried to rename the linker to "gold.exe", but it doesn't change anything I'm currently using the ARM Build of GStreamer Version 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

So does anybody know how to solve this error?

Looks like gstreamer unconditionally passes -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

The NDK doesn't ship ld.gold for mips/mips64. You need to gate -fuse-ld=gold use against TARGET_ARCH like so:

# mips/mips64 don't have ld.gold.
ifeq (,$(filter mips mips64,$(TARGET_ARCH)))
    LOCAL_LDFLAGS += -fuse-ld=gold
endif

Alternatively, just don't pass -fuse-ld=gold . The NDK will default to it for the other architectures (aside from aarch64, where bfd is still the default).

Precompiled gstreamer binaries does not include mips support yet. You should exclude mips from build..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM