Skip to content

[BUG] 'link.txt' has wrong linker for cross-compile #1350

@wkunice

Description

@wkunice

I am cross compiling C, C++ code using the NDK.
I am using 'cmake' files that first build small static libraries and then links them together to build a single large shared library.
I am using the android.toolchain.cmake file for the CMAKE_TOOLCHAIN_FILE.

When it tries to build the shared library I get errors:
bin/ld: error: no archive symbol table (run ranlib)

I dig down to the build directory and the 'link.txt' file has
"gcc-ar ....." that generates the library from the .o's.

it should be generating the link.txt file with the cross compiler <....-ar> and <....-ranlib> programs to generate the library.

When I change the 'link.txt file to have:
arm-...-ar library
arm...-ranlib library.a

the shared library link works.

  • NDK Version: 21.3
  • Build system: cmake
  • Host OS: Linux
  • ABI:
  • NDK API level:
  • Device API level:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions