我有一个Raspberry Pi 4,我需要创建一个基于Openwrt的系统的映像,并支持AWUS036ACH。我已经完成以下步骤:
define Build/Compile
@echo "-----------------"
@echo "CC=$(TARGET_CC)"
@echo "-----------------"
$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
CC="$(TARGET_CC)" \
KERNEL_SOURCE="$(LINUX_DIR)" \
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
M="$(PKG_BUILD_DIR)"
endef
modules:
$(MAKE) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL_SOURCE) M=$(M) LDFLAGS="$(TARGET_LDFLAGS)" CFLAGS="$(TARGET_CFLAGS)" modules
@echo "---------------------------------------------------------------------------"
@echo "Visit https://github.com/aircrack-ng/rtl8812au for support/reporting issues"
@echo "or check for newer versions (branches) of these drivers. "
@echo "---------------------------------------------------------------------------"
但是,当我开始构建系统时,出现错误:
make -j1 -C "/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0" CC="aarch64-openwrt-linux-musl-gcc" KERNEL_SOURCE="/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.4.31" TARGET_CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0=Alfa-WiFi-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" TARGET_LDFLAGS="-L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/lib -znow -zrelro" M="/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0"
make[4]: Entering directory '/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0'
make ARCH=arm64 CC=aarch64-openwrt-linux-musl-gcc CROSS_COMPILE= -C /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.4.31 M=/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0 LDFLAGS="-L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/lib -znow -zrelro" CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0=Alfa-WiFi-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" modules
make[5]: Entering directory '/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.4.31'
arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
CC [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/core/rtw_cmd.o
CC [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/core/rtw_security.o
....
....
CC [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/core/rtw_mp.o
LD [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/88XXau.o
ld: unrecognised emulation mode: aarch64linux
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om i386pep i386pe
scripts/Makefile.build:437: recipe for target '/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/88XXau.o' failed
请帮助我!
似乎您正在使用主机工具链(至少是ld)。您的CROSS_COMPILE选项为空。