In the old gcc-2.95.2 days we could create a solaris cross compiler which 
worked well with our use of STL's "class queue" defined as <queue>. In the much 
newer gcc-3.4.2, release our solaris cross compiler has a problem 
differentiating between the system header's definition of "struct queue", and 
our need to reference the STL queue object. 

When we compared the log file output from compiling each of the cross 
compilers, we found that the old fixinc.sh script created the sys/stream.h 
wrapper fine, but the new version did not. When we looked into the new version 
of fixinc.sh and src/gcc/fixinc/README, we realized could customize our compile 
environment to force processing of stream.h to occur. However before getting 
around to this we decided to try inserting the old version of the file from the 
old compiler, where it should be located in the new compiler. Guess what it 
worked! I am pretty sure I should create an official patch etc. but I have 
never done this before. Actually I am really happy to have a solution at all.

But I am making this bug to document a shortcut does exist for other Solaris 
users. If I have time I will look into creating a patch for the gcc-3.4.x 
distribution. The following is the output from the 3.4.2 version of fixinc.sh 
during the creation of the cross compiler:

/bin/sh ../../src/gcc/mkinstalldirs /usr/tools/upgrade/gnu/gcc/3.4.2/lib/gcc/spa
rc-sun-solaris2.8/3.4.2/../../../../sparc-sun-solaris2.8
mkdir -p -- /usr/tools/upgrade/gnu/gcc/3.4.2/lib/gcc/sparc-sun-
solaris2.8/3.4.2/../../../../sparc-sun-solaris2.8
gmake[2]: Leaving directory `/net/machine/maketools/sparc-sun-
solaris2.7/tools/cross-3.4.2/gcc/b-sparc-sun-solaris2.8/gcc'
rm -rf include; mkdir include
chmod a+rx include 
(TARGET_MACHINE='sparc-sun-solaris2.8'; srcdir=`cd ../../src/gcc; ${PWDCMD-pwd}
`; \
SHELL='/bin/sh' ;\ 
export TARGET_MACHINE srcdir SHELL ; \
/bin/sh ./fixinc.sh `${PWDCMD-pwd}
`/include /usr/tools/upgrade/gnu/gcc/3.4.2/lib/gcc/sparc-sun-
solaris2.8/3.4.2/../../../../sparc-sun-solaris2.8/sys-include ; \
rm -f include/syslimits.h; \
if [ -f include/limits.h ]; then \
  mv include/limits.h include/syslimits.h; \
else \ 
  cp ../../src/gcc/gsyslimits.h include/syslimits.h; \
fi; \ 
chmod a+r include/syslimits.h)
Fixing headers into /net/machine/maketools/sparc-sun-solaris2.7/tools/cross-
3.4.2/gcc/b-sparc-sun-solaris2.8/gcc/include for sparc-sun-solaris2.8 target
Finding directories and links to directories
 Searching /disk2/releng/tools/upgrade/gnu/gcc/3.4.2/sparc-sun-solaris2.8/sys-
include/.
Making symbolic directory links
Fixing directory /disk2/releng/tools/upgrade/gnu/gcc/3.4.2/sparc-sun-
solaris2.8/sys-include into /net/machine/maketools/sparc-sun-
solaris2.7/tools/cross-3.4.2/gcc/b-sparc-sun-solaris2.8/gcc/include
Applying io_quotes_def            to net/ppp-comp.h
Applying io_quotes_def            to net/pppio.h
Applying io_quotes_use            to net/pppio.h
Applying io_quotes_def            to inet/optcom.h
Applying ip_missing_semi          to netinet/ip.h
Applying sun_auth_proto           to rpc/auth.h
Fixed:  rpc/auth.h 
Applying sun_auth_proto           to rpc/clnt.h
Fixed:  rpc/clnt.h 
Applying sun_auth_proto           to rpc/svc.h
Fixed:  rpc/svc.h 
Applying sun_auth_proto           to rpc/xdr.h
Fixed:  rpc/xdr.h 
Applying io_quotes_def            to sys/pcmcia/pcelx.h
Applying io_quotes_def            to sys/scsi/adapters/glmvar.h
Applying io_quotes_def            to sys/acctctl.h
Applying io_quotes_def            to sys/audio_4231.h
Applying io_quotes_def            to sys/audiovar.h
Applying io_quotes_use            to sys/cs.h
Applying io_quotes_use            to sys/cs_priv.h
Applying io_quotes_def            to sys/fdvar.h
Applying io_quotes_def            to sys/ioccom.h
Applying io_quotes_use            to sys/msreg.h
Fixed:  sys/msreg.h 
Applying io_quotes_def            to sys/pcmcia.h
Applying io_quotes_use            to sys/pcmcia.h
Applying io_quotes_def            to sys/pem.h
Applying io_quotes_use            to sys/pem.h
Applying io_quotes_def            to sys/rce.h
Applying io_quotes_use            to sys/rce.h
Applying svr4_sighandler_type     to sys/signal.h
Fixed:  sys/signal.h 
Applying io_quotes_def            to sys/thread.h
Applying gnu_types                to sys/types.h
Fixed:  sys/types.h
Applying AAB_solaris_sys_varargs_h to sys/varargs.h
Fixed:  sys/varargs.h
Applying svr4__p                  to floatingpoint.h
Fixed:  floatingpoint.h
Applying limits_ifndefs           to limits.h
Fixed:  limits.h
Applying sun_malloc               to malloc.h
Applying math_exception           to math.h
Applying svr4__p                  to math.h
Fixed:  math.h
Applying solaris_mutex_init_2     to pthread.h
Fixed:  pthread.h
Applying gnu_types                to stddef.h
Fixed:  stddef.h
Applying stdio_stdarg_h           to stdio.h
Applying stdio_va_list            to stdio.h
Fixed:  stdio.h
Applying solaris_stdio_tag        to stdio_tag.h
Fixed:  stdio_tag.h 
Applying sysv68_string            to string.h
Cleaning up unneeded directories:
fixincludes is done 
echo timestamp > stmp-fixinc

Notice that stream.h is not listed as a file that is Fixed:  Now lets take a 
look at the output from the 2.95.2 version of fixinc.sh during the creation of 
the cross compiler:

cd ./fixinc; /bin/sh ${srcdir}/mkfixinc.sh sparc-sun-solaris2.8
constructing ../fixinc.sh for sparc-sun-solaris2.8
copying /net/netapp/vol/releng1/releng/maketools/sparc-sun-
solaris2.7/tools/cross/gcc-2.95.2/gcc/fixinc/fixinc.wrap to ../fixinc.sh
rm -rf include; mkdir include
TARGET_MACHINE=sparc-sun-solaris2.8; srcdir=`cd ../../src/gcc; pwd`; \
INSTALL_ASSERT_H=install-assert-h; SHELL=/bin/sh ;\
export TARGET_MACHINE srcdir INSTALL_ASSERT_H SHELL ; \
/bin/sh ./fixinc.sh `pwd`/include /usr/tools/sparc-sun-solaris2.8/sys-include
Building fixed headers in /net/netapp/vol/releng1/releng/maketools/sparc-sun-
solaris2.7/tools/cross/b-sparc-sun-solaris2.8/gcc/include
Checking /usr/tools/sparc-sun-solaris2.8/sys-include/math.h
Fixed math.h
Checking /usr/tools/sparc-sun-solaris2.8/sys-include/sys/stream.h
Fixed sys/stream.h
Checking /usr/tools/sparc-sun-solaris2.8/sys-include/curses.h
Fixed curses.h
rm -f include/syslimits.h
if [ -f include/limits.h ]; then \
  mv include/limits.h include/syslimits.h; \
else \
  cp ../../src/gcc/gsyslimits.h include/syslimits.h; \
fi
chmod a+r include/syslimits.h
if [ "/usr/tools/sparc-sun-solaris2.8/sys-include" = "/usr/tools/sparc-sun-
solaris2.8/sys-include" ] \
   && [ -d /usr/tools/sparc-sun-solaris2.8/sys-include ]; then \
  if [ -d /usr/tools/lib ] ; then true ; else mkdir /usr/tools/lib ; fi; \
  if [ -d /usr/tools/lib/gcc-lib ] ; then true ; else mkdir /usr/tools/lib/gcc-
lib; fi; \
  if [ -d /usr/tools/lib/gcc-lib/sparc-sun-solaris2.8 ] ; then true ; else 
mkdir /usr/tools/lib/gcc-lib/sparc-sun-solaris2.8 ; fi; \
  if [ -d /usr/tools/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2 ] ; then true ; 
else mkdir /usr/tools/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2 ; fi; \
else true; fi
touch stmp-fixinc

It seems that what used to be a standard wrapper for Solaris in 2.95.2 is no 
longer handled well in 3.4.2. I kind of expect another user trying to create a 
cross compiler for Solaris, who wants to use the std::queue class will have an 
issue with this.

-- 
           Summary: No fixinclude for sys/stream.h
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dkavedku at yahoo dot com
                CC: dkavedku at yahoo dot com,gcc-bugs at gcc dot gnu dot
                    org
 GCC build triplet: sparc-sun-solaris2.7
  GCC host triplet: sparc-sun-solaris2.7
GCC target triplet: sparc-sun-solaris2.8


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20399

Reply via email to