UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Unreferenced function even if it's in a linked library

    Scheduled Pinned Locked Moved General
    1 Posts 1 Posters 1.0k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • 4 Offline
        4javier
        last edited by

        Hi guys.
        I'm blocked with this error:

        target StaticExecutable: sdcard (/home/Ubuntu/javier/dati/download/part-tree/out/target/product/y991/obj/EXECUTABLES/sdcard_intermediates/LINKED/sdcard)
        /home/Ubuntu/javier/dati/download/part-tree/out/target/product/y991/obj/STATIC_LIBRARIES/liblogwrap_intermediates/liblogwrap.a(logwrap.o): In function `do_log_line':
        /home/Ubuntu/javier/dati/download/part-tree/system/core/logwrapper/logwrap.c:160: undefined reference to `klog_write'
        /home/Ubuntu/javier/dati/download/part-tree/system/core/logwrapper/logwrap.c:160: undefined reference to `klog_write'
        /home/Ubuntu/javier/dati/download/part-tree/system/core/logwrapper/logwrap.c:160: undefined reference to `klog_write'
        /home/Ubuntu/javier/dati/download/part-tree/system/core/logwrapper/logwrap.c:160: undefined reference to `klog_write'
        collect2: error: ld returned 1 exit status
        make: *** [/home/Ubuntu/javier/dati/download/part-tree/out/target/product/y991/obj/EXECUTABLES/sdcard_intermediates/LINKED/sdcard] Error 1
        

        This is the interesting part of the Android.mk for liblogwrap

        LOCAL_PATH:= $(call my-dir)
        
        include $(CLEAR_VARS)
        
        # ========================================================
        # Static library
        # ========================================================
        include $(CLEAR_VARS)
        LOCAL_MODULE := liblogwrap
        LOCAL_SRC_FILES := logwrap.c
        LOCAL_SHARED_LIBRARIES := libcutils liblog
        LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
        LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
        LOCAL_CFLAGS := -Werror
        include $(BUILD_STATIC_LIBRARY)
        

        This is the grep matching the function not found inside ./target/product/y991/obj/SHARED_LIBRARIES/libcutils_intermediates/LINKED/libcutils.so

        nm -C ./target/product/y991/obj/SHARED_LIBRARIES/libcutils_intermediates/LINKED/libcutils.so | grep klog_write
        000000000000a504 T klog_write
        

        Why it can't find that?

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post