Skip to content

Fix various linker paths, variables and dependencies related to architecture specific library paths #16194

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

Closed
wants to merge 2 commits into from

Conversation

lanza
Copy link
Contributor

@lanza lanza commented Apr 26, 2018

On non-Darwin platforms we are now linking against libraries in their
architecture specific sub-directories. (e.g. lib/swift/linux/x86_64).
Fix various paths, variables and dependencies in AddSwift related to
this change as well as removing the lipo functionality from platforms
without fat binaries.

Remove lipo targets for non-MachO binaries

Remove the copying of binaries from their architecture specific paths to
the lipo target's path on platforms that don't have universal binaries.

@lanza
Copy link
Contributor Author

lanza commented Apr 26, 2018

@compnerd and then this goes in on top of the #16191 and https://github.com/apple/swift/pull/15560/files

@jrose-apple
Copy link
Contributor

You'll have to rebase this, since there are conflicts.

@lanza
Copy link
Contributor Author

lanza commented Jul 12, 2018

Yup, sorry, typo'd the branch name while pushing the update.

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does look pretty good. Hopefully I'm not the only one reviewing it, though, because I don't know the significance. Both LLDB and SwiftPM might be depending on the current layout as well (unlikely but possible).

endif()
endif()

# For all other targets we just install the lib at the arch subdirectory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure what this comment is referring to.

set(file_permissions
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The library targets shouldn't need execute permissions, should they?

@@ -195,6 +195,8 @@ class ToolChain {
/// relative to the compiler.
void getRuntimeLibraryPath(SmallVectorImpl<char> &runtimeLibPath,
const llvm::opt::ArgList &args, bool shared) const;
void getRuntimeLibraryPathWithArch(SmallVectorImpl<char> &runtimeLibPath,
const llvm::opt::ArgList &args, bool shared) const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: the indentation is supposed to match the open paren (while wrapping at 80 columns).

@@ -86,6 +86,7 @@ class LLVM_LIBRARY_VISIBILITY GenericUnix : public ToolChain {
GenericUnix(const Driver &D, const llvm::Triple &Triple)
: ToolChain(D, Triple) {}
~GenericUnix() = default;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: this is the only change in this file, so may as well leave it out.

@@ -73,7 +73,7 @@ toolchains::GenericUnix::constructInvocation(const InterpretJobAction &job,
InvocationInfo II = ToolChain::constructInvocation(job, context);

SmallString<128> runtimeLibraryPath;
getRuntimeLibraryPath(runtimeLibraryPath, context.Args,
getRuntimeLibraryPathWithArch(runtimeLibraryPath, context.Args,
/*Shared=*/true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: indentation again.

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 29d49446487d7c0a14389307ea135758e94655fd

@jrose-apple
Copy link
Contributor

@swift-ci Please clean test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 29d49446487d7c0a14389307ea135758e94655fd

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 29d49446487d7c0a14389307ea135758e94655fd

lanza and others added 2 commits July 12, 2018 17:10
…rrect architecture specific path

Adjust the runtimeLibPath for the GenerixUnix toolchain to use the
architecture specific path.

Modify the `runtimeLibraryPath` in CompilerInvocation.cpp to use the
architecture specific version for non-Darwin platforms.

Modify a few tests to agree with these changes.
…tecture specific library paths

On non-Darwin platforms we are now linking against libraries in their
architecture specific sub-directories. (e.g. lib/swift/linux/x86_64).
Fix various paths, variables and dependencies in AddSwift related to
this change as well as removing the lipo functionality from platforms
without fat binaries.

Remove lipo targets for non-MachO binaries

Remove the copying of binaries from their architecture specific paths to
the lipo target's path on platforms that don't have universal binaries.
@lanza
Copy link
Contributor Author

lanza commented Jul 13, 2018

Thanks for the review. compnerd should check this in a few days, but he's on vacation at the moment. I'll follow up with him once he gets back.

@Rostepher
Copy link
Contributor

@swift-ci please clean test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 178dfa9

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 178dfa9

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.

4 participants