在 OpenBSD 上 pkg_add gcc 之后没有 gcc 可执行文件

she*_*dog 5 gcc openbsd

我在 OpenBSD 6.5 上从软件包安装了 gcc

# pkg_add gcc-8.3.0

gcc 相关文件安装在/usr/local/lib/,但未找到 gcc 可执行文件。

# gcc -bash: gcc: command not found

(我知道 Clang 在 OpenBSD 上常用,但我想在项目中使用 gcc)

Kus*_*nda 10

egcc当从包中安装GNU C 编译器可执行文件时,会调用它gcc。(基本系统的,至少在 amd64 上)还应该有一个gcc可执行文件。/usr/bingcc

$ type egcc gcc
egcc is /usr/local/bin/egcc
gcc is /usr/bin/gcc
Run Code Online (Sandbox Code Playgroud)
$ gcc --version
gcc (GCC) 4.2.1 20070719
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ egcc --version
egcc (GCC) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Run Code Online (Sandbox Code Playgroud)

请注意,它gcc已于 2021 年底从 amd64 上的 OpenBSD 基本系统(OpenBSD 7.0)中删除。

  • @sheepdog 哎哟。我可能会从“bsd.rd”内核启动,并仅使用编译器集进行系统更新。不要从系统中删除随机文件。此外,除了修改的配置文件之外,“pkg_delete”工具永远不会留下文件。 (3认同)