kendryte / k230_linux_sdk

K230 Linux SDK
BSD 2-Clause "Simplified" License
19 stars 10 forks source link

[Bug]: make CONF=BPI-CanMV-K230D-Zero_ilp32_defconfig does not work #8

Open OctopusET opened 5 days ago

OctopusET commented 5 days ago

What happened

When I try build with make CONF=BPI-CanMV-K230D-Zero_ilp32_defconfig It fails with

/home/user/k230_linux_sdk/output/BPI-CanMV-K230D-Zero_ilp32_defconfig/host/bin/riscv64-unknown-linux-gnu-gcc -c -mcpu=c908v -O2 alsa_rec_wav.c -o alsa_rec_wav.o 
cc1: error: ABI requires '-march=rv32'
cc1: error: ABI requires '-march=rv32'
cc1: error: ABI requires '-march=rv32'
cc1: error: ABI requires '-march=rv32'
make[3]: *** [Makefile:34: alsa_rec_wav.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:34: alsa_play_mp3.o] Error 1
make[3]: *** [Makefile:34: main.o] Error 1
make[3]: *** [Makefile:34: alsa_play_wav.o] Error 1
make[2]: *** [package/pkg-generic.mk:283: /home/user/k230_linux_sdk/output/BPI-CanMV-K230D-Zero_ilp32_defconfig/build/audio_demo/.stamp_built] Error 2
make[1]: *** [Makefile:23: _all] Error 2
make[1]: Leaving directory '/home/user/k230_linux_sdk/output/BPI-CanMV-K230D-Zero_ilp32_defconfig'
make: *** [Makefile:22: buildroot] Error 2

Reproduction steps

Run

make CONF=BPI-CanMV-K230D-Zero_ilp32_defconfig

Hardware board

BPI-CanMV-K230D-Zero

Software version

f9eeee2c1603144190cec242be7679e4c30663f9

Bug frequency

everytime

Anything else

No response

gh-sxp commented 2 days ago

修改audio_demo目录下的Makefile中的CFLAGS和LDFLAGS,改成如下即可 ifeq ($(BR2_RISCV_32), y) CFLAGS += -march=rv32gcv_xtheadc LDFLAGS += -march=rv32gcv_xtheadc else CFLAGS += -mcpu=c908v -O2 LDFLAGS += -mcpu=c908v -O2 endif

OctopusET commented 1 day ago

ifeq doesn't work, I had to manually change the CFLAG