public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/40984]  New: Build failure in oscons stage not detected.
@ 2009-08-06 11:17 davek at gcc dot gnu dot org
  2009-10-03 11:33 ` [Bug ada/40984] " sam at gcc dot gnu dot org
  2009-10-03 12:23 ` davek at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: davek at gcc dot gnu dot org @ 2009-08-06 11:17 UTC (permalink / raw)
  To: gcc-bugs

In the build log pasted below, there is a failure when running "make oscons" in
$objdir/$target/libada, which is not detected, and the build process continues:

> Checking multilib configuration for libada...
> mkdir -p -- i686-pc-cygwin/libada
> Configuring in i686-pc-cygwin/libada
  [ ... snip ... ]
> updating cache ./config.cache
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: executing default-1 commands
> Adding multilib support to Makefile in /gnu/gcc/gcc-patched/libada
> multidirs=
> with_multisubdir=
> make[2]: Entering directory `/gnu/gcc/obj-patched-gnat5/i686-pc-cygwin/libada'
> make -C ../.././gcc "MAKEOVERRIDES=" "LDFLAGS=" "LN_S=ln -s" "SHELL=/bin/sh" "GNATLIBFLAGS=-W -Wall -gnatpg " "GNATLIBCFLAGS=-g -O2 " "TARGET_LIBGCC2_CFLAGS=" "THREAD_KIND=native" "TRACE=no" "MULTISUBDIR=" "libsubdir=/opt/gcc-tools/lib/gcc/i686-pc-cygwin/4.5.0" "objext=.o" "prefix=/opt/gcc-tools" "exeext=.exeext.should.not.be.used " 'CC=the.host.compiler.should.not.be.needed' "GCC_FOR_TARGET=/gnu/gcc/obj-patched-gnat5/./gcc/xgcc -B/gnu/gcc/obj-patched-gnat5/./gcc/ -B/opt/gcc-tools/i686-pc-cygwin/bin/ -B/opt/gcc-tools/i686-pc-cygwin/lib/ -isystem /opt/gcc-tools/i686-pc-cygwin/include -isystem /opt/gcc-tools/i686-pc-cygwin/sys-include   " "CFLAGS=-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes" ada/s-oscons.ads
> make[3]: Entering directory `/gnu/gcc/obj-patched-gnat5/gcc'
> mkdir -p ada/bldtools/oscons
> rm -f ada/bldtools/oscons/s-oscons-tmplt.c ada/bldtools/oscons/gsocket.h ada/bldtools/oscons/xoscons.adb ada/bldtools/oscons/xutil.ads ada/bldtools/oscons/xutil.adb
> cp -p /gnu/gcc/gcc-patched/gcc/ada/s-oscons-tmplt.c /gnu/gcc/gcc-patched/gcc/ada/gsocket.h /gnu/gcc/gcc-patched/gcc/ada/xoscons.adb /gnu/gcc/gcc-patched/gcc/ada/xutil.ads /gnu/gcc/gcc-patched/gcc/ada/xutil.adb ada/bldtools/oscons
> (cd ada/bldtools/oscons ; gnatmake -q xoscons ; \
> 		rm -f s-oscons-tmplt.i s-oscons-tmplt.s ; \
> 		`echo "/gnu/gcc/obj-patched-gnat5/./gcc/xgcc -B/gnu/gcc/obj-patched-gnat5/./gcc/ -B/opt/gcc-tools/i686-pc-cygwin/bin/ -B/opt/gcc-tools/i686-pc-cygwin/lib/ -isystem /opt/gcc-tools/i686-pc-cygwin/include -isystem /opt/gcc-tools/i686-pc-cygwin/sys-include   " | sed -e 's^\./xgcc^../../../xgcc^' -e 's^-B./^-B../../../^'` -g -O2  -E -C -DTARGET=\"i686-pc-cygwin\" s-oscons-tmplt.c > s-oscons-tmplt.i ; \
> 		`echo "/gnu/gcc/obj-patched-gnat5/./gcc/xgcc -B/gnu/gcc/obj-patched-gnat5/./gcc/ -B/opt/gcc-tools/i686-pc-cygwin/bin/ -B/opt/gcc-tools/i686-pc-cygwin/lib/ -isystem /opt/gcc-tools/i686-pc-cygwin/include -isystem /opt/gcc-tools/i686-pc-cygwin/sys-include   " | sed -e 's^\./xgcc^../../../xgcc^' -e 's^-B./^-B../../../^'` -S s-oscons-tmplt.i ; \
> 		./xoscons ; \
> 		rm -f ../../s-oscons.ads ; \
> 		cp -p s-oscons.ads s-oscons.h ../../)
> s-oscons-tmplt.c: In function 'main':
> s-oscons-tmplt.c:1273:98: error: 'WSASYSNOTREADY' undeclared (first use in this function)
> s-oscons-tmplt.c:1273:98: error: (Each undeclared identifier is reported only once
> s-oscons-tmplt.c:1273:98: error: for each function it appears in.)
> s-oscons-tmplt.c:1274:107: error: 'WSAVERNOTSUPPORTED' undeclared (first use in this function)
> s-oscons-tmplt.c:1275:108: error: 'WSANOTINITIALISED' undeclared (first use in this function)
> s-oscons-tmplt.c:1276:90: error: 'WSAEDISCON' undeclared (first use in this function)
> make[3]: Leaving directory `/gnu/gcc/obj-patched-gnat5/gcc'
> test -f stamp-libada || \
> 	make -C ../.././gcc/ada "MAKEOVERRIDES=" "LDFLAGS=" "LN_S=ln -s" "SHELL=/bin/sh" "GNATLIBFLAGS=-W -Wall -gnatpg " "GNATLIBCFLAGS=-g -O2 " "TARGET_LIBGCC2_CFLAGS=" "THREAD_KIND=native" "TRACE=no" "MULTISUBDIR=" "libsubdir=/opt/gcc-tools/lib/gcc/i686-pc-cygwin/4.5.0" "objext=.o" "prefix=/opt/gcc-tools" "exeext=.exeext.should.not.be.used " 'CC=the.host.compiler.should.not.be.needed' "GCC_FOR_TARGET=/gnu/gcc/obj-patched-gnat5/./gcc/xgcc -B/gnu/gcc/obj-patched-gnat5/./gcc/ -B/opt/gcc-tools/i686-pc-cygwin/bin/ -B/opt/gcc-tools/i686-pc-cygwin/lib/ -isystem /opt/gcc-tools/i686-pc-cygwin/include -isystem /opt/gcc-tools/i686-pc-cygwin/sys-include   " "CFLAGS=-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes" gnatlib-shared \
> 	&& touch stamp-libada
> make[3]: Entering directory `/gnu/gcc/obj-patched-gnat5/gcc/ada'
> make  \
>              GNATLIBFLAGS="-W -Wall -gnatpg " \
> 	     GNATLIBCFLAGS="-g -O2 " \
> 	     MULTISUBDIR="" \
> 	     THREAD_KIND="native" \
> 	     TARGET_LIBGCC2_CFLAGS="" \
>              gnatlib-shared-win32

The build carries on regardless until some time later, when the
malformed/partial s-oscons.ads is finally referenced, while compiling
g-socket.ads in $objdir/gcc/ada/rts:

> /gnu/gcc/obj-patched-gnat5/./gcc/xgcc -B/gnu/gcc/obj-patched-gnat5/./gcc/ -B/opt/gcc-tools/i686-pc-cygwin/bin/ -B/opt/gcc-tools/i686-pc-cygwin/lib/ -isystem /opt/gcc-tools/i686-pc-cygwin/include -isystem /opt/gcc-tools/i686-pc-cygwin/sys-include    -c -g -O2    -W -Wall -gnatpg   g-soccon.ads -o g-soccon.o
> g-socket.ads:432:46: "SIZEOF_tv_sec" not declared in "OS_Constants"
> g-socket.ads:434:53: expected type "Standard.Duration"
> g-socket.ads:434:53: found type universal integer
> g-socket.ads:1134:58: "SIZEOF_fd_set" not declared in "OS_Constants"
> s-oscons.ads:48:01: (style) multiple blank lines
> s-oscons.ads:53:01: (style) multiple blank lines
> s-oscons.ads:58:01: (style) multiple blank lines
> s-oscons.ads:63:01: (style) multiple blank lines
> s-oscons.ads:68:01: (style) multiple blank lines
> s-oscons.ads:75:01: (style) multiple blank lines
> s-oscons.ads:80:01: (style) multiple blank lines
> s-oscons.ads:85:01: (style) multiple blank lines
> s-oscons.ads:90:01: (style) multiple blank lines
> s-oscons.ads:95:01: (style) multiple blank lines
> s-oscons.ads:100:01: (style) multiple blank lines
> s-oscons.ads:111:01: (style) multiple blank lines
> s-oscons.ads:132:01: (style) multiple blank lines
> make[6]: *** [g-soccon.o] Error 1
> make[6]: Leaving directory `/gnu/gcc/obj-patched-gnat5/gcc/ada/rts'
> make[5]: *** [gnatlib] Error 2
> make[5]: Leaving directory `/gnu/gcc/obj-patched-gnat5/gcc/ada'
> make[4]: *** [gnatlib-shared-win32] Error 2
> make[4]: Leaving directory `/gnu/gcc/obj-patched-gnat5/gcc/ada'
> make[3]: *** [gnatlib-shared] Error 2
> make[3]: Leaving directory `/gnu/gcc/obj-patched-gnat5/gcc/ada'
> make[2]: *** [gnatlib-shared] Error 2
> make[2]: Leaving directory `/gnu/gcc/obj-patched-gnat5/i686-pc-cygwin/libada'
> make[1]: *** [all-target-libada] Error 2
> make[1]: Leaving directory `/gnu/gcc/obj-patched-gnat5'
> make: *** [all] Error 2

At a first glance, I think this is happening because 'oscons' is a .PHONY
target in libada/Makefile.in, and there is no stamp or other sentinel to make
sure the sub-make succeeded.  The sub-make doesn't pass an error back because
the error occurs in the middle of a long shell pipeline at the end of which is
a command "$(CP) s-oscons.ads s-oscons.h ../../" that succeeds because xoscons
still generates a fragmentary s-oscons.ads despite there being an error.

Either xoscons should delete its output in case of an error, or the Makefile
rule:

$(ADA_GEN_SUBDIR)/s-oscons.ads : $(ADA_GEN_SUBDIR)/s-oscons-tmplt.c
$(ADA_GEN_SUBDIR)/gsocket.h $(ADA_GEN_SUBDIR)/xoscons.adb
$(ADA_GEN_SUBDIR)/xutil.ads $(ADA_GEN_SUBDIR)/xutil.adb
        -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/oscons
        $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/oscons/,$(notdir $^))
        $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/oscons
        (cd $(ADA_GEN_SUBDIR)/bldtools/oscons ; gnatmake -q xoscons ; \
                $(RM) s-oscons-tmplt.i s-oscons-tmplt.s ; \
                $(OSCONS_CPP) ; \
                $(OSCONS_EXTRACT) ; \
                ./xoscons ; \
                $(RM) ../../s-oscons.ads ; \
                $(CP) s-oscons.ads s-oscons.h ../../)


should be changed something along the lines (untested):

$(ADA_GEN_SUBDIR)/s-oscons.ads : $(ADA_GEN_SUBDIR)/s-oscons-tmplt.c
$(ADA_GEN_SUBDIR)/gsocket.h $(ADA_GEN_SUBDIR)/xoscons.adb
$(ADA_GEN_SUBDIR)/xutil.ads $(ADA_GEN_SUBDIR)/xutil.adb
        -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/oscons
        $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/oscons/,$(notdir $^))
        $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/oscons
        (cd $(ADA_GEN_SUBDIR)/bldtools/oscons ; gnatmake -q xoscons ; \
                $(RM) s-oscons-tmplt.i s-oscons-tmplt.s ; \
                $(OSCONS_CPP) ; \
                $(OSCONS_EXTRACT) ; \
                ./xoscons || $(RM) s-oscons.ads ; \
                $(RM) ../../s-oscons.ads ; \
                $(CP) s-oscons.ads s-oscons.h ../../)

... which would hopefully let the copy (and as a result the entire sub-make)
fail.


-- 
           Summary: Build failure in oscons stage not detected.
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davek at gcc dot gnu dot org
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/40984] Build failure in oscons stage not detected.
  2009-08-06 11:17 [Bug ada/40984] New: Build failure in oscons stage not detected davek at gcc dot gnu dot org
@ 2009-10-03 11:33 ` sam at gcc dot gnu dot org
  2009-10-03 12:23 ` davek at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: sam at gcc dot gnu dot org @ 2009-10-03 11:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from sam at gcc dot gnu dot org  2009-10-03 11:32 -------
Wouldn't it be enough to replace ";" by "&&" between the various steps?


-- 

sam at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sam at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/40984] Build failure in oscons stage not detected.
  2009-08-06 11:17 [Bug ada/40984] New: Build failure in oscons stage not detected davek at gcc dot gnu dot org
  2009-10-03 11:33 ` [Bug ada/40984] " sam at gcc dot gnu dot org
@ 2009-10-03 12:23 ` davek at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: davek at gcc dot gnu dot org @ 2009-10-03 12:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from davek at gcc dot gnu dot org  2009-10-03 12:23 -------
(In reply to comment #1)
> Wouldn't it be enough to replace ";" by "&&" between the various steps?
> 

Hello Sam, the problem with just doing that is that xoscons can fail but still
leave fragmentary output, and then next time you build make sees that the
output file exists and doesn't try rebuilding it.  Using && would cause make to
fail at the error, but we still need to guarantee the partial output file is
deleted, otherwise the next build will not try rebuilding the xoscons outputs
and will error some time later when it reuses the fragmentary output while
attempting to compile the runtime library.


-- 


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-03 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-06 11:17 [Bug ada/40984] New: Build failure in oscons stage not detected davek at gcc dot gnu dot org
2009-10-03 11:33 ` [Bug ada/40984] " sam at gcc dot gnu dot org
2009-10-03 12:23 ` davek at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).