2016-12-29 7 views
0

최근에 저는 xiaomi mi4c에 대한 Android 커널을 크로스 컴파일하려고했습니다. 여기에서android 3.10 커널 소스를 컴파일하는 중 오류가 발생했습니다.

git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 -b marshmallow-release toolchain64 
export ARCH=arm64 
export SUBARCH=arm64 
export CROSS_COMPILE=`pwd`/toolchain64/bin/aarch64-linux-android- 

그때 복제 커널 소스 : 내가 다운로드와 같은 툴체인을 구성한이 작업을 수행하는 https://github.com/AndropaX/android_kernel_xiaomi_msm8992

이 작업을 수행합니다

다음
make clean && make mrproper 
make ARCH=arm64 resurrection_libra_defconfig 
make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE -j3 

I 오류가 있습니다 :

In file included from include/linux/kernel.h:14:0, 
       from include/linux/sched.h:15, 
       from /home/owner/android_kernel_xiaomi_msm8992/arch/arm64/include/asm/compat.h:25, 
       from /home/owner/android_kernel_xiaomi_msm8992/arch/arm64/include/asm/stat.h:23, 
       from include/linux/stat.h:5, 
       from include/linux/module.h:10, 
       from drivers/tspdrv/tspdrv.c:26: 
drivers/tspdrv/ImmVibeSPI_ISA1000.c: In function 'ImmVibeSPI_ForceOut_SetSamples': 
include/linux/dynamic_debug.h:64:16: error: implicit declaration of function 'KBUILD_STR' [-Werror=implicit-function-declaration] 
    static struct _ddebug __aligned(8) \ 
       ^
include/linux/dynamic_debug.h:76:2: note: in expansion of macro 'DEFINE_DYNAMIC_DEBUG_METADATA' 
    DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 
^
include/linux/printk.h:240:2: note: in expansion of macro 'dynamic_pr_debug' 
    dynamic_pr_debug(fmt, ##__VA_ARGS__) 
^
drivers/tspdrv/ImmVibeSPI_ISA1000.c:573:2: note: in expansion of macro 'pr_debug' 
    pr_debug("%s: level = %d\n", __func__, level); 
^
<command-line>:0:27: error: 'tspdrv' undeclared (first use in this function) 
include/linux/dynamic_debug.h:66:14: note: in expansion of macro 'KBUILD_MODNAME' 
    .modname = KBUILD_MODNAME, \ 
      ^
include/linux/dynamic_debug.h:76:2: note: in expansion of macro 'DEFINE_DYNAMIC_DEBUG_METADATA' 
    DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 
^
include/linux/printk.h:240:2: note: in expansion of macro 'dynamic_pr_debug' 
    dynamic_pr_debug(fmt, ##__VA_ARGS__) 
^
drivers/tspdrv/ImmVibeSPI_ISA1000.c:573:2: note: in expansion of macro 'pr_debug' 
    pr_debug("%s: level = %d\n", __func__, level); 
^
<command-line>:0:27: note: each undeclared identifier is reported only once for each function it appears in 
include/linux/dynamic_debug.h:66:14: note: in expansion of macro 'KBUILD_MODNAME' 
    .modname = KBUILD_MODNAME, \ 
      ^
include/linux/dynamic_debug.h:76:2: note: in expansion of macro 'DEFINE_DYNAMIC_DEBUG_METADATA' 
    DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 
^
include/linux/printk.h:240:2: note: in expansion of macro 'dynamic_pr_debug' 
    dynamic_pr_debug(fmt, ##__VA_ARGS__) 
^
drivers/tspdrv/ImmVibeSPI_ISA1000.c:573:2: note: in expansion of macro 'pr_debug' 
    pr_debug("%s: level = %d\n", __func__, level); 
^
drivers/tspdrv/tspdrv.c: At top level: 
drivers/tspdrv/tspdrv.c:94:37: fatal error: tspdrvOutputDataHandler.c: No such file or directory 
#include <tspdrvOutputDataHandler.c> 
            ^
cc1: some warnings being treated as errors 
compilation terminated. 

그래서, 나는 무엇을하고 있는가? 잘못된? 크로스 컴파일 할 때 다른 툴체인이 필요할 수 있습니까? 누군가가 제안 할 수 있습니까? 나는 커널 코드에 오류가 있다고 생각하지 않는다. 그래서 무엇이 잘못 될 수 있습니까?

+0

그것은 차이가 나지 않을 수 있습니다,하지만 쉘 입력은 틀에 얽매이지입니다 :

주요 메이크 KBUILD_CFLAGS에 대한보고,이 오류로 경고를 억제하려면 다음을 추가합니다. (1) ARCH 및 CROSS_COMPILE 환경 변수를 내 보낸 이후로 ** make ** 명령에서 다시 지정할 필요가 없습니다. (2) CROSS_COMPILE은 전체 경로가 아닌 단지 명령 접두어로 사용됩니다. toolchain을 포함하도록 env 변수 PATH를 수정하십시오. (3)'make mrproper'는 이전의'make clean '을 불필요하게 만든다. (4)'-j3' 옵션없이 빌드를 시도하십시오. IIRC에서는 병렬 작업에 간혹 문제가있었습니다. – sawdust

+0

동일한 문제가있는 것 같습니다 : https://github.com/MiCode/Xiaomi_Kernel_OpenSource/issues/14 – sawdust

답변

0

그래서 며칠 후 나는 대답을 찾았습니다. 4pda에서 kay2777에게 감사드립니다.

KBUILD_CFLAGS += -w 
// if all errors are to be suppressed 

KBUILD_CFLAGS += -Wno-error=unused-but-set-variable 
// if that specific error is to be suppressed.