V
V
Vladimir2011-11-16 18:01:16
CentOS
Vladimir, 2011-11-16 18:01:16

Building grub from srcrpm on CENTOS 6 x86_64

I'm trying to build grub from source to apply this patch
- grub-0.97/stage2/common.c 2008-02-07 07:56:16.000000000 -0800
+++ grub-0.97/stage2/common.c.new 2008-02 -07 07:59:06.000000000 -0800
@@ -142.7 +142.8 @@
init_bios_info (void)
{
#ifndef STAGE1_5
- unsigned long cont, memtmp, addr;
+ unsigned long memtmp, addr;
+ volatile unsigned long cont;
intdrive;
#endif First, I'm just trying to build an

rpm from this package without changes
ftp.muug.mb.ca/pub/centos/6.0/os/SRPMS/Packages/grub-0.97-68.el6.src.rpm
user and as root. Here is the sequence of actions
~ cd
~ wgetftp.muug.mb.ca/pub/centos/6.0/os/SRPMS/Packages/grub-0.97-68.el6.src.rpm
~ rpm -ivh grub-0.97-68.el6.src.rpm
~ cd rpmbuild
After I edit grub.cpec and replace the line
BuildRequires: autoconf /usr/lib/crt1.o automake
with

%ifarch %{sparc} x86_64
BuildRequires: autoconf /usr/lib64/crt1.o automake
%else
BuildRequires: autoconf /usr/lib/ crt1.o automake
%endif

~ rpmbuild -ba SPECS/grub.spec Which

results in an error

configure:3331: error: in `/root/rpmbuild/BUILD/grub-0.97':
configure:3334: error: C compiler cannot create executables
See `config.log' for more details.

here is the output of config.log
pastebin.com/raw.php?i=NKFgNbtW

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
YourChief, 2011-11-16
@YourChief

the phrase C compiler cannot create executables occurs both when the C compiler really cannot create executable files (for example, when compiling to an unsupported processor architecture), and when it simply does not exist. install it

V
Vladimir, 2011-11-16
@Casufi

Installed, located in /usr/lib64/ I ruled the spec file so that it would look for the dependency not in /usr/lib but in /usr/
lib64 rpm for 64 bit system

P
platerx, 2011-11-16
@platerx

It is 32-bit despite the name of the package: Accordingly, it needs 32-bit libraries to build
$ rpm2cpio grub-0.97-68.el6.x86_64.rpm |cpio -id
$ file sbin/grub
sbin/grub: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.18, stripped

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question