File: openbsd.py

package info (click to toggle)
pypy 7.0.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 107,216 kB
  • sloc: python: 1,201,787; ansic: 62,419; asm: 5,169; cpp: 3,017; sh: 2,534; makefile: 545; xml: 243; lisp: 45; awk: 4
file content (29 lines) | stat: -rw-r--r-- 1,106 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Support for OpenBSD."""

import os

from rpython.translator.platform.bsd import BSD

class OpenBSD(BSD):
    DEFAULT_CC = "cc"
    name = "openbsd"

    link_flags = os.environ.get("LDFLAGS", "").split() + ['-pthread']
    cflags = ['-O3', '-pthread', '-fomit-frame-pointer', '-D_BSD_SOURCE'
             ] + os.environ.get("CFLAGS", "").split()

    def _libs(self, libraries):
        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',)