cc:致命错误:-fuse-linker-plugin,但未找到 liblto_plugin.so

cc:致命错误:-fuse-linker-plugin,但未找到 liblto_plugin.so

大家好,2023 年新年快乐。

这个问题以与 FreeBSD 世界严格相关的问题开始,但以与 Linux 世界严格相关的问题结束。您将会看到,所以当您开始阅读时不要开始担心这不是 Linux 问题 :P

昨天我在 FreeBSD 论坛上发布了这个问题:

如何使用 FreeBSD linuxulator 安装 AUTOMATIC1111 webui 以便在我的 /compat/ubuntu 发行版中稳定传播。

您可以在此处阅读全文:

https://forums.freebsd.org/threads/can-the-nv-sglrun-wrapper-launch-the-python3-script-needed-to-allow-torch-to-detect-my-gpu.87610/#post-593445

幸运的是,有人找到了解决方案并编写了一个很好的教程,您可以在这里阅读:

https://github.com/verm/freebsd-stable-diffusion

好吧。我开始按照他的教程操作,但在某个时候,我在 Linux 环境中使用 cc 时遇到了问题。我试图修复它,但暂时没有成功。您可以在下面阅读我所做的完整日志:

mario-freebsd@marietto:/home/marietto/Desktop/Files/Scripts/BSD # /compat/ubuntu/bin/cc --sysroot=/compat/ubuntu -m64 -std=c99 -Wall -ldl -fPIC -shared -o dummy-uvm.so uvm_ioctl_override.c
cc: error trying to exec 'cc1': execvp: No such file or directory

mario-freebsd@marietto:/home/marietto/Desktop/Files/Scripts/BSD # chroot /compat/ubuntu /bin/bash

mario-linuxulator@marietto:/# dpkg -l | grep gcc | awk '{print $2}'

gcc
gcc-10
gcc-10-base:amd64
gcc-8
gcc-8-base:amd64
gcc-9
gcc-9-base:amd64
libgcc-10-dev:amd64
libgcc-8-dev:amd64
libgcc-9-dev:amd64
libgcc-s1:amd64

mario-linuxlator@marietto:/# which gcc
/usr/bin/gcc

mario-linuxlator@marietto:/# which cc1
nothing

mario-linuxlator@marietto:/# apt-get install build-essential

Reading package lists... Done
Building dependency tree 
Reading state information... Done
build-essential is already the newest version (12.8ubuntu1).

mario-linuxlator@marietto:/# whereis cc1
cc1:

mario-freebsd@marietto:/home/marietto/Desktop/Files/Scripts/BSD # find /compat/ubuntu -name cc1

/compat/ubuntu/usr/lib/gcc/x86_64-linux-gnu/9/cc1
/compat/ubuntu/usr/lib/gcc/x86_64-linux-gnu/10/cc1

mario-freebsd@marietto:/home/marietto/Desktop/Files/Scripts/BSD # cp /compat/ubuntu/usr/lib/gcc/x86_64-linux-gnu/10/cc1 /compat/ubuntu/bin

mario-freebsd@marietto:/home/marietto/Desktop/Files/Scripts/BSD # /compat/ubuntu/bin/cc --sysroot=/compat/ubuntu -m64 -std=c99 -Wall -ldl -fPIC -shared -o dummy-uvm.so uvm_ioctl_override.c

In file included from /compat/ubuntu/usr/include/dlfcn.h:22,
from uvm_ioctl_override.c:3:
/compat/ubuntu/usr/include/features.h:461:12: fatal error: sys/cdefs.h: No such file or directory
461 | # include <sys/cdefs.h>
| ^~~~~~~~~~~~~
compilation terminated.

mario-freebsd@marietto:/home/marietto/Desktop/Files/Scripts/BSD # chroot /compat/ubuntu /bin/bash          
mario-linuxlator@marietto:/# apt-get install g++-multilib
....
OK

mario-linuxlator@marietto:/# exit
exit

mario-freebsd@marietto:/home/marietto/Desktop/Files/Scripts/BSD # /compat/ubuntu/bin/cc --sysroot=/compat/ubuntu -m64 -std=c99 -Wall -ldl -fPIC -shared -o dummy-uvm.so uvm_ioctl_override.c

cc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found,compilation terminated.

您是否发现我发出的命令之间存在错误?您知道如何修复错误吗?谢谢。

相关内容