• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Anyone study Trout(Cuttlefish for AAOS),help me with Kernel build

FranzKafkaYs

Lurker
Sep 28, 2022
1
0
Recently I need to compile a special Android Kernel version,whicH includes a special driver named as Virtio-Video。 It's part of Virtio Standards and can be used for Virtualization.In android,it will be part of Cuttlefish/Trout.View repo details please check this link:https://android.googlesource.com/kernel/manifest/+/refs/heads/trout-android12-5.10;view the instructions please check this:https://source.android.com/docs/setup/build/building-kernels

And I have followed the offical instructions:

repo init -u https://android.googlesource.com/kernel/manifest -b trout-android12-5.10

because I need the Virtio-Video driver,so I used the command below to build:

BUILD_CONFIG=common-modules/virtual-device/build.config.virtual_device.x86_64 build/build.sh

But I get some errors like these:


opt/FranzKafkaYu/Android_Trout_Kernel/common/../common-modules/virtual-device/arm_scmi/smc.c:152:2: error: unknown register name 'r1' in asm
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:420:4: note: expanded from macro 'arm_smccc_1_1_invoke'
arm_smccc_1_1_smc(__VA_ARGS__); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:367:32: note: expanded from macro 'arm_smccc_1_1_smc'
#define arm_smccc_1_1_smc(...) __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:342:33: note: expanded from macro '__arm_smccc_1_1'
register unsigned long r1 asm("r1"); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/../common-modules/virtual-device/arm_scmi/smc.c:152:2: error: unknown register name 'r2' in asm
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:420:4: note: expanded from macro 'arm_smccc_1_1_invoke'
arm_smccc_1_1_smc(__VA_ARGS__); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:367:32: note: expanded from macro 'arm_smccc_1_1_smc'
#define arm_smccc_1_1_smc(...) __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:343:33: note: expanded from macro '__arm_smccc_1_1'
register unsigned long r2 asm("r2"); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/../common-modules/virtual-device/arm_scmi/smc.c:152:2: error: unknown register name 'r3' in asm
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:420:4: note: expanded from macro 'arm_smccc_1_1_invoke'
arm_smccc_1_1_smc(__VA_ARGS__); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:367:32: note: expanded from macro 'arm_smccc_1_1_smc'
#define arm_smccc_1_1_smc(...) __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:344:33: note: expanded from macro '__arm_smccc_1_1'
register unsigned long r3 asm("r3"); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/../common-modules/virtual-device/arm_scmi/smc.c:152:2: error: unknown register name 'r0' in asm
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:420:4: note: expanded from macro 'arm_smccc_1_1_invoke'
arm_smccc_1_1_smc(__VA_ARGS__); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:367:32: note: expanded from macro 'arm_smccc_1_1_smc'
#define arm_smccc_1_1_smc(...) __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:345:3: note: expanded from macro '__arm_smccc_1_1'
__declare_args(__count_args(__VA_ARGS__), __VA_ARGS__); \
^
note: (skipping 5 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:313:2: note: expanded from macro '__declare_arg_5'
__declare_arg_4(a0, a1, a2, a3, a4, res); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:308:2: note: expanded from macro '__declare_arg_4'
__declare_arg_3(a0, a1, a2, a3, res); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:301:34: note: expanded from macro '__declare_arg_3'
register unsigned long arg0 asm("r0") = (u32)a0; \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/../common-modules/virtual-device/arm_scmi/smc.c:152:2: error: unknown register name 'r1' in asm
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:420:4: note: expanded from macro 'arm_smccc_1_1_invoke'
arm_smccc_1_1_smc(__VA_ARGS__); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:367:32: note: expanded from macro 'arm_smccc_1_1_smc'
#define arm_smccc_1_1_smc(...) __arm_smccc_1_1(SMCCC_SMC_INST, __VA_ARGS__)
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:345:3: note: expanded from macro '__arm_smccc_1_1'
__declare_args(__count_args(__VA_ARGS__), __VA_ARGS__); \
^
note: (skipping 5 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:313:2: note: expanded from macro '__declare_arg_5'
__declare_arg_4(a0, a1, a2, a3, a4, res); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:308:2: note: expanded from macro '__declare_arg_4'
__declare_arg_3(a0, a1, a2, a3, res); \
^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/include/linux/arm-smccc.h:302:31: note: expanded from macro '__declare_arg_3'
register typeof(a1) arg1 asm("r1") = __a1; \
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[4]: *** [/opt/FranzKafkaYu/Android_Trout_Kernel/common/scripts/Makefile.build:273: ../common-modules/virtual-device/arm_scmi/smc.o] Error 1
/opt/FranzKafkaYu/Android_Trout_Kernel/common/../common-modules/virtual-device/virtio_video/virtio_video_driver.c:118:12: error: no member named 'dma_ops' in 'struct device'
if (!dev->dma_ops)
~~~ ^
/opt/FranzKafkaYu/Android_Trout_Kernel/common/../common-modules/virtual-device/virtio_video/virtio_video_driver.c:119:26: error: no member named 'dma_ops' in 'struct device'
set_dma_ops(dev, pdev->dma_ops);
~~~~ ^
2 errors generated.
make[4]: *** [/opt/FranzKafkaYu/Android_Trout_Kernel/common/scripts/Makefile.build:273: ../common-modules/virtual-device/virtio_video/virtio_video_driver.o] Error 1
make[4]: *** Waiting for unfinished jobs....
/opt/FranzKafkaYu/Android_Trout_Kernel/common/../common-modules/virtual-device/virtio_video/virtio_video_vq.c:362:6: warning: unused variable 'ret' [-Wunused-variable]
int ret;
^
LD [M] ../common-modules/virtual-device/virtio_snd/virtio_snd.o
LD [M] ../common-modules/virtual-device/goldfish_drivers/goldfish_pipe.o
LD [M] ../common-modules/virtual-device/wlan_simulation/virt_wifi_sim.o
1 warning generated.
make[3]: *** [/opt/FranzKafkaYu/Android_Trout_Kernel/common/scripts/Makefile.build:516: ../common-modules/virtual-device/virtio_video] Error 2
make[3]: *** Waiting for unfinished jobs....
LD [M] ../common-modules/virtual-device/virtio_gpu/virtio-gpu.o
make[3]: *** [/opt/FranzKafkaYu/Android_Trout_Kernel/common/scripts/Makefile.build:516: ../common-modules/virtual-device/arm_scmi] Error 2
make[2]: *** [/opt/FranzKafkaYu/Android_Trout_Kernel/common/Makefile:1909: ../common-modules/virtual-device] Error 2
make[2]: Leaving directory '/opt/FranzKafkaYu/Android_Trout_Kernel/out/android12-5.10/common'
make[1]: *** [Makefile:185: __sub-make] Error 2
make[1]: Leaving directory '/opt/FranzKafkaYu/Android_Trout_Kernel/common'
make: *** [Makefile:2: all] Error 2
make: Leaving directory '/opt/FranzKafkaYu/Android_Trout_Kernel/common-modules/virtual-device'


And when I check the commit log,I found another command:

BUILD_CONFIG=common-modules/virtual-device/build.config.trout.coqos build/build.sh

this command excuted OK and I got the output virtio-vedio.ko but it's ARM arch.But I need x86 arch.Can someone tell me how can I fix the compile errors?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones