D8173: Use readelf to find project dependencies

Aleix Pol Gonzalez noreply at phabricator.kde.org
Wed Nov 15 00:03:38 UTC 2017


apol added a comment.


  In https://phabricator.kde.org/D8173#167835, @aacid wrote:
  
  > In https://phabricator.kde.org/D8173#167776, @apol wrote:
  >
  > > I either need more information
  >
  >
  > I'm happy to provide any information you want, i just don't know what you need other than KConfigCore.so is in the apk without your patch and not with your patch.
  
  
  Here's a little patch that you can apply and will offer a bit more information:
  
    diff --git a/toolchain/specifydependencies.cmake b/toolchain/specifydependencies.cmake
    index 60b7e94..3406d1e 100644
    --- a/toolchain/specifydependencies.cmake
    +++ b/toolchain/specifydependencies.cmake
    @@ -1,3 +1,4 @@
    +message(STATUS "executing: readelf --wide --dynamic ${TARGET}")
     execute_process(COMMAND readelf --wide --dynamic ${TARGET} ERROR_VARIABLE readelf_errors OUTPUT_VARIABLE out RESULT_VARIABLE result)
     
     if (NOT result EQUAL 0)
    @@ -11,13 +12,16 @@ foreach(line ${lines})
         if(matched)
             if(EXISTS "${OUTPUT_DIR}/${CMAKE_MATCH_1}")
                 list(APPEND extralibs "${OUTPUT_DIR}/${CMAKE_MATCH_1}")
    -        endif()
    -        if(EXISTS "${EXPORT_DIR}/lib/${CMAKE_MATCH_1}")
    +        elseif(EXISTS "${EXPORT_DIR}/lib/${CMAKE_MATCH_1}")
                 list(APPEND extralibs "${EXPORT_DIR}/lib/${CMAKE_MATCH_1}")
    +        else()
    +            message(STATUS "could not find ${line} in ${EXPORT_DIR}/lib or ${OUTPUT_DIR}")
             endif()
         endif()
     endforeach()
     
    +message(STATUS "extra libs: ${extralibs}")
    +
     if(extralibs)
         string(REPLACE ";" "," libs "${extralibs}")
         set(extralibs "\"android-extra-libs\": \"${libs}\",")
  
  You should get something like (this is a valid output, which you aren't having):
  
    Generating ktuberling_mobile with /opt/Qt/5.9.1/android_armv7/bin/androiddeployqt
    -- executing: readelf --wide --dynamic /home/user/build/ktuberling/ktuberling_mobile
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libgnustl_shared.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [liblog.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libz.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libdl.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libQt5Svg.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libQt5Multimedia.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libQt5Xml.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libQt5Widgets.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libQt5Gui.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libQt5Network.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libQt5Core.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libstdc++.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libm.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- could not find  0x00000001 (NEEDED)                     Shared library: [libc.so] in /opt/kdeandroid-deps/lib or /home/user/build/ktuberling
    -- extra libs: /opt/kdeandroid-deps/lib/libKF5ConfigCore.so
    Generating Android Package
  
  Then we see how to figure it out.

REPOSITORY
  R240 Extra CMake Modules

REVISION DETAIL
  https://phabricator.kde.org/D8173

To: apol, #frameworks, #build_system, aacid
Cc: mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20171115/6ddc5c19/attachment-0001.html>


More information about the Kde-buildsystem mailing list