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

Error: The file was not recognized as source code #47

Open
shizhx opened this issue Sep 19, 2016 · 3 comments
Open

Error: The file was not recognized as source code #47

shizhx opened this issue Sep 19, 2016 · 3 comments
Assignees

Comments

@shizhx
Copy link

shizhx commented Sep 19, 2016

Android NDK project: https://github.com/googlesamples/android-ndk/tree/66d64b4710291f289c05c52abdb0e2650af0f6f2/hello-jni
execute bear ndk-build to generate compile_commands.json, here is it's content:

[
    {
        "command": "cc -c -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -O0 -UNDEBUG -marm -fno-omit-frame-pointer -I/home/hsz/labs/test/cmake_android/hello-jni/jni -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security -I/home/hsz/App/android-ndk-r10e/platforms/android-3/arch-arm/usr/include -o /home/hsz/labs/test/cmake_android/hello-jni/obj/local/armeabi/objs-debug/hello-jni/hello-jni.o /home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c", 
        "directory": "/home/hsz/labs/test/cmake_android/hello-jni/jni", 
        "file": "/home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c"
    }
]

then I execute these commands:

OUTPUTDIRECTORY=~/public_html/hello-jni
DATADIRECTORY=$OUTPUTDIRECTORY/../data
BUILDIRECTORY=~/labs/test/cmake_android/hello-jni/jni
VERSION=test
./generator/codebrowser_generator -b $BUILDIRECTORY -a -o $OUTPUTDIRECTORY -p codebrowser:$BUILDIRECTORY:$VERSION

and get this error:

Error: The file was not recognized as source code: /home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c

what can I do to resolve this error?

@shizhx
Copy link
Author

shizhx commented Sep 19, 2016

I tried to edit the compile_commands.json and remove some compile options, content become:

[
    {
        "command": "cc -c -fpic -I/home/hsz/labs/test/cmake_android/hello-jni/jni -DANDROID -I/home/hsz/App/android-ndk-r10e/platforms/android-3/arch-arm/usr/include -o /home/hsz/labs/test/cmake_android/hello-jni/obj/local/armeabi/objs-debug/hello-jni/hello-jni.o /home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c", 
        "directory": "/home/hsz/labs/test/cmake_android/hello-jni/jni", 
        "file": "/home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c"
    }
]

and that error disappeared……

ogoffart added a commit that referenced this issue Sep 19, 2016
So driver errors are not ignored and we can more easily debug why a file
does not get parsed.

Will help for github issue #47
@ogoffart
Copy link
Contributor

The problem seems to be the -march=armv5te which is not supported by clang, and then it bails out.
I don't really know how to fix this problem. I can't simply filter out the -march because it might impact some ifdef for supported arch.

@guruz
Copy link
Contributor

guruz commented Jun 14, 2019

@shizhx Any news?

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

3 participants