首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >RPM生成错误: /var/tmp/rpm-tmp.xgXjYS (% build )中的退出状态不正确

RPM生成错误: /var/tmp/rpm-tmp.xgXjYS (% build )中的退出状态不正确
EN

Stack Overflow用户
提问于 2017-08-18 00:18:31
回答 1查看 574关注 0票数 0

我真的是在创建rpm包的新手,请帮助。我试图在CentOS7机器上为GCC 5.2创建一个rpm包,但得到了这个错误:

代码语言:javascript
代码运行次数:0
运行
复制
> > /bin/ld: cannot find crti.o: No such file or directory
/bin/ld: cannot find -lc
/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
make[5]: *** [libgcc_s.so] Error 1
make[5]: Leaving directory `/home/build/rpmbuild/BUILD/gcc-5.2.0/x86_64-redhat-linux-gnu/32/libgcc'
make[4]: *** [multi-do] Error 1
make[4]: Leaving directory `/home/build/rpmbuild/BUILD/gcc-5.2.0/x86_64-redhat-linux-gnu/libgcc'
make[3]: *** [all-multi] Error 2
make[3]: Leaving directory `/home/build/rpmbuild/BUILD/gcc-5.2.0/x86_64-redhat-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/home/build/rpmbuild/BUILD/gcc-5.2.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/build/rpmbuild/BUILD/gcc-5.2.0'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.xgXjYS (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.xgXjYS (%build)

规范文件:

代码语言:javascript
代码运行次数:0
运行
复制
> Name:           gcc
Version:        5.2.0
Release:        1%{?dist}
Summary:        GNU Compiler Collection 

License:        GPL
URL:            https://gcc.gnu.org/
Source0:        %{name}-%{version}.tar.gz    

BuildRequires:  gettext
Requires(post): info
Requires(preun): info

%description
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, and Go, as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system. The GNU system was developed to be 100% free software, free in the sense that it respects the user's freedom.

%prep
%setup -q


%build
%configure
make %{?_smp_mflags}


%install
%make_install
%find_lang %{name}
rm -f %{buildroot}/%{_infodir}/dir

%post
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :

%preun
if [ $1 = 0 ] ; then
/sbin/install-info
--delete %{_infodir}/%{name}.info %{_infodir}/dir || :
fi

%files -f %{name}.lang
%doc README AUTHORS ChangeLog
%(_mandir)/manl/gcc.1.gz
%(_infodir)/%{name}.info.gz
%{_bindir}/gcc

%changelog
* Wed Aug 16 2017 masrur <mdmasrur3426@gmail.com> 5.2.0-1
- Initial gcc Package for CentOS 7

我使用youtube教程中的配置配置了spec文件。我不确定我做得对不对,也不确定为什么我会得到这些错误。

EN

回答 1

Stack Overflow用户

发布于 2017-08-18 14:21:37

我不推荐创建您自己的gcc包。有很多可用的包。所以要么

  • 查找适用于您的平台的已编译软件包
  • 查找适用于类似平台的src.rpm,并尝试仅重新生成rpm (使用必要的修补程序对现有src.rpm中的源代码或规范文件进行修补,以使其经过编译

所有这些步骤都会给你带来更好更快的结果。这些选项按照易用性的降序进行监听...所以最好从第一个开始。例如,你可以在http://rpm.pbone.net/或google上查找rpm。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45740304

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档