From 72547d0f472a769caf0042308d36bb3b26a641e5 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 23 Jul 2020 10:31:07 -0500 Subject: [PATCH] Fix relocation when cross compiling Fixes #3994 --- conda_build/post.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conda_build/post.py b/conda_build/post.py index a105f5af57..97d5fa0f96 100644 --- a/conda_build/post.py +++ b/conda_build/post.py @@ -398,10 +398,6 @@ def osx_ch_link(path, link_dict, host_prefix, build_prefix, files): def mk_relative_osx(path, host_prefix, build_prefix, files, rpaths=('lib',)): - if sys.platform != 'darwin': - log = utils.get_logger(__name__) - log.warn("Found Mach-O file but patching is only supported on macOS, skipping: %s", path) - return prefix = build_prefix if exists(build_prefix) else host_prefix names = macho.otool(path, prefix) s = macho.install_name_change(path, prefix, @@ -1259,6 +1255,10 @@ def post_process_shared_lib(m, f, files, host_prefix=None): mk_relative_linux(f, m.config.host_prefix, rpaths=rpaths, method=m.get_value('build/rpaths_patcher', None)) elif codefile_t == 'machofile': + if m.config.host_platform != 'osx': + log = utils.get_logger(__name__) + log.warn("Found Mach-O file but patching is only supported on macOS, skipping: %s", path) + return mk_relative_osx(path, host_prefix, m.config.build_prefix, files=files, rpaths=rpaths)