简体   繁体   English

尝试安装 gcc-4.8.1 时以“错误 2”退出

[英]Make exits with "Error 2" when trying to install gcc-4.8.1

I'm trying to install gcc-4.8.1 on an AWS ec2 "Other Linux" distribution.我正在尝试在 AWS ec2“其他 Linux”发行版上安装 gcc-4.8.1。 I downloaded gcc-4.6.2.tar.gz and then followed these instructions under the 'Configuration' heading from http://gcc.gnu.org/wiki/InstallingGCC (modified for 4.8.1 instead of 4.6.2):我下载了 gcc-4.6.2.tar.gz,然后按照来自http://gcc.gnu.org/wiki/InstallingGCC的“配置”标题下的这些说明进行操作(针对 4.8.1 而不是 4.6.2 进行了修改):

tar xzf gcc-4.8.1.tar.gz
cd gcc-4.8.1
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.1/configure --prefix=$HOME/gcc-4.8.1 
make
make install

When I run 'make', the program runs for some time but eventually exits with this error:当我运行“make”时,程序运行了一段时间但最终退出并出现此错误:

build/genattrtab /home/ec2-user/gcc-4.8.1_install/objdir/../gcc-4.8.1/gcc/config/i386/i386.md insn-conditions.md \
                -Atmp-attrtab.c -Dtmp-dfatab.c -Ltmp-latencytab.c
make[3]: *** [s-attrtab] Killed
make[3]: Leaving directory `/home/ec2-user/gcc-4.8.1_install/objdir/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/ec2-user/gcc-4.8.1_install/objdir'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/ec2-user/gcc-4.8.1_install/objdir'
make: *** [all] Error 2

Can anyone shed any insight into why this might be happening?任何人都可以深入了解为什么会发生这种情况吗? I don't understand the error message at all.我根本不明白错误信息。 I'm building it with gcc4.6.1 and /home/ec2-user/gcc-4.8.1_install is the directory I ran the commands from within.我正在使用 gcc4.6.1 构建它,/home/ec2-user/gcc-4.8.1_install 是我从内部运行命令的目录。

I was doing a few things wrong. 我做错了一些事。 First, I didn't have the latest binutils installed. 首先,我没有安装最新的binutils。

This particular error, however, was the OOM killer at work. 然而,这个特殊的错误是工作中的OOM杀手。 The peak RAM used during installation is greater than that of EC2 micro instance. 安装期间使用的峰值RAM大于EC2微实例的峰值RAM。 Use a larger instance or use swap: 使用更大的实例或使用swap:

SWAP=/tmp/swap
dd if=/dev/zero of=$SWAP bs=1M count=500
mkswap $SWAP
sudo swapon $SWAP

This will swap in 500 MB, which was ample for my installation. 这将交换500 MB,这对我的安装来说足够了。

Maybe you forgot to install gcc-c++, Try with the command yum -y install gcc-c++也许你忘记安装 gcc-c++,尝试使用命令yum -y install gcc-c++

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试从 github 安装模块时 Go 安装命令显示 404 错误 - Go install command show 404 error when trying to install module from github 尝试向 Cloud Run 容器发出 HTTP 请求时出现 404 错误 - 404 error when trying to make HTTP request to Cloud Run Container 尝试使用 gcc 编译 nasm object 代码时出错 - Error while trying to compile nasm object code with gcc 尝试在 VertexAI 管道中使用 CustomPythonPackageTrainingJobRunOp 时出错 - Error when trying to use CustomPythonPackageTrainingJobRunOp in VertexAI pipeline 尝试使用 REST API 公开对象时出现“访问被拒绝。提供的范围未被授权”错误 - "Access Denied. Provided scope(s) are not authorized" error when trying to make objects public using the REST API 安装 gcloud 时如何解决“CERTIFICATE_VERIFY_FAILED”错误? - How to solve `CERTIFICATE_VERIFY_FAILED` error when install gcloud? 尝试创建子用户时 sendgrid 错误“403 访问被禁止” - sendgrid error "403 access forbidden" when trying to create sub user 当我尝试在 firebase 存储上导入文件时出现错误 - im getting error when im trying to import file on firebase storage 错误:尝试将数据发布到 Firebase 服务器时出现 MISSING_EMAIL - Error : MISSING_EMAIL when trying to post data to a Firebase Server 尝试将 Oracle 复制到 PostgreSQL 时出现 AWS DMS 错误 - AWS DMS Error when trying to replicate Oracle to PostgreSQL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM