-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Object formats #3137
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
Object formats #3137
Conversation
gold only supports ELF. This adds two new helper functions (is_windows_based_sdk and is_elfish_sdk) to ensure that we dont try to use gold on non-ELF targets. This comes up when trying to setup cross-compilation for the standard library for Windows. The ELF check is implemented as the negation of Darwin (which uses MachO) and Windows (which uses COFF). The reason for this is that there are additional targets which also use ELF. Rather than enumerating the larger set, enumerate the smaller set (windows) and use the negation.
@@ -103,8 +102,7 @@ add_swift_library(section_magic_end OBJECT_LIBRARY IS_STDLIB IS_STDLIB_CORE | |||
|
|||
set(object_target_list) | |||
foreach(sdk ${SWIFT_CONFIGURED_SDKS}) | |||
is_elfish_sdk("${sdk}" IS_ELFISH) | |||
if(IS_ELFISH) | |||
if("${SWIFT_SDK_${sdk}_OBJECT_FORMAT}" STREQUAL "ELF") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just loop ${ELFISH_SDKS}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because that would be smart and why I had put EFLISH_SDKS into the top level scope. I knew I had forgotten some part of the change. Thanks for pointing that out.
Cygwin calls |
I think that this will only cause a problem with cross-compiling on a Linux host for cygwin or if you try to use the gold linker on cygwin. I guess in the |
Simplify the ELF checks based on review comments from Dimitri Gribenko.
@swift-ci Please test and merge |
What's in this pull request?
Resolved bug number: (SR-)
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
Validation Testing
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.