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

[Continued] Cannot find reference for enum class member in Android build system, but command line compile is fine. #1201

Open
fiddleyuan opened this issue Jun 19, 2018 · 2 comments

Comments

@fiddleyuan
Copy link

fiddleyuan commented Jun 19, 2018

This is a continued topic for issue #1197

This is a issue found in C++ project in Android, where I cannot find all reference for enum class member, but typedef'ed enum member is working perfectly. @cslux once made a sample C++ source code. I tested in command line compile with g++:
rc -c g++ -std=c++11 -Wall -Wextra test.cpp -o test
It turns out working fine in finding references.

So I modify source code to build it in Android build system:

  • create a Android.mk file, this is very typical in Android build system:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := TestRTags
LOCAL_SRC_FILES := src/test.cpp
LOCAL_INC_FILES := inc/test.h
LOCAL_CFLAGS := -Wall -Wno-unused-parameter -Wextra

include $(BUILD_EXECUTABLE)
  • create two folders: src and inc
    In inc, there's test.h header file:
#include <iostream>

typedef enum{
    Type1,
    Type2,
    Type3
} Type;

enum class Format {
    FormatInvalid = -1,
    Format1,
    Format2,
    Format3,
};

In src, we have test.cpp source file:

#include `test.h`

int main()
{
    Format format = Format::Format3;

    if (format == Format::Format3)
        std::cout << "Format3" << std::endl;
    else if (format == Format::Format2)
        std::cout << "Format2" << std::endl;
    else if (format == Format::Format1)
        std::cout << "Format1" << std::endl;
    else
        std::cout << "Error " << static_cast<std::underlying_type<Format>::type>(Format::FormatInvalid) << std::endl;

    std::cout << "Value of enum class: " << static_cast<std::underlying_type<Format>::type>(Format::Format1) << std::endl;
    std::cout << "Value of enum: " << Type1 << std::endl;;
    return 0;
}

And here's what I got:

  • In command line compile, RTags finding reference is still working good.
  • In Android build, I cannot find reference for enum class member.

So the problem tends to be in Android build itself. In order to find the differences, I collected both rdm logging:

  • Using command line compile, i.e. using rc -c ...
listening /run/user/1000/rdm.socket
Running with 8 jobs, using args: -ferror-limit=50 -Wall -fspell-checking -Wno-unknown-warning-option
Includepaths: "-isystem" /usr/lib/llvm-3.4/lib/clang/3.4/include/

Parsed Source(s) successfully: List<Source>(Source(/usr/bin/g++ -std=c++11 -Wall -Wextra -ferror-limit=50 -Wall -fspell-checking -Wno-unknown-warning-option -DRTAGS= -isystem /usr/lib/llvm-3.4/lib/clang/3.4/include/ -o /home/shuaiy/proj/Android/vendor/test_rtags/test /home/shuaiy/proj/Android/vendor/test_rtags/src/test.cpp Build: /home/shuaiy/proj/Android/ compile_commands: ))
[100%] 1/1 12:00:41 ~/proj/Android/vendor/test_rtags/src/test.cpp in 535ms. (34106 syms, 43711 symNames, 289 includes, 129 of 129 files, symbols: 42314 of 42314, 50792 cursors, 23581802 bytes written, 128 queried 9ms) (140/250/81ms). (priority 0)
Jobs took 0.54s. We're using 4mb of memory.
Query opened 0 files for project /home/shuaiy/proj/Android/vendor/test_rtags/
Output from /home/shuaiy/proj/Android/vendor/test_rtags/src/test.cpp:
CI::parse loading unit: clang "-std=c++11" "-Wall" "-Wextra" "-ferror-limit=50" "-Wall" "-fspell-checking" "-Wno-unknown-warning-option" "-DRTAGS=" "-isystem" "/usr/lib/llvm-3.4/lib/clang/3.4/include/" /home/shuaiy/proj/Android/vendor/test_rtags/src/test.cpp true


rc -e -R Format3
=> src/test.cpp:5:29:       Format format = Format::Format3;
=> src/test.cpp:7:27:       if (format == Format::Format3)
=> inc/test.h:13:5:         Format3,
Query opened 261 files for project /home/shuaiy/proj/Android/vendor/test_rtags/
rc -e -R Type1
=> src/test.cpp:17:39:      std::cout << "Value of enum: " << Type1 << std::endl;;
=> inc/test.h:4:5:          Type1,
Query opened 261 files for project /home/shuaiy/proj/Android/vendor/test_rtags/
  • Using Android build system
listening /run/user/1000/rdm.socket
Running with 8 jobs, using args: -ferror-limit=50 -Wall -fspell-checking -Wno-unknown-warning-option
Includepaths: "-isystem" /usr/lib/llvm-3.4/lib/clang/3.4/include/

Parsed Source(s) successfully: List<Source>(Source(/usr/bin/c++ -c -fno-exceptions -Wno-multichar -fno-strict-aliasing -fstack-protector-strong -ffunction-sections -fdata-sections -funwind-tables -Wa,--noexecstack -Werror=format-security -fno-short-enums -no-canonical-prefixes -Werror=pointer-to-int-cast -Werror=int-to-pointer-cast -Werror=implicit-function-declaration -O2 -g -Wstrict-aliasing=2 -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -UDEBUG -fdebug-prefix-map=/proc/self/cwd= -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -fdebug-prefix-map=/home/shuaiy/proj/Android/= -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -nostdlibinc -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -fvisibility-inlines-hidden -std=gnu++14 -fno-rtti -Wall -Wno-unused-parameter -Wextra -fpie -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -mno-ae -Wno-vectorizer-no-neon -ferror-limit=50 -Wall -fspell-checking -Wno-unknown-warning-option -D_FORTIFY_SOURCE=2 -D__compiler_offsetof=__builtin_offsetof -DANDROID -DANDROID_STRICT -DNDEBUG -D_USING_LIBCXX -DRTAGS= -I/home/shuaiy/proj/Android/vendor/test_rtags -I/home/shuaiy/proj/Android/out/target/product/sdm845/obj/EXECUTABLES/TestRTags_intermediates -Iout/target/product/sdm845/gen/EXECUTABLES/TestRTags_intermediates -I/home/shuaiy/proj/Android/libnativehelper/include/nativehelper -I/home/shuaiy/proj/Android/external/libcxx/include -I/home/shuaiy/proj/Android/external/libcxxabi/include -I/home/shuaiy/proj/Android/system/core/include -I/home/shuaiy/proj/Android/system/media/audio/include -I/home/shuaiy/proj/Android/hardware/libhardware/include -I/home/shuaiy/proj/Android/hardware/libhardware_legacy/include -I/home/shuaiy/proj/Android/hardware/ril/include -I/home/shuaiy/proj/Android/libnativehelper/include -I/home/shuaiy/proj/Android/frameworks/native/include -I/home/shuaiy/proj/Android/frameworks/native/opengl/include -isystem /home/shuaiy/proj/Android/frameworks/av/include -isystem /home/shuaiy/proj/Android/out/target/product/sdm845/obj/include -isystem /home/shuaiy/proj/Android/bionic/libc/arch-arm64/include -isystem /home/shuaiy/proj/Android/bionic/libc/include -isystem /home/shuaiy/proj/Android/bionic/libc/kernel/uapi -isystem /home/shuaiy/proj/Android/bionic/libc/kernel/uapi/asm-arm64 -isystem /home/shuaiy/proj/Android/bionic/libc/kernel/android/uapi -isystem /usr/lib/llvm-3.4/lib/clang/3.4/include/ -o /home/shuaiy/proj/Android/out/target/product/sdm845/obj/EXECUTABLES/TestRTags_intermediates/src/test.o /home/shuaiy/proj/Android/vendor/test_rtags/src/test.cpp Build: /home/shuaiy/proj/Android/ compile_commands: ))
[100%] 1/1 11:40:46 ~/proj/Android/vendor/test_rtags/src/test.cpp in 1181ms. (78896 syms, 92162 symNames, 421 includes, 135 of 135 files, symbols: 99843 of 99843, 120293 cursors, 54425165 bytes written, 134 queried 13ms) (203/635/198ms). (priority 0)
Jobs took 1.19s. We're using 5mb of memory.
Query opened 0 files for project /home/shuaiy/proj/Android/.rtags/
Output from /home/shuaiy/proj/Android/vendor/test_rtags/src/test.cpp:
CI::parse loading unit: clang "-c" "-fno-exceptions" "-Wno-multichar" "-fno-strict-aliasing" "-fstack-protector-strong" "-ffunction-sections" "-fdata-sections" "-funwind-tables" "-Wa,--noexecstack" "-Werror=format-security" "-fno-short-enums" "-no-canonical-prefixes" "-Werror=pointer-to-int-cast" "-Werror=int-to-pointer-cast" "-Werror=implicit-function-declaration" "-O2" "-g" "-Wstrict-aliasing=2" "-fmessage-length=0" "-W" "-Wall" "-Wno-unused" "-Winit-self" "-Wpointer-arith" "-UDEBUG" "-fdebug-prefix-map=/proc/self/cwd=" "-Werror=int-conversion" "-Wno-reserved-id-macro" "-Wno-format-pedantic" "-Wno-unused-command-line-argument" "-fcolor-diagnostics" "-Wno-expansion-to-defined" "-fdebug-prefix-map=/home/shuaiy/proj/Android/=" "-Werror=return-type" "-Werror=non-virtual-dtor" "-Werror=address" "-Werror=sequence-point" "-Werror=date-time" "-nostdlibinc" "-target" "aarch64-linux-android" "-Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin" "-Wsign-promo" "-Wno-inconsistent-missing-override" "-Wno-null-dereference" "-fvisibility-inlines-hidden" "-std=gnu++14" "-fno-rtti" "-Wall" "-Wno-unused-parameter" "-Wextra" "-fpie" "-Werror=int-to-pointer-cast" "-Werror=pointer-to-int-cast" "-Werror=address-of-temporary" "-Werror=return-type" "-mno-ae" "-Wno-vectorizer-no-neon" "-ferror-limit=50" "-Wall" "-fspell-checking" "-Wno-unknown-warning-option" "-DRTAGS=" "-D_FORTIFY_SOURCE=2" "-D__compiler_offsetof=__builtin_offsetof" "-DANDROID" "-DANDROID_STRICT" "-DNDEBUG" "-D_USING_LIBCXX" "-I/home/shuaiy/proj/Android/vendor/test_rtags" "-I/home/shuaiy/proj/Android/out/target/product/sdm845/obj/EXECUTABLES/TestRTags_intermediates" "-Iout/target/product/sdm845/gen/EXECUTABLES/TestRTags_intermediates" "-I/home/shuaiy/proj/Android/libnativehelper/include/nativehelper" "-I/home/shuaiy/proj/Android/external/libcxx/include" "-I/home/shuaiy/proj/Android/external/libcxxabi/include" "-I/home/shuaiy/proj/Android/system/core/include" "-I/home/shuaiy/proj/Android/system/media/audio/include" "-I/home/shuaiy/proj/Android/hardware/libhardware/include" "-I/home/shuaiy/proj/Android/hardware/libhardware_legacy/include" "-I/home/shuaiy/proj/Android/hardware/ril/include" "-I/home/shuaiy/proj/Android/libnativehelper/include" "-I/home/shuaiy/proj/Android/frameworks/native/include" "-I/home/shuaiy/proj/Android/frameworks/native/opengl/include" "-isystem" "/home/shuaiy/proj/Android/frameworks/av/include" "-isystem" "/home/shuaiy/proj/Android/out/target/product/sdm845/obj/include" "-isystem" "/home/shuaiy/proj/Android/bionic/libc/arch-arm64/include" "-isystem" "/home/shuaiy/proj/Android/bionic/libc/include" "-isystem" "/home/shuaiy/proj/Android/bionic/libc/kernel/uapi" "-isystem" "/home/shuaiy/proj/Android/bionic/libc/kernel/uapi/asm-arm64" "-isystem" "/home/shuaiy/proj/Android/bionic/libc/kernel/android/uapi" "-isystem" "/usr/lib/llvm-3.4/lib/clang/3.4/include/" /home/shuaiy/proj/Android/vendor/test_rtags/src/test.cpp true
Can't decide which of these symbols are right for me DeclRefExpr ref /home/shuaiy/proj/Android/external/libcxx/include/memory:4568:12 List<CXCursor>(CXXMethod cursor make_shared() make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@F@make_shared#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3842:28, FunctionTemplate cursor make_shared(_A0 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>1#Tmake_shared#&t1.0#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3845:32, FunctionTemplate cursor make_shared(_A0 &, _A1 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>2#T#Tmake_shared#&t1.0#&t1.1#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3848:32, FunctionTemplate cursor make_shared(_A0 &, _A1 &, _A2 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>3#T#T#Tmake_shared#&t1.0#&t1.1#&t1.2#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3851:32) Need to parse types
Can't decide which of these symbols are right for me DeclRefExpr ref /home/shuaiy/proj/Android/external/libcxx/include/memory:4576:12 List<CXCursor>(CXXMethod cursor make_shared() make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@F@make_shared#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3842:28, FunctionTemplate cursor make_shared(_A0 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>1#Tmake_shared#&t1.0#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3845:32, FunctionTemplate cursor make_shared(_A0 &, _A1 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>2#T#Tmake_shared#&t1.0#&t1.1#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3848:32, FunctionTemplate cursor make_shared(_A0 &, _A1 &, _A2 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>3#T#T#Tmake_shared#&t1.0#&t1.1#&t1.2#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3851:32) Need to parse types
Can't decide which of these symbols are right for me DeclRefExpr ref /home/shuaiy/proj/Android/external/libcxx/include/memory:4584:12 List<CXCursor>(CXXMethod cursor make_shared() make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@F@make_shared#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3842:28, FunctionTemplate cursor make_shared(_A0 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>1#Tmake_shared#&t1.0#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3845:32, FunctionTemplate cursor make_shared(_A0 &, _A1 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>2#T#Tmake_shared#&t1.0#&t1.1#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3848:32, FunctionTemplate cursor make_shared(_A0 &, _A1 &, _A2 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>3#T#T#Tmake_shared#&t1.0#&t1.1#&t1.2#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3851:32) Need to parse types
Can't decide which of these symbols are right for me DeclRefExpr ref /home/shuaiy/proj/Android/external/libcxx/include/memory:4592:12 List<CXCursor>(CXXMethod cursor make_shared() make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@F@make_shared#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3842:28, FunctionTemplate cursor make_shared(_A0 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>1#Tmake_shared#&t1.0#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3845:32, FunctionTemplate cursor make_shared(_A0 &, _A1 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>2#T#Tmake_shared#&t1.0#&t1.1#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3848:32, FunctionTemplate cursor make_shared(_A0 &, _A1 &, _A2 &) make_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>3#T#T#Tmake_shared#&t1.0#&t1.1#&t1.2#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3851:32) Need to parse types
Can't decide which of these symbols are right for me DeclRefExpr ref /home/shuaiy/proj/Android/external/libcxx/include/memory:4600:12 List<CXCursor>(FunctionTemplate cursor allocate_shared(const _Alloc &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>1#Tallocate_shared#&1t1.0#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3855:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>2#T#Tallocate_shared#&1t1.0#&t1.1#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3859:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &, _A1 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>3#T#T#Tallocate_shared#&1t1.0#&t1.1#&t1.2#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3863:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &, _A1 &, _A2 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>4#T#T#T#Tallocate_shared#&1t1.0#&t1.1#&t1.2#&t1.3#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3867:9) Need to parse types
Can't decide which of these symbols are right for me DeclRefExpr ref /home/shuaiy/proj/Android/external/libcxx/include/memory:4608:12 List<CXCursor>(FunctionTemplate cursor allocate_shared(const _Alloc &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>1#Tallocate_shared#&1t1.0#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3855:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>2#T#Tallocate_shared#&1t1.0#&t1.1#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3859:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &, _A1 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>3#T#T#Tallocate_shared#&1t1.0#&t1.1#&t1.2#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3863:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &, _A1 &, _A2 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>4#T#T#T#Tallocate_shared#&1t1.0#&t1.1#&t1.2#&t1.3#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3867:9) Need to parse types
Can't decide which of these symbols are right for me DeclRefExpr ref /home/shuaiy/proj/Android/external/libcxx/include/memory:4616:12 List<CXCursor>(FunctionTemplate cursor allocate_shared(const _Alloc &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>1#Tallocate_shared#&1t1.0#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3855:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>2#T#Tallocate_shared#&1t1.0#&t1.1#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3859:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &, _A1 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>3#T#T#Tallocate_shared#&1t1.0#&t1.1#&t1.2#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3863:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &, _A1 &, _A2 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>4#T#T#T#Tallocate_shared#&1t1.0#&t1.1#&t1.2#&t1.3#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3867:9) Need to parse types
Can't decide which of these symbols are right for me DeclRefExpr ref /home/shuaiy/proj/Android/external/libcxx/include/memory:4624:12 List<CXCursor>(FunctionTemplate cursor allocate_shared(const _Alloc &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>1#Tallocate_shared#&1t1.0#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3855:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>2#T#Tallocate_shared#&1t1.0#&t1.1#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3859:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &, _A1 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>3#T#T#Tallocate_shared#&1t1.0#&t1.1#&t1.2#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3863:9, FunctionTemplate cursor allocate_shared(const _Alloc &, _A0 &, _A1 &, _A2 &) allocate_shared c:@N@std@N@__1@CT>1#T@shared_ptr@FT@>4#T#T#T#Tallocate_shared#&1t1.0#&t1.1#&t1.2#&t1.3#S /home/shuaiy/proj/Android/external/libcxx/include/memory:3867:9) Need to parse types

rc -e -R Format3
=> /home/shuaiy/proj/Android/vendor/test_rtags/inc/test.h:13:5:      Format3,
Query opened 405 files for project /home/shuaiy/proj/Android/.rtags/
rc -e -R Format::Format3
=> /home/shuaiy/proj/Android/vendor/test_rtags/inc/test.h:13:5:      Format3,
Query opened 405 files for project /home/shuaiy/proj/Android/.rtags/
rc -e -R Type1
=> /home/shuaiy/proj/Android/vendor/test_rtags/src/test.cpp:17:39:           std::cout << "Value of enum: " << Type1 << std::endl;;
=> /home/shuaiy/proj/Android/vendor/test_rtags/inc/test.h:4:5:       Type1,
Query opened 273 files for project /home/shuaiy/proj/Android/.rtags/

Now, I'm seeking help from compiler and RTags expert, can we conclude something from both logging.
I really like RTags, I wish I could solve this problem. Thank you so much.

@fiddleyuan
Copy link
Author

fiddleyuan commented Jun 19, 2018

I noticed that in above Android build rdm log, there are libcxx errors. But I didn't add libcxx support in my Android.mk file. So this must be inherited from Android base build system.

I manually deleted libcxx lines from my compile_commands.json file, and rc -J again. This time I got the following, note there's "handleInclude failed" print.

CI::parse loading unit: clang "-c" "-fno-exceptions" "-Wno-multichar" "-fno-strict-aliasing" "-fstack-protector-strong" "-ffunction-sections" "-fdata-sections" "-funwind-tables" "-Wa,--noexecstack" "-Werror=format-security" "-fno-short-enums" "-no-canonical-prefixes" "-Werror=pointer-to-int-cast" "-Werror=int-to-pointer-cast" "-Werror=implicit-function-declaration" "-O2" "-g" "-Wstrict-aliasing=2" "-fmessage-length=0" "-W" "-Wall" "-Wno-unused" "-Winit-self" "-Wpointer-arith" "-UDEBUG" "-fdebug-prefix-map=/proc/self/cwd=" "-Werror=int-conversion" "-Wno-reserved-id-macro" "-Wno-format-pedantic" "-Wno-unused-command-line-argument" "-fcolor-diagnostics" "-Wno-expansion-to-defined" "-fdebug-prefix-map=/home/shuaiy/proj/Android/=" "-Werror=return-type" "-Werror=non-virtual-dtor" "-Werror=address" "-Werror=sequence-point" "-Werror=date-time" "-nostdlibinc" "-target" "aarch64-linux-android" "-Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin" "-Wsign-promo" "-Wno-inconsistent-missing-override" "-Wno-null-dereference" "-fvisibility-inlines-hidden" "-std=gnu++14" "-fno-rtti" "-Wall" "-Wno-unused-parameter" "-Wextra" "-fpie" "-Werror=int-to-pointer-cast" "-Werror=pointer-to-int-cast" "-Werror=address-of-temporary" "-Werror=return-type" "-mno-ae" "-Wno-vectorizer-no-neon" "-ferror-limit=50" "-Wall" "-fspell-checking" "-Wno-unknown-warning-option" "-DRTAGS=" "-D_FORTIFY_SOURCE=2" "-D__compiler_offsetof=__builtin_offsetof" "-DANDROID" "-DANDROID_STRICT" "-DNDEBUG" "-I/home/shuaiy/proj/Android/vendor/test_rtags/inc" "-I/home/shuaiy/proj/Android/vendor/test_rtags" "-I/home/shuaiy/proj/Android/out/target/product/sdm845/obj/EXECUTABLES/TestRTags_intermediates" "-Iout/target/product/sdm845/gen/EXECUTABLES/TestRTags_intermediates" "-I/home/shuaiy/proj/Android/libnativehelper/include/nativehelper" "-I/home/shuaiy/proj/Android/system/core/include" "-I/home/shuaiy/proj/Android/system/media/audio/include" "-I/home/shuaiy/proj/Android/hardware/libhardware/include" "-I/home/shuaiy/proj/Android/hardware/libhardware_legacy/include" "-I/home/shuaiy/proj/Android/hardware/ril/include" "-I/home/shuaiy/proj/Android/libnativehelper/include" "-I/home/shuaiy/proj/Android/frameworks/native/include" "-I/home/shuaiy/proj/Android/frameworks/native/opengl/include" "-isystem" "/home/shuaiy/proj/Android/frameworks/av/include" "-isystem" "/home/shuaiy/proj/Android/out/target/product/sdm845/obj/include" "-isystem" "/home/shuaiy/proj/Android/bionic/libc/arch-arm64/include" "-isystem" "/home/shuaiy/proj/Android/bionic/libc/include" "-isystem" "/home/shuaiy/proj/Android/bionic/libc/kernel/uapi" "-isystem" "/home/shuaiy/proj/Android/bionic/libc/kernel/uapi/asm-arm64" "-isystem" "/home/shuaiy/proj/Android/bionic/libc/kernel/android/uapi" "-isystem" "/usr/lib/llvm-3.4/lib/clang/3.4/include/" /home/shuaiy/proj/Android/vendor/test_rtags/src/test.cpp true
handleInclude failed (nil) inclusion directive include iostream /home/shuaiy/proj/Android/vendor/test_rtags/inc/test.h:1:1

Is this a bug or I did something wrong? When I delete libcxx from compile_commands.json, I still cannot find reference for enum class member, NOR typedef'ed enum member which used to work. I suspect this is due to that "handleInclude failed" error.

@Andersbakken
Copy link
Owner

Sorry about the long delay. I honestly can't really see what might be causing this. There are some terrible hacks around the whole:

Can't decide which of these symbols are right for me

But I can't really see what Android would do to impact that.

I suspect that -nostdlibinc is causing a problem. I think your best bet is to try to bisect between all of the many additional command line options until it starts working.

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

2 participants