我正在尝试构建 USB 转 HDMI 适配器的驱动程序...
Bus 001 Device 010: ID 534d:6021 MacroSilicon VGA Display Adapter
笔记:“lsusb”输出。
...但是这个错误正在发生...
Fatal error: Invalid --compress-debug-sections option: `zstd'
...如下面的完整输出所示...
[eduardolac@eduardolac-pc ms912x]$ make all -j
make CHECK="/usr/bin/sparse" -C /lib/modules/6.5.5-1-MANJARO/build M=/home/eduardolac/Data1/Temp/20231016.1224.0/ms912x modules
make[1]: Entering directory '/usr/lib/modules/6.5.5-1-MANJARO/build'
CC [M] /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_registers.o
CC [M] /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_connector.o
CC [M] /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_transfer.o
CC [M] /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_drv.o
Assembler messages:
Fatal error: Invalid --compress-debug-sections option: `zstd'
make[3]: *** [scripts/Makefile.build:243: /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_connector.o] Error 1
make[3]: *** Waiting for unfinished jobs....
Assembler messages:
Fatal error: Invalid --compress-debug-sections option: `zstd'
make[3]: *** [scripts/Makefile.build:243: /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_registers.o] Error 1
Assembler messages:
Fatal error: Invalid --compress-debug-sections option: `zstd'
make[3]: *** [scripts/Makefile.build:243: /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_transfer.o] Error 1
Assembler messages:
Fatal error: Invalid --compress-debug-sections option: `zstd'
make[3]: *** [scripts/Makefile.build:243: /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x/ms912x_drv.o] Error 1
make[2]: *** [/usr/lib/modules/6.5.5-1-MANJARO/build/Makefile:2034: /home/eduardolac/Data1/Temp/20231016.1224.0/ms912x] Error 2
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.5.5-1-MANJARO/build'
make: *** [Makefile:15: modules] Error 2
我的系统上可用的“ld”不支持“compress-debug-sections”参数的“zstd”选项...
[eduardolac@eduardolac-pc ms912x]$ ld --help | grep "compress-debug-sections"
--compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi]
...但是我在操作系统上安装的“binutils”包(包含“ld”)是版本2.41-3,根据本文档(https://sourceware.org/binutils/docs/binutils.html)已经支持“compress-debug-sections”参数的“zstd”选项。
我安装的内核是 6.5.X 。
请在这件事上给予我帮助。
答案1
出现问题是因为我的例子中使用的“ld”二进制文件出于某种原因是由“Homebrew”提供的......
[eduardolac@eduardolac-pc ms912x]$ pacman -Qo ld
error: No package owns /home/linuxbrew/.linuxbrew/bin/ld
所以对我来说,解决方案是删除“Homebrew”,因为我没有将它用于任何用途......
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
作为预防措施,我重新安装了 binutils...
yay -Rdd binutils
yay -S binutils
最后,只需打开并关闭终端即可...
[eduardolac@eduardolac-pc ~]$ ld --version
GNU ld (GNU Binutils) 2.41.0
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
谢谢!