This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bootstrapping sparc-sun-solaris2.5.1 - missing rules for some .o files in libio


On Mon, 16 March 1998, 16:49:25, wilson@cygnus.com wrote:

 > 	When it comes time to build libio under libraries/libio, the "ar" step
 > 	fails because several objects never got made.  Rules for these objects
 > 	were missing from the Makefile.
 > 
 > Looking in our mail archives, I see two other reports of this same problem,
 > but no indication of the solution.
 > 
 > One message said that this problem could be worked around by adding the
 > 5 missing *.c files (peekc.c, iogetc.c, ioputc.c, iofeof.c, and ioferror.c)
 > to DEPEND_SOURCES in libio/config.shared.  You could try doing that.
 > 
 > If you could perhaps figure out why this problem is happening for you
 > that would be useful.  We could then document why it is failing.

Yesterday I tried to reproduce this problem. It's definitely caused by 
a bug (at least I'd call it a bug) in Solaris' /usr/ccs/bin/make, but
only in a particular configuration: 

- If ${objdir} is a subdirectory inside ${srcdir} make fails to
  build these particular .o files.

Interestingly enough, it recognizes that these files need to be built
(according to make's -d flag), but simply misses executing the
corresponding commands.

This is what I saw yesterday (and sent to Michael):

OK, I just checked, and it's actually Solaris' make program to blame!
Interestingly though, it only fails with this configuration:

	libstdc++-2.8.1/
			builddir

srcdir == builddir works, and builddir as neighbour directory to srcdir 
works, of course, too.


Look at the output:

$ make all
...
ar rc libio.a filedoalloc.o floatconv.o genops.o fileops.o  iovfprintf.o  iovfscanf.o ioignore.o iopadn.o  iofgetpos.o iofread.o iofscanf.o  iofsetpos.o iogetdelim.o iogetline.o  ioprintf.o ioseekoff.o ioseekpos.o  outfloat.o strops.o iofclose.o iopopen.o ioungetc.o peekc.o iogetc.o  ioputc.o iofeof.o ioferror.o iofdopen.o iofflush.o iofgets.o iofopen.o iofprintf.o iofputs.o iofwrite.o  iogets.o ioperror.o ioputs.o ioscanf.o iosetbuffer.o iosetvbuf.o  iosprintf.o iosscanf.o ioftell.o iovsscanf.o iovsprintf.o ioprims.o iostrerror.o cleanup.o  stdfiles.o
ar: peekc.o: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `libio.a'
Current working directory /local/manfred/work/GNU/libstdc++-2.8.1/sparc-sun-solaris2.5.1/libraries/libio
*** Error code 1
make: Fatal error: Command failed for target `all-target-libio'

Now, the same with GNU make:

$ gmake all
gmake[1]: Entering directory `/local/manfred/work/GNU/libstdc++-2.8.1/sparc-sun-solaris2.5.1/libraries/libio'
test x"yes" != xyes ||\
  gcc -c -g -I. -I../../../libio  `case '-g -g -O2 -fno-implicit-templates' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac` ../../../libio/peekc.c -o pic/peekc.o
gcc -c -g -I. -I../../../libio  ../../../libio/peekc.c
test x"yes" != xyes ||\
  gcc -c -g -I. -I../../../libio  `case '-g -g -O2 -fno-implicit-templates' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac` ../../../libio/iogetc.c -o pic/iogetc.o
gcc -c -g -I. -I../../../libio  ../../../libio/iogetc.c
test x"yes" != xyes ||\
  gcc -c -g -I. -I../../../libio  `case '-g -g -O2 -fno-implicit-templates' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac` ../../../libio/ioputc.c -o pic/ioputc.o
gcc -c -g -I. -I../../../libio  ../../../libio/ioputc.c
test x"yes" != xyes ||\
  gcc -c -g -I. -I../../../libio  `case '-g -g -O2 -fno-implicit-templates' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac` ../../../libio/iofeof.c -o pic/iofeof.o
gcc -c -g -I. -I../../../libio  ../../../libio/iofeof.c
test x"yes" != xyes ||\
  gcc -c -g -I. -I../../../libio  `case '-g -g -O2 -fno-implicit-templates' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac` ../../../libio/ioferror.c -o pic/ioferror.o
gcc -c -g -I. -I../../../libio  ../../../libio/ioferror.c
rm -rf libio.a
ar rc libio.a filedoalloc.o floatconv.o genops.o fileops.o iovfprintf.o iovfscanf.o ioignore.o iopadn.o iofgetpos.o iofread.o iofscanf.o iofsetpos.o iogetdelim.o iogetline.o ioprintf.o ioseekoff.o ioseekpos.o outfloat.o strops.o iofclose.o iopopen.o ioungetc.o peekc.o iogetc.o ioputc.o iofeof.o ioferror.o iofdopen.o iofflush.o iofgets.o iofopen.o iofprintf.o iofputs.o iofwrite.o iogets.o ioperror.o ioputs.o ioscanf.o iosetbuffer.o iosetvbuf.o iosprintf.o iosscanf.o ioftell.o iovsscanf.o iovsprintf.o ioprims.o iostrerror.o cleanup.o stdfiles.o
true libio.a

Note, GNU make detects, there are some .o files missing and builds
them accordingly.

Perhaps, we need to add a statement like `Building libstdc++ on
Solaris strongly discourages use of the Solaris make program as this
fails to build libio correctly under certain circumstances; use GNU
make instead!' to the INSTALL file.

As a rule of thumb we now know:

1. Always use GNU make.
2. Always build GNU packages with srcdir and builddir being neighbour
   directories!

Hope this helps

manfred


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]