omniti-labs / omnios-build

Build system for OmniOS - Note, this is a quasi-private archive for OmniTI, you probably want https://omniosce.org
Other
39 stars 136 forks source link

zsh signals (trap) broken when built with gcc51 #63

Closed lotheac closed 9 years ago

lotheac commented 9 years ago
bash# zsh -l
/etc/zprofile:trap:27: undefined signal: 3
/etc/zprofile:trap:67: undefined signal: 3
zsh# trap 'echo FOO' INT
trap: undefined signal: INT

This is due to the fact that gcc -E output has changed (more linemarkers in 5.1). 4.8.1:

% echo 'sigint=SIGINT' | /opt/gcc-4.8.1/bin/gcc -include signal.h -E -| tail -5 
#165 "/usr/include/signal.h" 3 4
extern int sigwait(sigset_t *);
#1 "<command-line>" 2
#1 "<stdin>"
sigint=2

vs. gcc 5.1.0:

% echo 'sigint=SIGINT' | /opt/gcc-5.1.0/bin/gcc -include signal.h -E -| tail -5

#1 "<stdin>"
sigint=
#1 "<stdin>" 3 4
      2

and zsh does some awk magic with cpp output. This has been fixed in zsh-5.0.8 (34287 in zsh ChangeLog), so you should probably update all gcc51-built releases to at least that version or newer, or apply zsh.git commits c7aa6443907ddd97b6b1e8729ce9c897de0d244c and 9f9a16f43c5c66d3a764ef2abaacca6a3d91f89c.