🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6343

cc1 passes -O2 to as even though I specified -O

#6343
From: Joel F. Rising
Date: Fri, 01 Dec 1995 00:00
45 lines
2513 bytes
Folks,

I am compiling a gcc-2.7.0 cross-compiler, host sun-sparc-solaris2.4,
target decstation-ultrix.  I don't actually need DEC header files or
even libgcc*, as we're using this only with "nachos".  I just need
that compiler.

I'm compiling with gcc-2.7.0 and binutils-2.6.  binutils was
compiled to provied the need DEC cross linking and assembly.

Here's the offending bit in the compile:

 ---
for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2  _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2  _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf  _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi  _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi  _fixtfdi _fixunstfdi _floatditf  __gcc_bcmp _varargs _eprintf _op_new _op_vnew _new_handler _op_delete  _op_vdel _bb _shtab _clear_cache _trampoline __main _exit _ctors _eh  _pure; \
do \
  echo ${name}; \
  ./xgcc -B./ -O  -DCROSS_COMPILE -DIN_GCC -DSVR4  -g -I./include -g1 -I. -I. -I./config -c -DL${name} \
      ./libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  /fs/net/src/gcc/gcc-2.7.0d/solaris/decstation-ultrix/bin/ar rc tmplibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_muldi3
as: unrecognized option `-O2'
*** Error code 1
make: Fatal error: Command failed for target `libgcc2.a'
Current working directory /fs/net/src/gcc/gcc-2.7.0d/src
*** Error code 1
make: Fatal error: Command failed for target `stmp-multilib-sub'
Current working directory /fs/net/src/gcc/gcc-2.7.0d/src
*** Error code 1
make: Fatal error: Command failed for target `stmp-multilib'
 ---

I don't have -O2 specified in the Makefile, I have -O.  I trussed
this; xgcc calls cpp calls cc1 calls as.  Somehow cc1 is the 
offender, changng the -O to -O2 when it calls as.

I read in ChangeLog.2 that gcc.c was modified so that cc1 would
pass on any -O* to as.  Could the problem be in there somewhere?

Or hey can I skip the libraries and just compiler and install
gcc?
-- 
"There's less here than meets the eye." -- Talullah Bankhead
Technical Details
Message-ID: <49nsu4$lks@tulip.ucsb.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,5d6f79022a08b02c,start
X-Google-Attributes: gid113d02,public
From: rising@eci1.ucsb.edu (Joel F. Rising)
Subject: cc1 passes -O2 to as even though I specified -O
Date: 1995/12/01
Message-ID: <49nsu4$lks@tulip.ucsb.edu>
X-Deja-AN: 120615957
distribution: gnu
sender: daemon@cis.ohio-state.edu
organization: University of California, Santa Barbara
newsgroups: gnu.gcc.bug