Skip to content

Conversation

@mundaym
Copy link
Contributor

@mundaym mundaym commented Aug 6, 2019

Some of the tests link against libBlocksRuntime so it appears to
be a requirement. With this package installed the tests pass for
me (Ubuntu 18.04 LTS on x86_64).

This StackOverflow link shows the same issue on Ubuntu 14.04:
https://stackoverflow.com/questions/36479498/is-llvm-compiler-rt-installed-on-my-ubuntu-14-04

Some of the tests link against libBlocksRuntime so it appears to be a requirement. With this package installed the tests pass for me (Ubuntu 18.04 LTS on x86_64). This StackOverflow link shows the same issue on Ubuntu 14.04: https://stackoverflow.com/questions/36479498/is-llvm-compiler-rt-installed-on-my-ubuntu-14-04
@mundaym
Copy link
Contributor Author

mundaym commented Aug 6, 2019

@swift-ci Please smoke test.

@compnerd
Copy link
Member

compnerd commented Aug 6, 2019

The tests create a stub blocks runtime for the tests. We also have BlocksRuntime that we build and run against in lib dispatch. I don't think that this is the right thing to do.

@mundaym
Copy link
Contributor Author

mundaym commented Aug 7, 2019

Is this a bug then? Because we definitely do link against the system libBlocksRuntime currently, and if it is not installed then the tests fail on Ubuntu (@ version 18.04 at least). Who would know?

@compnerd
Copy link
Member

compnerd commented Aug 7, 2019

Yes, that is a bug. We should be linking against the blocks runtime that we "import" from lib dispatch (https://github.com/apple/swift/blob/master/CMakeLists.txt#L1036-L1044). I probably would, since I set this up quite a while ago.

@compnerd
Copy link
Member

compnerd commented Aug 7, 2019

Oh, I bet, I know what it is - a missing -rpath in the test binaries which does not setup the library search path to the libdispatch, since CMake will setup the paths appropriately for linking via absolute paths given that it is a proper target (even though it is imported). Two ways to fix this:

  1. copy libBlocksRuntime.so from libdispatch (get_target_properties(BlocksRuntime_LOCATION BlocksRuntime IMPORTED_LOCATION)) into the test directory
  2. adjust lit.cfg to add the necessary -rpath to the linker invocation.

I think that the second option is nicer as it should be simpler overall.

@mundaym mundaym closed this Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants