Eric Botcazou <ebotca...@adacore.com> writes:

> This finally converts the Ada front-end.
>
> Tested on x86_64-suse-linux, applied on the mainline.
>
>
> 2013-10-13  Nicolas Roche  <ro...@adacore.com>
>             Eric Botcazou  <ebotca...@adacore.com>
>
>       * gcc-interface/Make-lang.in (ada/%.o): Replace individual rules with
>       generic rule and add $(POSTCOMPILE).
>       (ADA_DEPS): New.
>       (.adb.o): Add @$(ADA_DEPS).
>       (.ads.o): Likewise.
>       (ada/a-except.o): Likewise.
>       (ada/s-excdeb.): Likewise.
>       (ada/s-assert.o): Likewise.
>       (ada/a-tags.o): Likewise.
>       (ada_generated_files): New variable.
>       Use them as dependency order for GNAT1_ADA_OBJS and GNATBIND_OBJS.
>       (ADA_DEPFILES): New variable.
>       Include them.
>       (ada_OBJS): Define.

This patch broke Solaris Ada bootstrap with SHELL=/bin/ksh on Solaris 10
and 11:

gcc -c -g   -gnatpg -gnatwns -gnata -W -Wall -nostdinc -I- -I. -Iada 
-I/vol/gcc/src/hg/trunk/local/gcc/ada 
-I/vol/gcc/src/hg/trunk/local/gcc/ada/gcc-interface 
/vol/gcc/src/hg/trunk/local/gcc/ada/ada.ads -o ada/ada.o
sed: -e expression #1, char 1: unterminated `s' command
ada/ada.o: 
/bin/ksh: ^D:  not found
/bin/ksh: ada/1:  not found
/bin/ksh: : cannot execute
/bin/ksh: gp | tr -d '\015' | tr '\n' ' ':  not found
make: *** [ada/ada.o] Error 127

If you have make print the commands in ADA_DEPS, you see

case ada/ada.o in *sdefault.o);; *)a="`echo ada/ada.o | sed -e 's/.o$/.ali/'`"; 
echo "ada/ada.o: `cat $a | sed -ne "s;^D \([a-z0-9_\.-]*\).*;ada/\1;gp" | tr -d 
'\015' | tr '\n' ' '`" > ada//.deps/ada.Po;; esac;

So this boils down to

case ada/ada.o in
  *sdefault.o)
    ;;
  *)
    a="`echo ada/ada.o | sed -e 's/.o$/.ali/'`"; \
    echo "ada/ada.o: `cat $a | sed -ne "s;^D \([a-z0-9_\.-]*\).*;ada/\1;gp" | 
tr -d '\015' | tr '\n' ' '`" > ada//.deps/ada.Po
    ;;
esac;

Obviously /bin/ksh (both the old ksh88 in Solaris 10 and ksh93 in
Solaris 11) interpret the echo line as

echo "ada/ada.o: `cat $a | sed -ne "s;
^D \([a-z0-9_\.-]*\).*;
ada/\1;
gp" | tr -d '\015' | tr '\n' ' '`" > ada//.deps/ada.Po

The following trivial patch avoids this and allows the
i386-pc-solaris2.1[01] and sparc-sun-solaris2.11 bootstraps to finish.

Ok for mainline?

        Rainer


2013-10-23  Rainer Orth  <r...@cebitec.uni-bielefeld.de>

        * gcc-interface/Make-lang.in (ADA_DEPS): Fix quoting.

diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -110,7 +110,7 @@ ADA_DEPS=case $@ in \
             *sdefault.o);; \
             *)a="`echo $@ | sed -e 's/.o$$/.ali/'`"; \
                 echo "$@: `cat $$a | \
-                sed -ne "s;^D \([a-z0-9_\.-]*\).*;ada/\1;gp" | \
+                sed -ne 's;^D \([a-z0-9_\.-]*\).*;ada/\1;gp' | \
                 tr -d '\015' | tr '\n' ' '`" > $(dir $@)/$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $@));; \
          esac;
 
-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to