macos - MacOS 10.15.6 gcc 上的 Buildroot 2021.08.x 未安装错误
问题描述
尝试在 MacOS 10.15.6 上使用 Buildroot 2021.08.x 构建一个非常简单的测试映像,并收到未安装 gcc 的错误:
z:buildroot User$ make
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
LLVM ERROR: IO failure on output stream: Broken pipe
/bin/sh: line 0: [: : integer expression expected
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
You must install 'gcc' on your build machine
make: *** [dependencies] Error 1
我用brew安装并重新安装了gcc。用 brew 安装的版本是 11.2.0
z:~ User$ brew list --versions gcc
gcc 11.2.0
但 gcc --version 输出如下所示:
z:~ User $ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
有任何想法吗?
解决方案
您不应该将 clang 用于 buildroot 编译器。
您必须将 gcc 命令链接到 homebrew 安装的位置。
推荐阅读
- pandas - 在熊猫中使用句点进行差异时如何避免null?
- php - 从两个日期之间的数据库差异中检索间隔数据
- javascript - 语音合成在浏览器启动后首次加载时不会在谷歌浏览器中暂停
- c++ - C++17:显式转换函数 vs 显式构造函数 + 隐式转换——规则改变了吗?
- sql-server - 为什么从 sqlserver 中删除记录时 Elasticsearch 没有更新
- c# - 使用依赖注入时如何将通用接口解析为通用实现?
- java - Java 8 列表
到地图 >> - google-chrome - 如何解决现代浏览器的缓存问题?
- javascript - jQuery.scrollSpeed 脚本根本不允许我滚动
- web-services - Apache CXF WebServices 的 Websphere 安全配置