The Question
This is not about legal advice. We are asking why/how the GNU libstdc++ library seemingly found its way into our app, when to the best of our knowledge it should not be part of our app, according to our IDE setup.
Context
We recently used Android's documentation to include open source notices in our app. After using this, an activity can be shown presumably listing all the open-source software (OSS) dependencies in our app. Clicking on any of these dependencies shows the relevant OSS license.
In the list of autogenerated OSS dependencies there is an entry titled STL, which when clicked displays the following text:
SGI STL
The STL portion of GNU libstdc++ that is used with gcc3 and gcc4 is licensed under the GPL, with the following exception:
[...]
The problem is that to the best of our knowledge we do not use the GNU libstdc++ nor do we use the gcc3/gcc4 compiler in our app, according to our IDE setup.
IDE Setup
We use Android Studio and the JNI to also compile code written in C++. Our C++ code uses the standard library (e.g. we use the string class among others).
This guide from Android's documentation states that
LLVM's libc++ is the C++ standard library that has been used by the Android OS since Lollipop, and as of NDK r18 is the only STL available in the NDK.
We are way past Lollipop and the NDK we use is 21.4.7075529, so this should be enough to guarantee that the standard library used in our app is LLVM's libc++ (and not GNU's libstdc++). But in any case, we also specify Clang (which is part of the LLVM) as the compiler, just to be sure.
All of this is reflected in our build.gradle (app) file, some parts of which are pasted below:
...
android {
compileSdkVersion 33
ndkVersion "21.4.7075529"
...
defaultConfig {
...
externalNativeBuild {
cmake {
...
arguments "-DANDROID_STL=c++_shared","-DANDROID_TOOLCHAIN=clang"
}
}
}
}
Just in case it is relevant, we also include the following line in our CMakeLists.txt:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
So what are we doing wrong here? There should not be any reference to GNU libstdc++, nor to the gcc compiler. Can anyone please help? Many thanks in advance!