Skip to content

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

Open

Description

@shizhx

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?

Activity

  1. shizhx commented on Sep 19, 2016

    @shizhx
    Author

    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……

  2. ogoffart commented on Sep 28, 2016

    @ogoffart
    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.

  3. guruz commented on Jun 14, 2019

    @guruz
    Contributor

    @shizhx Any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions