Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AOSP hardwera service(aidl) build commonAPI gen_code failed #3

Open
meiGming opened this issue Apr 4, 2023 · 0 comments
Open

AOSP hardwera service(aidl) build commonAPI gen_code failed #3

meiGming opened this issue Apr 4, 2023 · 0 comments

Comments

@meiGming
Copy link

meiGming commented Apr 4, 2023

Using AIDL to generate native service,build commonAPI gen_code and AIDL platform_ndk.so
build failed: error message

external/libcxx/include/memory:4972:16: error: use of dynamic_cast requires -frtti
_Tp* __p = dynamic_cast<_Tp*>(__r.get());

this error message solution:Android.bp add :rtti :true
but cause a new problem,
ld.lld: error: undefined symbol: typeinfo for aidl::android::hardware::xxx::adcu_hmiservice::BnAdcuService

referenced by AdcuHmiServiceStub.cpp
out/soong/.intermediates/hardware/interfaces/xxx/adcu/default/android.hardware.xxx.adcu_hmiservice_bin/android_vendor.32_arm64_armvnterfaces/xxx/adcu/default/src/AdcuHmiServiceStub.o:(typeinfo for aidl::android::hardware::xxx::adcu_hmiservice::stub::AdcuHmiServiceStub)
did you mean: vtable for aidl::android::hardware::xxx::adcu_hmiservice::BnAdcuService
defined in: out/soong/.intermediates/hardware/interfaces/xxx/adcu/android.hardware.xxx.adcu_hmiservice-V1-ndk_platform/android_vendor.32_arm64_arid.hardware.xxx.adcu_hmiservice-V1-ndk_platform.so
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
13:49:29 ninja failed with: exit status 1

AIDL gencode build failed,
Have you ever encountered this problem
Android.bp

cc_binary {
name: "android.hardware.xxx.adcu_hmiservice_bin",
relative_install_path: "hw",
stl: "c++_shared",
init_rc: ["config/xxx-adcu_hmiservice1.rc"],
vintf_fragments: ["config/xxx-adcu_hmiservice1.xml"],
vendor: true,
owner:"omg",
srcs: [
"src/AdcuHmiServiceMain.cpp",
"src/AdcuHmiServiceStub.cpp",
],
//ldflags: ["-export-dynamic"],
shared_libs: [
"libbase",
"libbinder_ndk",
"android.hardware.xxx.adcu_hmiservice-V1-ndk_platform",
"libCommonAPI",
"libADCU_HmiService-someip",
],
local_include_dirs: ["include", "src", "include/aidl/android/hardware/xxx/adcu_hmiservice/"],

 cppflags: [                   
    "-DBOOST_LOG_DYN_LINK",
    "-D_GLIBCXX_USE_NANOSLEEP",
    "-fexceptions",
    "-Wc++17-extensions",
    "-Wno-non-virtual-dtor",
    "-Wno-unused-const-variable",
    "-Wno-unused-parameter",
    "-Wno-unused-private-field",
    "-Wno-unused-lambda-capture",
    "-Wno-unused-variable",
    "-Wno-unused-local-typedef",
    "-Wno-sign-compare",
    "-Wno-format",
    "-frtti",
    "-Wno-header-guard",
    "-Wno-overloaded-virtual",
    "-Wno-implicit-fallthrough",
    "-Wno-error",
    "-Bdynamic",
    "-Wno-shorten-64-to-32",
    "-D_GTHREAD_USE_MUTEX_INIT_FUNC",
    "-D_GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC",],
   // rtti: true

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant