https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100096

            Bug ID: 100096
           Summary: libgccjit.so.0: Cannot write-enable text segment:
                    Permission denied on NetBSD 9.1
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: jit
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: swi...@sha-bang.de
  Target Milestone: ---

On NetBSD 9.1 i386 the Hello World example from
https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html
fails with:

% ./tut01-hello-world
/usr/local/lib/libgccjit.so.0: text relocations
/usr/local/lib/libgccjit.so.0: Cannot write-enable text segment: Permission
denied

when security.pax.mprotect.global is enabled, which is the default on the
system.
When disabelin global memory protection (as root) with:

sysctl -w security.pax.mprotect.global=0

The example works (still emitting a warning:

% ./tut01-hello-world
/usr/local/lib/libgccjit.so.0: text relocations
hello world

Turning of security.pax.mprotect.global shouldn't be required for libgccjit
to work.

Also the warning "/usr/local/lib/libgccjit.so.0: text relocations" should
be prevented if possible.

Reply via email to