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.