Tuesday, April 20, 2010

GCC 4.5 Packaging - Stage 2 - Semi Successfull

So after 54mins of building with my J value at 8 (refer to my old post about J value).
I have somewhat made some progress.

Here is the message I get at the end.

Processing files: gcc-debuginfo-4.5-1.fc12.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/bchao/rpmbuild/BUILDROOT/gcc-4.5-1.fc12.x86_64
Wrote: /home/bchao/rpmbuild/SRPMS/gcc-4.5-1.fc12.src.rpm
Wrote: /home/bchao/rpmbuild/RPMS/x86_64/gcc-4.5-1.fc12.x86_64.rpm
Wrote: /home/bchao/rpmbuild/RPMS/x86_64/gcc-debuginfo-4.5-1.fc12.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.Eh1ssI
+ umask 022
+ cd /home/bchao/rpmbuild/BUILD
+ cd gcc-4.5
+ rm -rf /home/bchao/rpmbuild/BUILDROOT/gcc-4.5-1.fc12.x86_64
+ exit 0

It created the RPM files I wanted without a hitch, but I still face some warnings & alerts.

1. I received warnings of duplicate files below are some examples of the warning:

warning: File listed twice: /usr/lib/gcc/x86_64-unknown-linux-gnu
warning: File listed twice: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0
warning: File listed twice: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbegin.o

2. I'm down to 1 rpath error, but with my 32bit build I did not get any errors

WARNING 0020: file '/usr/bin/gij' contains an rpath referencing '..' of an absolute path [/usr/lib/../lib64/gcj-4.6.0-11]

Its a step to the right direction.

3. Still getting those annoying cpio alerts, examples as follows

cpio: gcc-4.5/host-x86_64-unknown-linux-gnu/gcc/cfns.gperf: Cannot stat: No such file or directory
cpio: gcc-4.5/x86_64-unknown-linux-gnu/gnu/java/locale/LocaleData.java: Cannot stat: No such file or directory
cpio: gcc-4.5/x86_64-unknown-linux-gnu/libjava/com/sun/javadoc/ClassDoc.java: Cannot stat: No such file or directory
cpio: gcc-4.5/x86_64-unknown-linux-gnu/libjava/com/sun/javadoc/ConstructorDoc.java: Cannot stat: No such file or directory
cpio: gcc-4.5/x86_64-unknown-linux-gnu/libjava/com/sun/javadoc/Doc.java: Cannot stat: No such file or directory
cpio: gcc-4.5/x86_64-unknown-linux-gnu/libjava/com/sun/javadoc/DocErrorReporter.java: Cannot stat: No such file or directory
cpio: gcc-4.5/x86_64-unknown-linux-gnu/libjava/com/sun/javadoc/Doclet.java: Cannot stat: No such file or directory
cpio: gcc-4.5/x86_64-unknown-linux-gnu/libjava/com/sun/javadoc/ExecutableMemberDoc.java: Cannot stat: No such file or directory


I later performed an rpmlint on my spec, source rpm file and rpm file. Below are the results that came back from rpmlint

SPEC file only came back with 2 warnings so its a good sign

[bchao@ireland SPECS]$ rpmlint gcc4.5.spec
gcc4.5.spec:48: W: configure-without-libdir-spec
gcc4.5.spec: W: invalid-url Source0: http://scotland.proximity.on.ca/DXR/gcc/x86_64/gcc4.5.tar HTTP Error 403: Forbidden
0 packages and 1 specfiles checked; 0 errors, 2 warnings.

The source rpm, came back with 1 error and 2 warnings

[bchao@ireland SRPMS]$ rpmlint gcc-4.5-1.fc12.src.rpm
gcc.src: E: invalid-spec-name
gcc.src:48: W: configure-without-libdir-spec
gcc.src: W: invalid-url Source0: http://scotland.proximity.on.ca/DXR/gcc/x86_64/gcc4.5.tar HTTP Error 403: Forbidden
1 packages and 0 specfiles checked; 1 errors, 2 warnings.

My rpm file, and came back with this result.

1 packages and 0 specfiles checked; 149 errors, 4524 warnings.

Looks like I got a lot more work to do, but at least I made some progress. LaterI will provide my results from the 32 architecture build next time I go to work.


For now you can grab these rpm files here, all the other files I used here, and my build log and config log.

Just an update, second attempt with distcc was not successful as well.

Using distcc to help build GCC 4.5

So trying to be efficient in building GCC 4.5, I am going to use something I learned in SBR600 and that is using distcc. In my past blog, I used distcc to build abiword a open source text editor. From the result from that build, I thought why not give it a shot.

Since I haven't done this for about 4 months, I referred to the notes my professor Chris Tyler provided us that class also some notes from my blog.

The three machines I decided to use for my experiment are: HongKong, Scotland and of course Ireland.

So I setup the machines with the instructions from the site. And here is a screen shot of the results


As you look at the screen capture. I ran the tool top to display all the tasks running on each system. So in the bottom two windows, if done correctly you should be able to see an entry of with the following commands "cc1, distccd, or ccplus". But sadly, it was not there except for the Ireland box, so maybe I messed up somewhere. So for now, I'll have to wait 53mins till my GCC build fails again.

Hopefully the next time I build everything will work perfectly.

GCC 4.5 Packaging - Stage 2 - Work On Missing Files

At the bottom of my last post, I noted there were a few things left I had to do. Today I decided to tackle task 3 since its a little more simpler.

So I spoke with Chris Tyler in our Seneca Chanel on IRC server irc.freenode.net and asked for some help. What I needed to do was place the displaced files in the proper directory. On the SPEC file, that takes place in the %files section.

Here is the conversation we had: File

So with that in mind, here is my spec file.

So now I'll go ahead and give this a try.

Sunday, April 18, 2010

GCC 4.5 Command Line and RPMBUILD Configuration Comparison

Due to my build failure rate, I was proposed to check the configure line between doing a command line build and using the rpmbuild tool.

To Check out the differences between the two, you would simply look at the config.log file.
This file contains all the information gathered during the configure and make section.

So I have provided the two config.log files for you: Command Line | Rpmbuild

When I used the diff command between the two files. There wasn't much differences.

The main difference is for my rpmbuild method i used the --disable-rpath option to try to disable the rpath errors I've been getting but sadly it did not help.

Below is the output from diff command. If you haven't used or heard of diff before, what it does is compares files and displays the differences between files.


[bchao@ireland gcc-4.5]$ diff config.log ../rpmbuild/BUILD/gcc-4.5/config.log
7c7
< $ ./configure --disable-mulitlib --- > $ ./configure --disable-rpath --disable-multilib
1039c1039
< toplevel_configure_arguments="'./configure"> TOPLEVEL_CONFIGURE_ARGUMENTS='./configure --disable-rpath --disable-multilib'
1052c1052
< build_configargs="'--cache-file="../config.cache" languages="c,c++,fortran,java,lto,objc'\''" name="'\''s,y,y,'\''"> build_configargs='--cache-file=../config.cache '\''--disable-rpath'\'' '\''--disable-multilib'\'' '\''--enable-languages=c,c++,fortran,java,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'
1080c1080
< host_configargs="'--cache-file="./config.cache" languages="c,c++,fortran,java,lto,objc'\''" name="'\''s,y,y,'\''"> host_configargs='--cache-file=./config.cache '\''--disable-rpath'\'' '\''--disable-multilib'\'' '\''--enable-languages=c,c++,fortran,java,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'
1116c1116
< target_configargs="'--cache-file="./config.cache" languages="c,c++,fortran,java,lto,objc'\''" name="'\''s,y,y,'\''"> target_configargs='--cache-file=./config.cache '\''--disable-rpath'\'' '\''--disable-multilib'\'' '\''--enable-languages=c,c++,fortran,java,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'


On a side note...
Here is what is left for GCC packaging.

1. Fix rpath issue.
2. Fix cpio issue
3. Fix %files section so that the at the end of the installation all files know where to go.



My Bare Spec File

Friday, April 16, 2010

GCC 4.5 Build - RPATH conundrum solved?

So one of my main problem building gcc4.5 is the rpath errors I'm getting. I have received advises from my professor Chris Tyler, and from the Fedora Development Community via IRC on the #fedora-devel channel on irc.freenode.net server.

They have pointed to the fedora wiki page I mentioned before and as well suggested I used a patch.
But a few moments ago I found this site that sorta helps bypass the rpath errors and allows rpmbuild to continue building.

Basically, its telling me to create a environment variable for rpath. Below is the syntax I used, with the variable incorporated into the build.

time QA_RPATHS=$[ 0x0020 ] rpmbuild -ba gcc4.5.spec 2>&1 |tee error.txt

As a result, it did build further, and here is the output for my rpath error. It did in fact bypass these errors and allowed rpmbuild to keep building.


+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
WARNING 0020: file '/usr/local/bin/gij' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64:/usr/local/lib/../lib64/gcj-4.6.0-11]
WARNING 0020: file '/usr/local/bin/gij' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64:/usr/local/lib/../lib64/gcj-4.6.0-11]
WARNING 0020: file '/usr/local/bin/gserialver' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/gjarsigner' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/gkeytool' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/gjar' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/gcjh' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/gc-analyze' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/grmiregistry' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/grmic' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/gorbd' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/gcj-dbtool' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/gjavah' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/gnative2ascii' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/jv-convert' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/grmid' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/gtnameserv' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/bin/gappletviewer' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/lib64/libgij.so.11.0.0' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/lib64/libgcj-tools.so.11.0.0' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]
WARNING 0020: file '/usr/local/lib64/gcj-4.6.0-11/libjvm.so' contains an rpath referencing '..' of an absolute path [/usr/local/lib/../lib64]


Now what I have to do solve this issue.

Thursday, April 15, 2010

GCC 4.5 - Building On i686 (32bit) and x86_64 (64bit)

I don't think I mentioned before, I was using two machines to build the pre-release of GCC 4.5.

The screen shots below are basically my build failure with the new modified gcc 4.4.3 spec file.

The build time for both machines are going to be significantly different, because of the number of cores the two system has and the the amount of RAM.

The 64bit machine is one of the CDOT machines by the name ireland and here is the specs of the mahcine

Quad Core - Intel Q6600, 4 GB RAM , 500GB HDD

The 32bit machine is one I grabbed from work and installed Fedora on it.
It is a AMD 64 X2 4000+, 512 MB RAM, 80GB

Well here are the results of my builds so far. Hopefully someone can help me go pass this stage


Ireland - x86_64 machine


Work Computer - i686 Machine

New Approach - Packaging GCC 4.5

So today, I tried another approach because to see

So I grabbed the rawhide 4.4.3 spec file and modified it a little, by disabling some patches that were not necessary.

Here is the modified spec file

The first time I ran it, this is the error I received:

echo timestamp > stmp-int-hdrs
rm gcj-dbtool.pod jcf-dump.pod jv-convert.pod grmic.pod gcov.pod gcj.pod gc-analyze.pod gfdl.pod cpp.pod gij.pod gcc.pod gfortran.pod fsf-funding.pod
make[2]: Leaving directory `/home/bchao/rpmbuild/BUILD/gcc-4.5/host-x86_64-unknown-linux-gnu/gcc'
Checking multilib configuration for libgcc...
mkdir -p -- x86_64-redhat-linux-gnu/libgcc
Configuring in x86_64-redhat-linux-gnu/libgcc
configure: creating cache ./config.cache
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking for x86_64-redhat-linux-gnu-ar... x86_64-redhat-linux-gnu-ar
checking for x86_64-redhat-linux-gnu-lipo... x86_64-redhat-linux-gnu-lipo
checking for x86_64-redhat-linux-gnu-nm... /home/bchao/rpmbuild/BUILD/gcc-4.5/host-x86_64-unknown-linux-gnu/gcc/nm
checking for x86_64-redhat-linux-gnu-ranlib... x86_64-redhat-linux-gnu-ranlib
checking for x86_64-redhat-linux-gnu-strip... x86_64-redhat-linux-gnu-strip
checking whether ln -s works... yes
checking for x86_64-redhat-linux-gnu-gcc... /home/bchao/rpmbuild/BUILD/gcc-4.5/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/home/bchao/rpmbuild/BUILD/gcc-4.5/host-x86_64-unknown-linux-gnu/gcc/ -B/usr/x86_64-redhat-linux-gnu/bin/ -B/usr/x86_64-redhat-linux-gnu/lib/ -isystem /usr/x86_64-redhat-linux-gnu/include -isystem /usr/x86_64-redhat-linux-gnu/sys-include
checking for suffix of object files... configure: error: in `/home/bchao/rpmbuild/BUILD/gcc-4.5/x86_64-redhat-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory `/home/bchao/rpmbuild/BUILD/gcc-4.5'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.O5eDf8 (%build)


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

So I did some search and found this site, I followed the instructions on the site. Problem is the package it is referring to does not exist.

So I did a yum list glibc-devel.* and found this as the substitute glibc-devel.i686

Now I installed that, and this is the new error I encountered

../../gcc/ada/sem_eval.adb:1703:10: warning: 'Folded_Val' may be used uninitialized in this function
/home/bchao/rpmbuild/BUILD/gcc-4.5/obj-x86_64-redhat-linux/./prev-gcc/xgcc -B/home/bchao/rpmbuild/BUILD/gcc-4.5/obj-x86_64-redhat-linux/./prev-gcc/ -B/usr/x86_64-redhat-linux/bin/ -B/usr/x86_64-redhat-linux/bin/ -B/usr/x86_64-redhat-linux/lib/ -isystem /usr/x86_64-redhat-linux/include -isystem /usr/x86_64-redhat-linux/sys-include -c -O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -gtoggle -fprofile-generate -gnatpg -gnata -nostdinc -I- -I. -Iada -I../../gcc/ada -I../../gcc/ada/gcc-interface ../../gcc/ada/sem_scil.adb -o ada/sem_scil.o
/home/bchao/rpmbuild/BUILD/gcc-4.5/obj-x86_64-redhat-linux/./prev-gcc/xgcc -B/home/bchao/rpmbuild/BUILD/gcc-4.5/obj-x86_64-redhat-linux/./prev-gcc/ -B/usr/x86_64-redhat-linux/bin/ -B/usr/x86_64-redhat-linux/bin/ -B/usr/x86_64-redhat-linux/lib/ -isystem /usr/x86_64-redhat-linux/include -isystem /usr/x86_64-redhat-linux/sys-include -c -O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -gtoggle -fprofile-generate -gnatpg -gnata -nostdinc -I- -I. -Iada -I../../gcc/ada -I../../gcc/ada/gcc-interface ../../gcc/ada/sem_smem.adb -o ada/sem_smem.o
/home/bchao/rpmbuild/BUILD/gcc-4.5/obj-x86_64-redhat-linux/./prev-gcc/xgcc -B/home/bchao/rpmbuild/BUILD/gcc-4.5/obj-x86_64-redhat-linux/./prev-gcc/ -B/usr/x86_64-redhat-linux/bin/ -B/usr/x86_64-redhat-linux/bin/ -B/usr/x86_64-redhat-linux/lib/ -isystem /usr/x86_64-redhat-linux/include -isystem /usr/x86_64-redhat-linux/sys-include -c -O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -gtoggle -fprofile-generate -gnatpg -gnata -nostdinc -I- -I. -Iada -I../../gcc/ada -I../../gcc/ada/gcc-interface ../../gcc/ada/sem_type.adb -o ada/sem_type.o
../../gcc/ada/sem_prag.adb: In function 'Sem_Prag.Analyze_Pragma.Process_Inline':
../../gcc/ada/sem_prag.adb:3678:10: warning: 'Subp' may be used uninitialized in this function
../../gcc/ada/sem_prag.adb: In function 'Sem_Prag.Analyze_Pragma':
../../gcc/ada/sem_prag.adb:8419:13: warning: 'Convention' may be used uninitialized in this function
../../gcc/ada/sem_prag.adb:12104:25: warning: 'Chr' may be used uninitialized in this function
/home/bchao/rpmbuild/BUILD/gcc-4.5/obj-x86_64-redhat-linux/./prev-gcc/xgcc -B/home/bchao/rpmbuild/BUILD/gcc-4.5/obj-x86_64-redhat-linux/./prev-gcc/ -B/usr/x86_64-redhat-linux/bin/ -B/usr/x86_64-redhat-linux/bin/ -B/usr/x86_64-redhat-linux/lib/ -isystem /usr/x86_64-redhat-linux/include -isystem /usr/x86_64-redhat-linux/sys-include -c -O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -gtoggle -fprofile-generate -gnatpg -gnata -nostdinc -I- -I. -Iada -I../../gcc/ada -I../../gcc/ada/gcc-interface ../../gcc/ada/sem_util.adb -o ada/sem_util.o
sem_util.adb:2249:17: warning: actuals for this call may be in wrong order
make[3]: *** [ada/sem_util.o] Error 1
make[3]: *** Waiting for unfinished jobs....
rm gcj-dbtool.pod jcf-dump.pod jv-convert.pod grmic.pod gcj.pod gc-analyze.pod gfdl.pod cpp.pod gij.pod gcov.pod gfortran.pod fsf-funding.pod gcc.pod
make[3]: Leaving directory `/home/bchao/rpmbuild/BUILD/gcc-4.5/obj-x86_64-redhat-linux/gcc'
make[2]: *** [all-stageprofile-gcc] Error 2
make[2]: Leaving directory `/home/bchao/rpmbuild/BUILD/gcc-4.5/obj-x86_64-redhat-linux'
make[1]: *** [stageprofile-bubble] Error 2
make[1]: Leaving directory `/home/bchao/rpmbuild/BUILD/gcc-4.5/obj-x86_64-redhat-linux'
make: *** [profiledbootstrap] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.YnEax1 (%build)

real 12m24.594s
user 16m40.623s
sys 3m57.327s

I went on the #fedora-devel channel on the usual irc.freenode.net server hoping someone can provide me some insight, but no one has responded to my inquiries.

Also must be noted, on my previous builds with my temp spec file, my build times were about 1hour before it fails, now it won't go past 15 mins.

Hopefully I can solve this soon.

Here is the output from the build.

This is the syntax I used to make the output file

rpmbuild -ba gcc4.5.spec.bak 2>&1 | tee output.txt
This allows me to get standard error output and regular output into one file.

Thursday, April 8, 2010

GCC RPM Packaging - Stage 1 - New Error - Update

So after encountering that problem, I jumped on IRC and again went to my usual support channels
#fedora-devel and #seneca on irc.freenode.net.

I first approached my professor Chris Tyler under the name ctyler on #seneca and asked him if he has encountered or had any information about the build error I received.

He noted the problem I am having related to rpath (runpath) and it is a common problem. So he provided me a link (here) from the fedora project wiki which provides some information on how to bypass this error and also he suggests I look at the GCC 4.4.3 rawhide spec file and see if there are any patches they used for the rpath.

A snippet of information from the Fedora Project Wiki Page on rpath

Sometimes, code will hardcode specific library paths when linking binaries (using the -rpath or -R flag). This is commonly referred to as an rpath. Normally, the dynamic linker and loader (ld.so) resolve the executable's dependencies on shared libraries and load what is required. However, when -rpath or -R is used, the location information is then hardcoded into the binary and is examined by ld.so in the beginning of the execution. Since the Linux dynamic linker is usually smarter than a hardcoded path, we usually do not permit the use of rpath in Fedora.



First, I went through the Fedora wiki tried a combination of methods to get pass this error.

The first way using the following flag with configure --disable-rpath. Adding this flag with my other flags, my syntax looks like this:

./configure --disable-multilib --disable-rpath

So with the new change, I started to build again and again after 53mins I still received the same error.

So I consulted with my professor again, and he suggest I use the second method of removing the rpath. "As a last resort, Fedora has a package called chrpath. When this package is installed, you can run chrpath --delete on the files which contain rpath." Information provided from the Fedora Project wiki.

So what I had to do was add the package chrpath as a BuildRequire and add the following line

chrpath --delete $RPM_BUILD_ROOT%{_bindir}/xapian-tcpsrv to my spec file.

I so added this line to the %prep section hoping it would work, and after 4 mins of building it failed. So I must of placed it in the wrong section, since I've been busy for the last 2 days I was unable to ask anyone for help in regards to the placement of this line.

My next step was look at the GCC 4.4.3 rawhide spec file and see if they used any patches. To my surprise they used the following patch for their build : gcc44-libtool-no-rpath.patch

I did a search online for the patch and found a site that hosted it. (here). Also being such a noob as I am, when I went to the rpmbuild/SOURCE directory, I noticed that all the patches related to GCC 4.4.3 were all there. So I am safe to assume that the source rpm of the GCC 4.4.3 rawhide contained all the patches required to build 4.4.3.

So added a line to my patch section for the patch and tried to build again.

After 53 mins I get the same rpath error.


So, for now I will leave it at that and work on it another day. Ciao!!

GCC RPM Packaging - Stage 1 - New Error

Just a recap from my last post, I was having issues with an error regarding missing build-id.

After asking my professor and the fedora community, I was advised that there was maybe a patch that was used in gcc 4.4.3 rawhide.

So I found the patch online, integrated into my spec file, and started packaging gcc4.5.

This evening when I woke up, I was greeted with the following error. I will again jump onto IRC and see if anyone can provide me with some help.

Here is the error, sorry about the length

cpio: gcc-4.5/x86_64-unknown-linux-gnu/libjava/gnu/classpath/tools/taglets/GnuExtendedTaglet.java: Cannot stat: No such file or directory
cpio: gcc-4.5/x86_64-unknown-linux-gnu/libjava/gnu/classpath/tools/taglets/SinceTaglet.java: Cannot stat: No such file or directory
cpio: gcc-4.5/x86_64-unknown-linux-gnu/libjava/gnu/classpath/tools/taglets/TagletContext.java: Cannot stat: No such file or directory
cpio: gcc-4.5/x86_64-unknown-linux-gnu/libjava/gnu/classpath/tools/taglets/ValueTaglet.java: Cannot stat: No such file or directory
cpio: gcc-4.5/x86_64-unknown-linux-gnu/libjava/gnu/classpath/tools/taglets/VersionTaglet.java: Cannot stat: No such file or directory
120596 blocks
+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
*******************************************************************************
*
* WARNING: 'check-rpaths' detected a broken RPATH and will cause 'rpmbuild'
* to fail. To ignore these errors, you can set the '$QA_RPATHS'
* environment variable which is a bitmask allowing the values
* below. The current value of QA_RPATHS is 0x0000.
*
* 0x0001 ... standard RPATHs (e.g. /usr/lib); such RPATHs are a minor
* issue but are introducing redundant searchpaths without
* providing a benefit. They can also cause errors in multilib
* environments.
* 0x0002 ... invalid RPATHs; these are RPATHs which are neither absolute
* nor relative filenames and can therefore be a SECURITY risk
* 0x0004 ... insecure RPATHs; these are relative RPATHs which are a
* SECURITY risk
* 0x0008 ... the special '$ORIGIN' RPATHs are appearing after other
* RPATHs; this is just a minor issue but usually unwanted
* 0x0010 ... the RPATH is empty; there is no reason for such RPATHs
* and they cause unneeded work while loading libraries
* 0x0020 ... an RPATH references '..' of an absolute path; this will break
* the functionality when the path before '..' is a symlink
*
*
* Examples:
* - to ignore standard and empty RPATHs, execute 'rpmbuild' like
* $ QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild my-package.src.rpm
* - to check existing files, set $RPM_BUILD_ROOT and execute check-rpaths like
* $ RPM_BUILD_ROOT= /usr/lib/rpm/check-rpaths
*
*******************************************************************************
ERROR 0020: file '/home/bchao/gcc/dist/bin/gij' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64:/home/bchao/gcc/dist/lib/../lib64/gcj-4.6.0-11]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gij' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64:/home/bchao/gcc/dist/lib/../lib64/gcj-4.6.0-11]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gserialver' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gjarsigner' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gkeytool' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gjar' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gcjh' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gc-analyze' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/grmiregistry' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/grmic' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gorbd' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gcj-dbtool' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gjavah' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gnative2ascii' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/jv-convert' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/grmid' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gtnameserv' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/bin/gappletviewer' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
*******************************************************************************
*
* WARNING: 'check-rpaths' detected a broken RPATH and will cause 'rpmbuild'
* to fail. To ignore these errors, you can set the '$QA_RPATHS'
* environment variable which is a bitmask allowing the values
* below. The current value of QA_RPATHS is 0x0000.
*
* 0x0001 ... standard RPATHs (e.g. /usr/lib); such RPATHs are a minor
* issue but are introducing redundant searchpaths without
* providing a benefit. They can also cause errors in multilib
* environments.
* 0x0002 ... invalid RPATHs; these are RPATHs which are neither absolute
* nor relative filenames and can therefore be a SECURITY risk
* 0x0004 ... insecure RPATHs; these are relative RPATHs which are a
* SECURITY risk
* 0x0008 ... the special '$ORIGIN' RPATHs are appearing after other
* RPATHs; this is just a minor issue but usually unwanted
* 0x0010 ... the RPATH is empty; there is no reason for such RPATHs
* and they cause unneeded work while loading libraries
* 0x0020 ... an RPATH references '..' of an absolute path; this will break
* the functionality when the path before '..' is a symlink
*
*
* Examples:
* - to ignore standard and empty RPATHs, execute 'rpmbuild' like
* $ QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild my-package.src.rpm
* - to check existing files, set $RPM_BUILD_ROOT and execute check-rpaths like
* $ RPM_BUILD_ROOT= /usr/lib/rpm/check-rpaths
*
*******************************************************************************
ERROR 0020: file '/home/bchao/gcc/dist/lib64/libgij.so.11.0.0' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/lib64/libgcj-tools.so.11.0.0' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
ERROR 0020: file '/home/bchao/gcc/dist/lib64/gcj-4.6.0-11/libjvm.so' contains an rpath referencing '..' of an absolute path [/home/bchao/gcc/dist/lib/../lib64]
error: Bad exit status from /var/tmp/rpm-tmp.HvhChP (%install)


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



Hopefully, someone can point me to the right direction.. later

GCC 4.5 - RPM Packaging Stage 1 - Update

From my previous post, I encountered a build error while building doing a rpmbuild on gcc 4.5.

So today, I went to ask my professor Chris Tyler for his opinion. Here is his answer

19:50 @ctyler BoChao-Work: yes, not uncommon. Search the Fedora wiki for it.
The problem is that it's trying to strip out the debug info
into a separate package, but there's no build ID in the binary,
so it won't be able to check that it's matched the right binary
and debuginfo.

Also I went onto the Fedora Development channel (#fedora-devel) on IRC (irc.freenode.net) and also asked for their advice.
Just as my Chris said, there is a patch that I needed to help bypass that error.

Here is a snippet of my conversation in the Fedora Development Channel

19:59 BoChao-Work - Hi All, wonder if anyone can help me with the follow
error: http://pastebin.com/vv9jh2Yp
20:07 -!- daMaestro [~jon@fedora/damaestro] has joined #fedora-devel
20:08 nirik - BoChao-Work: a gcc devel channel might be better? I don't think
fedora has any 4.5 package yet.
20:08 tibbs|h - Generally happens when you use gcc to do the final link
instead of ld.
20:09 tibbs|h - Fedora gcc carries a patch for this. I needed to apply it in
my gpc packages.
20:09 tibbs|h - gcc44-build-id.patch

I went on Google and did a search for the gcc patch and found this site that hosted the patch.

Since I never had to deal with a patch before in a spec, I again did a quick search on Google using the following phrase "patch in spec files" the first result was from redhat which showed how to integrate a patch file into the spec file.

So here is my new modified temp spec file.

Also a little note, I had to put the patch file in rpmbuild/SOURCES/ directory, didn't know that. Took me a while to figure it out.

Now time to build and see what happens... Cheers

Wednesday, April 7, 2010

GCC 4.5 - RPM Packaging Stage 1

Before heading off to bed, here is the result of my rpmbuild from my temp spec file.

Sadly it didn't go so great, as it did with as the raw build. I received the following error.


extracting debug info from /home/bchao/rpmbuild/BUILDROOT/gcc-4.5-1.fc12.x86_64/home/gcc/dist/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/install-tools/fixincl
*** ERROR: No build ID note found in /home/bchao/rpmbuild/BUILDROOT/gcc-4.5-1.fc12.x86_64/home/gcc/dist/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/install-tools/fixincl
error: Bad exit status from /var/tmp/rpm-tmp.Tp8i0z (%install)


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

I will ask my professor Chris Tyler later when I wake up about this error, maybe he can provide some insight to this problem.

Setting Up Fedora 12 i386 Machine To Compile/ Build GCC 4.5 - Part 2 -- Success!!

After 2.5 hr of waiting for gcc 4.5 to compile, the final result = success.

Now time to enter the following command "make install" to install gcc to proper location.

The end result, it installed properly.

Here is a screenshot after it completed installing.

Now all I have to do is create a spec file and then hopefully we will have a package to test wtih dehydra, viewsource, and jshydra packages that my colleagues and I created.

To create our gcc 4.5 rpm package:
1. I will have to create a tarball from the unmodified trunk directory.
2. Upload to another CDOT machine Scotland that is currently holding our RPM packages.
3. Create a spec file from scratch, then build it.

So once I get all this done, I will be back and provide an update


Update:

gcc 4.5 tar files are located in the following url

http://scotland.proximity.on.ca/DXR/gcc - depending on the architecure your working on, travel to the right path

Temp Spec File
http://hongkong.proximity.on.ca/bchao/gcc4.5.spec

Setting Up Fedora 12 i386 Machine To Compile/ Build GCC 4.5

Since I've been working on a CDOT machine running Fedora 12 on x86_64 architecure, I decided to try this on a i386 architecure machine. So I grabbed a machine installed Fedora 12 & updated it with the updates.

After everything is setup, I downloaded the gcc trunk again and tried to configure with the following syntax:

./configure --prefix=/home/bchao/gcc/dist --disable-multilib


Again, because I haven't installed the libraries needed to compile, I got the following error

configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.

So again, I had to install the development packages for those packages, I entered the following syntax to get them installed

yum install gmp-devel mpfr-devel libmpc libmpc-devel

After installing the dependencies needed to compile, I issued the configure syntax and it worked like a charm.

So now, I issued the following command, and I will wait for for about 2 hours for gcc 4.5 to compile.

Hope it works out

Tuesday, April 6, 2010

Building GCC 4.5 - New Record Time Before Failing

So today, I checked on my previous blogs to find some information and low and behold ehren a student at Seneca provided me some insight to my problem.

He also faced a similar problem with one of the other cdot machines (Australia). So what he did was try it on another cdot machine (ireland) and it worked just fine. He advised me to give that a go, also try using the option --disable-multilib.

I went to the gcc installation website to see what that does, and here it is

--disable-multilib
Specify that multiple target libraries to support different target variants, calling conventions, etc. should not be built. The default is to build a predefined set of them.
So, I jumped onto ireland, and downloaded the trunk again.

So instead of just using the regular ./configure command, I added the following option as well and the syntax now looks like

./configure --disable-multilib


So far it ran past the stage it would usually fail on India. About 1 and 1/2 hour later it finally failed ending with the following prompt.

Ehren suggested I try to do a make install and see what happens here is the result.

With more communication with ehren, I decided to follow more of his advice. Here is a snippet of our conversation


22:04 what you mean i didn't use the --prefix?
22:05 sorry i meant to start with hey
22:05 this is my syntax ./configure --disable-multilib
ehren - 22:05 you can specify the install directory by going ../configure
--prefix=/home/blah/gcc/dist
ehren - 22:06 then gcc and g++ etc will be located in
/home/blah/gcc/dist/bin/gcc
ehren - 22:06 or g++ etc
22:07 oh..so the line would look like ./configure
--prefix=/home/blah/gcc/dist --disable-multilib?
ehren - 22:07 yup
22:07 haha..thanks, let me give that a go
ehren - 22:07 to speed things up you can use --disable-bootstrap as well
22:08 yeah, i had that. That skips stage 2 and 3 right?
ehren - 22:08 yeah. as I understand it, with bootstrap on gcc first builds a
barebones compiler and then uses that to compile the rest of
itself
22:09 thats neat
ehren - 22:10 yeah... I think it's only needed if you're starting with an
old/crappy compiler
22:10 ok


So the new syntax I would try now is

./configure --prefix=/home/bchao/gcc/dist --disable-multilib

Will provide more update on this build progress later.

Sunday, April 4, 2010

Building GCC 4.5 On My Laptop - F12 x86_64

Finally, after re-installing and updating Fedora on my laptop, and installed all the neccessary tools to get rpmbuild working.

So again, I had to grab the trunk from GCC via SVN, this took about 30 mins because of my internet connection at home.

After finally grabbing trunk, I created a backup of the directory so I don't need to constantly keep downloading it if/when I mess up.

Once all the little tasks were completed, I went to the trunk directory and started off with the configure command, and received the following error:

configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.

So, I had install GMP, MPFR, and MPC on the laptop with the following command

yum install gmp mpfr mpc gmp-devel mpfr-devel libmpc libmpc-devel

After issuing that command, I let it the missing build dependencies were installed. Again, I was met with the same fate as my other builds on India, but it took 2x as long.

Weekend Work Progress

With another weekend that the CDOT machines were powered off, I have no choice to download the trunk on my laptop.

Now I'll just wait for it download so I can start building and going through the steps off the GCC Installation Page.

Will provide update in a few hours, after I re-install Fedora on my laptop

Saturday, April 3, 2010

GCC 4.5 Build Update

When I went on Google, and did a simple search on how to build GCC. I cam across a page on the GCC GNU website.

This site provides some steps on how to setup gcc and build it.

So I'm going to follow these steps first and if I come across any problems I'll jump on to their IRC channel on OFTC server.

Friday, April 2, 2010

GCC 4.5 Packaging Progess Update

So Here's An Update of My Progress So Far.

Since the CDOT machines were down over the weekend, I could not really work on the problem we were having, since I don't have a copy of the spec file on my laptop.

Now since its back online, the problem that my partner and I were having in regards to missing language files has disappeared, but what re-appeared was our original problem.

The error we are recieving now is that its failing at teh 2nd step of the build and advised us to check the config.log file.

Here is the error we are having: Build Error

Here is the log: Config.Log

Since I didn't know how to read the config.log file I went onto Google and did a search and came up with this site that is somewhat helpful.


While I was doing that, Jonathan and I jumped into the #gcc-devel channel on IRC on the server irc.freenode.net and asked if anyone can help us.

One of the members in the channel advised us to build straight from the tarball. Essentially the tarball is the gcc4.5 trunk, so what I did was re-download the trunk which took about 15 mins from svn.


In the directory I ran the ./configure & make commands. So far the configure command worked fine no errors and the make command came back with the error we were getting originally.

So now we are headed off to the gcc community and hopefully they can help us