0

最近、xiaomi mi4c 用に Android カーネルをクロスコンパイルしようとしました。これを行うために、次のようなツールチェーンをダウンロードして構成しました。

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

次に、エラーがあります:

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.

それで、問題は、私が間違っていることは何ですか?クロスコンパイル用に別のツールチェーンが必要なのかもしれません。誰かが提案できますか?カーネルコードにエラーがあるとは思いません。では、何がうまくいかないのでしょうか?

4

1 に答える 1

1

それで、数日後、私は答えを見つけました。4pda の kay2777 に感謝します。

メインの Makefile で KBUILD_CFLAGS を探し、次を追加して警告をエラーとして抑制します。

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.
于 2017-01-01T23:48:14.567 に答える