Skip to content

Conversation

@noahness
Copy link

@noahness noahness commented Mar 3, 2020

Workaround distutils bug 36353; see https://bugs.python.org/issue36353. On MacOS, the build_ext --rpath option is getting converted to -L rather than -Wl,-rpath=. This change sub-classes build_ext and correctly passes appropriate rpath options to clang linker.

Snippet from distutils.unixccompiler.py:

  compiler = os.path.basename(sysconfig.get_config_var("CC"))
        if sys.platform[:6] == "darwin":
            # MacOSX's linker doesn't understand the -R flag at all
            return "-L" + dir
        elif sys.platform[:7] == "freebsd":
            return "-Wl,-rpath=" + dir
        elif sys.platform[:5] == "hp-ux":
            if self._is_gcc(compiler):
                return ["-Wl,+s", "-L" + dir]
            return ["+s", "-L" + dir]

Workaround code taken from python/cpython#12418.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant