Issue
Here is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set(sources ...)
set(includes ...)
add_library(mylib SHARED ${sources})
include_directories(${includes})
find_library(log-lib log )
target_link_libraries(test ${log-lib} )
When I compile my library is built successfully and when I run file
it says library is stripped. I have used the following attribute for global variables:
__attribute__((visibility("hidden"))
But this does not seem to affect armeabi-v7a. I still see them in the libraries export symbol table for armeabi-v7a. Is there anything I can do to hide this?
Solution
Solved:
@rprichard commented on 19 Feb 2019
This looks like the same issue as https://bugs.llvm.org/show_bug.cgi?id=39413 / #829.-Oz
turns on the GlobalMerge optimization, which isn't preserving the visibility attributes on variables.Adding
-mno-global-merge
to the cflags is a workaround
Source - https://github.com/android/ndk/issues/913#issuecomment-465357660
Answered By - Android
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.