Support #1188


Static/dynamic library linking behavior change (10.1 -> 10.2+)

Added by Alex Afanasyev almost 6 years ago. Updated almost 6 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
CPU Architecture:
Host OS:
Android version:
CrystaX Version:


There was some change in linking behavior, which may or may not be an issue.

I'm attaching a simple project that is able to reproduce the change:

  • test app linked to shared library
  • shared library linked with static library
  • the shared library has a method to access static variable defined in the static library
  • the test app accesses method from shared library and also directly accessing static variable from the static library (the app itself is not linked to static library, at least not explicitly).

Behavior in ndk 10.1.0 (I have also verified that it is behavior in google ndk r10e):

  • calls in the test app refer to the same memory

Behavior in ndk 10.2.0 and 10.3.0:

  • calls refer to different memory locations


ndk-test.tar.xz ndk-test.tar.xz 18 KB Alex Afanasyev, 12/17/2015 02:52 AM
Actions #1

Updated by Alex Afanasyev almost 6 years ago

Small addition.

The way I tested:

  • start x86 emulator

  • build


  • copy

adb push libs/x86 /data/local/test

  • ssh to emulator and run the test

adb shell
LD_LIBRARY_PATH=/data/local/test /data/local/test/test

Actions #2

Updated by Dmitry Moskalchuk almost 6 years ago

  • Assignee set to Dmitry Moskalchuk
  • Priority changed from Normal to High
  • Target version set to 10.3.1
Actions #3

Updated by Dmitry Moskalchuk almost 6 years ago

  • CrystaX Version set to 10.2.1
Actions #4

Updated by Dmitry Moskalchuk almost 6 years ago

  • Status changed from Open to In Progress
Actions #5

Updated by Dmitry Moskalchuk almost 6 years ago

  • Category set to build/core
  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

Alex, thank you for reporting this issue! Having your minimal example, I was able to reproduce it.

It was a bug, introduced by "this": commit. I've "fixed": it and added test case, preventing its appearing in the future.

This fix will be included to the upcoming 10.3.1 release.


Also available in: Atom PDF