Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-checks RPATH to avoid duplication #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

konn
Copy link

@konn konn commented Aug 3, 2018

On macOS 10.13.6 with GHC 8.4.3, nvvm fails to compile when it is compiled as a dependency for other package:

    [5 of 5] Compiling Foreign.NVVM     ( Foreign/NVVM.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Foreign/NVVM.p_o )
    clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
    clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
    ignoring (possibly broken) abi-depends field for packages
    error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: for: .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/libHSnvvm-0.8.0.3-DgQ0osQbuUpFhmpbs2hbRg-ghc8.4.3.dylib (for architecture x86_64) option "-add_rpath /usr/local/Cellar/llvm-6.0/6.0.0/lib" would duplicate path, file already has LC_RPATH for: /usr/local/Cellar/llvm-6.0/6.0.0/lib

Note that compilation succeeds when nvvm is compiled alone.

To fix this, I added the ad-hoc check that uses otool to extract LC_RPATHs first and excludes existing ones.

@tmcdonell
Copy link
Owner

Hey, thanks for looking into this!

This is a bit strange that you get this problem, I'm also running 10.13 and never ran into it... which version of xcode do you have? any other relevant details of how you built? I am wondering if we need to do a similar thing with the other cuda packages. In fact, because it is trying to add an llvm lib directory, I suspect this might be a problem with your particular setup...

Do we really need to pull in text as a dependency here?

@tmcdonell
Copy link
Owner

(sorry for not getting a chance to look at this sooner, life is crazy right now...)

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.

None yet

2 participants