Hi Kyrylo,

>> OK once you get a confirmation that this avoids the problems seen on those 
>> platforms.
>
> Thanks. Iain, Rainer, did you get a chance to try it out?

I did: Mac OS X 10.13 bootstrap is fine now.  I've also tried on Solaris
11.4, even with /usr/bin before /usr/gnu/bin in PATH which I don't
normally do.  This had no issues even without this patch.

>> It does look like you've got an extraneous ':' below (and in the other copy 
>> a bit later)
>>> + trap ':; rm -f "$$compare_makefile" "$$bad_compare" \
>>> +   "$$bad_compare".*' 0; \
>> Or is that : doing something non-obvious here?
>
>
> The old trap was st=$?; rm -f ...; trap - 0; exit $st. It re-raised the exit 
> status. The patch deletes that because trap - 0 and $? are both broken on 
> Solaris 10 /bin/sh.
>
> Deleting it makes the recipe depend on the pending status surviving the trap. 
> bash before 3.1, run as sh -c, does not preserve it when the trap body is a 
> single external command: the shell exits with rm's status, so exit 1 becomes 
> exit 0.
>
> :; makes the body two commands, which restores that. It is the Autoconf 
> manual's documented workaround:
> ("Limitations of Shell Builtins", trap): "older implementations of bash 
> failed to preserve $? across an exit trap consisting of a single cleanup 
> command". make runs every recipe as $(SHELL) -c, and the new trap body is one 
> external command, so this is that case exactly. Removing the : reintroduces 
> the silent-success bug the patch fixes.

If this is only for the benefit of the ancient Solaris 10 /bin/sh, it's
not actually necessary: while Solaris 10 /bin/sh is the original Bourne
shell, Solaris 11.0 switched /bin/sh to ksh93 15 years ago, and GCC
trunk only supports Solaris 11.4.

I don't mind keeping it, though.

Thanks for the patch.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to