Author: Laurence Tratt <lau...@tratt.net>
Branch: 
Changeset: r91362:008c6f3a2f8f
Date: 2017-05-22 15:18 +0200
http://bitbucket.org/pypy/pypy/changeset/008c6f3a2f8f/

Log:    Build main binaries on OpenBSD with wxallowed.

        On RPython, JIT compilers that need to read and write to the same
        page need to be marked as wxallowed (unless they've been buit to
        cope with this restriction). Previously, this meant specifying
        LDFLAGS in the environment before building an RPython VM which I
        always forgot to do. This commit automatically marks the final
        binary as wxallowed without any such annoyances.

diff --git a/rpython/translator/platform/openbsd.py 
b/rpython/translator/platform/openbsd.py
--- a/rpython/translator/platform/openbsd.py
+++ b/rpython/translator/platform/openbsd.py
@@ -16,5 +16,14 @@
         libraries=set(libraries + ("intl", "iconv"))
         return ['-l%s' % lib for lib in libraries if lib not in ["crypt", 
"dl", "rt"]]
 
+    def makefile_link_flags(self):
+        # On OpenBSD, we need to build the final binary with the link flags
+        # below. However, if we modify self.link_flags to include these, the
+        # various platform check binaries that RPython builds end up with these
+        # flags: since these binaries are generally located on /tmp -- which
+        # isn't a wxallowed file system -- that gives rise to "permission
+        # denied" errors, which kill the build.
+        return list(self.link_flags) + ["-Wl,-z,wxneeded"]
+
 class OpenBSD_64(OpenBSD):
     shared_only = ('-fPIC',)
diff --git a/rpython/translator/platform/posix.py 
b/rpython/translator/platform/posix.py
--- a/rpython/translator/platform/posix.py
+++ b/rpython/translator/platform/posix.py
@@ -98,6 +98,9 @@
     def get_shared_only_compile_flags(self):
         return tuple(self.shared_only) + ('-fvisibility=hidden',)
 
+    def makefile_link_flags(self):
+        return list(self.link_flags)
+
     def gen_makefile(self, cfiles, eci, exe_name=None, path=None,
                      shared=False, headers_to_precompile=[],
                      no_precompile_cfiles = [], config=None):
@@ -113,7 +116,7 @@
         else:
             exe_name = exe_name.new(ext=self.exe_ext)
 
-        linkflags = list(self.link_flags)
+        linkflags = self.makefile_link_flags()
         if shared:
             linkflags = self._args_for_shared(linkflags)
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to