Bug 23641

Summary: G77 Compiler is broken in REDHAT 7.0 when recompiled
Product: [Retired] Red Hat Linux Reporter: Need Real Name <peterm>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: high    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i586   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-09 01:28:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-01-09 01:27:28 UTC
In preparation for GAMIT?GLOBK installations in Indonesia I have been
attempting
to prove some important aspects of LINUX 7.0 as distributed.

The FORTRAN compiler is the "major" problem.

Initially I upgraded my 6.2 to a 7.0 distribution. Fortran and other
compilers
live in /usr/local/bin which is not altered by upgrades. Additionally my 
.tcshrc file has /usr/local/bin ahead of /usr/bin which is the distribution 
loading area. Thus I was able
to compile GAMIT version 10 without problems.

Since my Indonesia sites are running RedHat 5 systems I was against
upgrading, 
favouring full rebuilds so that full rather than partial systems would be
left
at these sites. I commenced to do this on my system. I tarred off my
user area, (NOT /usr/local unfortunately,) and did manual partitioning to
keep
the disk partitioning the same and proceeded to 
do full GNOME workstation installations.

I then found, Ross validated, that the current gnu.org site version of
Fortran,
2.95.2, which is quite old, fails  to complete a stage 2 compilation. This
was 
first noted by Bob but passed over by myself.
Many tests were tried to unravell this as I did not want to install the
beta 
used in Red Hat. (Re-compilations are necessary as the allowable number of
files 
need to be extended from the compiled limit of 99 to 999. In practice we
use 
10,000 for even greater flexibility. The problem is NOT the number of 
simmultaneous open files but the logical unit numbers that are used. 
The code allows the regognition of the type of file by the block of unit 
numbers that is being used.)

Ross and I then used the 7.0 distribution source disk to extract the RPM
file.
Here is a copy of what was extracted from REDHAT SRPMS

gcc-2.96-20000731.tar.bz2
gcc-Os-testcase.patch
gcc-alias.patch
gcc-align-memcpy.patch
gcc-alpha-addressof.patch
gcc-bogus-subreg.patch
gcc-c++-typedef.patch
gcc-c99.patch
gcc-canon-cond.patch
gcc-clear-hack.patch
gcc-combine-comparison.patch
gcc-commutative.patch
gcc-cp-ii.patch
gcc-cpp-warn.patch
gcc-cpp0.patch
gcc-cpplib.patch
gcc-f-include.patch
gcc-format-checking.patch
gcc-i386-ashlsilea.patch
gcc-i386-lea.patch
gcc-i386-sibcall.patch
gcc-i386-strops.patch
gcc-incomplete-struct.patch
gcc-iso-not-ansi.patch
gcc-java-bytecode.patch
gcc-java-jword.patch
gcc-java-misc.patch
gcc-java-pg.patch
gcc-jsm1.patch
gcc-jsm2.patch
gcc-jsm3.patch
gcc-jsm4.patch
gcc-jsm5.patch
gcc-jsm6.patch
gcc-jsm7.patch
gcc-jsm8.patch
gcc-libstdc++-v3-wnoerror.patch
gcc-loop-hack.patch
gcc-loop-noopt.patch
gcc-loop-noopt2.patch
gcc-loop-scanloop.patch
gcc-loop-test1.patch
gcc-loop-test2.patch
gcc-loop-unroll.patch
gcc-loop.patch
gcc-lowpart-test.patch
gcc-new-abi.patch
gcc-no-warn-trigraphs.patch
gcc-regmove-asm.patch
gcc-relational.patch
gcc-scanf.patch
gcc-sibcall.patch
gcc-simplify-relational.patch
gcc-sparc32-hack.patch
gcc-sparc32-hack2.patch
gcc-sparc32-vaarg.patch
gcc-sparc64-decloffset.patch
gcc-sparc64-hwint.patch
gcc-sparc64-reload.patch
gcc-sparc64-startfile.patch
gcc-sparc64-subreg-byte.patch
gcc-sparc64-uname.patch
gcc-sparcv9-hack.patch
gcc-stmtexpr.patch
gcc-strftime.patch
gcc-string-crash.patch
gcc-subreg-gcse.patch
gcc-subregbyte-gcse.patch
gcc-unroll.patch
gcc-wint_t.patch
gcc-xopen.patch

I then copied the 2.96 version to usr/local and unpacked it.
NOTE I did not apply the patches listed.

I then did the conventional configure, build and install process installing 
into /usr/local/bin.

This version of FORTRAN is compiled incorrectly as it is not able to
process
statements like:



This is part of cplot.f in the plot directory of kf.



c Include files
c -------------
*                         ! the PLOT parameter file
      include 'plot_param.h'
c
*                         ! the PLOT_COM common block
      include 'plot_com.h'
c
*                         ! the ema declaration
      include 'plot_ema.h'

      external plot_bd


What ones sees in the compilation is



g77  -O3 -Wuninitialized -Wno-globals -Wunused -Wimplicit -fno-f2c
-ffast-math 
-fno-automatic -fno-backslash -finit-local-zero -fno-globals cplot.f 
./plot_lib.a 
x1000/x1000.a ../gen_util/gen_util_lib.a ../../libraries/comlib/com_lib.a  
-L/usr/X11R6/lib -
lX11 -o cplotx
cplot.f: In program `plot':
cplot.f:178: warning: unused variable `scr_common__'
cplot.f:178: warning: unused variable `ema_data__'
cplot.f:178: warning: unused variable `font_name__'
cplot.f:178: warning: unused variable `ignore_col1__'
cplot.f:178: warning: unused variable `num_velvec__'
cplot.f:178: warning: unused variable `num_strains__'
cplot.f:178: warning: unused variable `s_field__'
cplot.f:178: warning: unused variable `strainsig'
cplot.f:178: warning: unused variable `strain'
cplot.f:178: warning: unused variable `spos'
cplot.f:178: warning: unused variable `vconfid'
cplot.f:178: warning: unused variable `vscale'
cplot.f:178: warning: unused variable `v_field__'
cplot.f:178: warning: unused variable `vname'
cplot.f:178: warning: unused variable `vpnt'
cplot.f:178: warning: unused variable `vrho'
cplot.f:178: warning: unused variable `vsig'
cplot.f:178: warning: unused variable `vvel'
cplot.f:178: warning: unused variable `vpos'
cplot.f:178: warning: unused variable `map_mode__'
cplot.f:178: warning: unused variable `map_la__'
cplot.f:178: warning: unused variable `map_sa__'
cplot.f:178: warning: unused variable `map_grid_space__'
cplot.f:178: warning: unused variable `map_cd__'
cplot.f:178: warning: unused variable `map_limit__'
cplot.f:178: warning: unused variable `map_proj__'
cplot.f:178: warning: unused variable `map_ou__'
cplot.f:178: warning: unused variable `rota'
cplot.f:178: warning: unused variable `ppos'
cplot.f:178: warning: unused variable `plim'
 plus more of these.

Compilations for  routines that dont have include files is okay

g77  -c -O3 -Wuninitialized -Wno-globals -Wunused -Wimplicit -fno-f2c
-ffast-math 
-fno-automatic -fno-backslash -finit-local-zero -fno-globals advance_rc.f
ar rv plot_lib.a *.o
a - advance_rc.o
rm -f advance_rc.o
g77

The application of all of the patches would be a large task and one that I
am 
not keen to leave to our Indonesian friends at this moment.

Thus it seems that REDHAT have made a real mess of the FORTRAN compiler
in the 7.0 release.

Comment 1 Jakub Jelinek 2001-01-15 11:59:55 UTC
gcc-2.95.2 does not compile on glibc 2.2+ systems, you need to either grab
gcc 2.95.2.1 or the beta of gcc 2.95.3 or apply a patch listed on
http://gcc.gnu.org/install/specific.html#*-*-linux-gnu
If you are using just the tarball from gcc-2.96-xx source rpm, then you must be
prepared to many problems (those patches are there exactly to fix bugs).
The best thing you can do is grab latest gcc errata src.rpm (ATM gcc-2.96-69.src.rpm)
and do:
rpm -Uvh gcc-2.96-*.src.rpm
rpm -bp /usr/src/redhat/SPECS/gcc.spec
This will unpack the tree in /usr/src/redhat/BUILD/gcc-2.96-20000731/
with all patches applied, you can do whatever you wish with that tree then.