<div dir="ltr">I propose a diff for a clean compilation<br><br>$ diff -u /home/andu/otp_src_19.1/erts/emulator/sys/unix/sys.c.orig /home/andu/otp_src_19.1/erts/emulator/sys/unix/sys.c      <br>--- /home/andu/otp_src_19.1/erts/emulator/sys/unix/sys.c.orig   Mon Sep 26 12:59:49 2016<br>+++ /home/andu/otp_src_19.1/erts/emulator/sys/unix/sys.c        Mon Sep 26 13:00:19 2016<br>@@ -715,13 +715,13 @@<br> static RETSIGTYPE suspend_signal(int signum)<br> #endif<br> {<br>-    int res, buf[1], __errno = errno;<br>+    int res, buf[1], errno_tmp = errno;<br>     do {<br>         res = read(sig_suspend_fds[0], buf, sizeof(int));<br>     } while (res < 0 && errno == EINTR);<br> <br>     /* restore previous errno in case read changed it */<br>-    errno = __errno;<br>+    errno = errno_tmp;<br> }<br> #endif /* #ifdef ERTS_SYS_SUSPEND_SIGNAL */<br><br><br>On Monday, September 26, 2016 at 12:31:28 PM UTC+3, Bogdan Andu wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr"><div><div><div><div>Hi,<br><br></div><div>after applying patches from port/lang/erlang/19/patches<br></div>otp 19.1 fails to compile on OpenBSD 5.7/amd64 with error:<br><pre><span>....................<br>CC     obj/x86_64-unknown-openbsd5.7/<wbr>opt/smp/sys.o<br>sys/unix/sys.c: In function 'suspend_signal':<br>sys/unix/sys.c:718: error: called object '__errno' is not a function<br>sys/unix/sys.c:721: error: called object '__errno' is not a function<br>sys/unix/sys.c:724: error: called object '__errno' is not a function<br>x86_64-unknown-openbsd5.7/<wbr>Makefile:677: recipe for target 'obj/x86_64-unknown-openbsd5.<wbr>7/opt/smp/sys.o' failed<br>gmake[3]: *** [obj/x86_64-unknown-openbsd5.<wbr>7/opt/smp/sys.o] Error 1<br>gmake[3]: Leaving directory '/home/andu/otp_src_19.1/erts/<wbr>emulator'<br>/home/andu/otp_src_19.1/make/<a href="http://run_make.mk:35" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frun_make.mk%3A35\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHXtlFXky6p4zkbQ5Guyznoq-7Yjg';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frun_make.mk%3A35\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHXtlFXky6p4zkbQ5Guyznoq-7Yjg';return true;">r<wbr>un_make.mk:35</a>: recipe for target 'opt' failed<br>gmake[2]: *** [opt] Error 2<br>gmake[2]: Leaving directory '/home/andu/otp_src_19.1/erts/<wbr>emulator'<br>Makefile:61: recipe for target 'smp' failed<br>gmake[1]: *** [smp] Error 2<br>gmake[1]: Leaving directory '/home/andu/otp_src_19.1/erts'<br>Makefile:444: recipe for target 'emulator' failed<br>gmake: *** [emulator] Error 2<br><br></span></pre><pre><span>becsuse in OpenBSD __errno is a function, see: /usr/include/signal.h<br></span></pre>$ gcc -v<br>Reading specs from /usr/lib/gcc-lib/amd64-<wbr>unknown-openbsd5.7/4.2.1/specs<br>Target: amd64-unknown-openbsd5.7<br>Configured with: OpenBSD/amd64 system compiler<br>Thread model: posix<br>gcc version 4.2.1 20070719<br><br>$ diff -u /home/andu/otp_src_19.0/erts/<wbr>emulator/sys/unix/sys.c /home/andu/otp_src_19.1/erts/<wbr>emulator/sys/unix/sys.c<br>--- /home/andu/otp_src_19.0/erts/<wbr>emulator/sys/unix/sys.c        Tue Jun 21 21:55:58 2016<br>+++ /home/andu/otp_src_19.1/erts/<wbr>emulator/sys/unix/sys.c        Tue Sep 20 22:11:23 2016<br>@@ -715,11 +715,13 @@<br> static RETSIGTYPE suspend_signal(int signum)<br> #endif<br> {<br>-   int res;<br>-   int buf[1];<br>-   do {<br>-     res = read(sig_suspend_fds[0], buf, sizeof(int));<br>-   } while (res < 0 && errno == EINTR);<br>+    int res, buf[1], __errno = errno;<br>+    do {<br>+        res = read(sig_suspend_fds[0], buf, sizeof(int));<br>+    } while (res < 0 && errno == EINTR);<br>+<br>+    /* restore previous errno in case read changed it */<br>+    errno = __errno;<br> }<br> #endif /* #ifdef ERTS_SYS_SUSPEND_SIGNAL */<br><br></div>In opt 19.1 is introduced this variable (__errno) which in OpenBSD is a function.<br><br><br></div>Regards,<br></div>/Bogdan<br></div>
</blockquote></div>