blink icon indicating copy to clipboard operation
blink copied to clipboard

Compilation problem on NetBSD

Open 0-wiz-0 opened this issue 2 years ago • 4 comments

I tried building blink on NetBSD-10.99.2/amd64, but it failed with:

In file included from /usr/include/sys/signal.h:112,
                 from /usr/include/signal.h:45,
                 from blink/blinkenlights.c:24:
./blink/linux.h:461:6: error: expected ':', ',', ';', '}' or '__attribute__' before '.' token
  461 |   u8 si_signo[4];
      |      ^~~~~~~~

I suspect because sys/siginfo.h has:

#define si_signo        _info._signo

0-wiz-0 avatar Jan 10 '23 00:01 0-wiz-0

Thanks for reporting this. We shouldn't be using the si_ field name prefixes in our Linux structs. I'll push a change that updates this for si_signo and all the other ones too, which should avoid this potentially happening on other platforms too.

jart avatar Jan 19 '23 07:01 jart

Thanks for looking at this. The symbol I reported this for, si_signo, has not been changed by the commit, and the build still fails on NetBSD.

0-wiz-0 avatar Jan 22 '23 10:01 0-wiz-0

I fixed all the build errors on NetBSD using my SDF shell. I'm having trouble getting Blink to fully pass tests though. The system is returning weird errors like EPERM when calling mprotect().

jart avatar Mar 06 '23 01:03 jart

Thanks. I don't know what exactly blink is doing, but NetBSD by default enables PaX MPROTECT, so pages can not be mapped writable and executable at the same time. If you need this, take a look at the official way but please note that there currently is a bug - second link includes a workaround. Does that help? If not, can you describe what you are doing?

0-wiz-0 avatar Mar 06 '23 07:03 0-wiz-0