Skip to content

Fixes to enable swift section objects #50

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

Merged
merged 1 commit into from
Feb 18, 2016
Merged

Fixes to enable swift section objects #50

merged 1 commit into from
Feb 18, 2016

Conversation

hpux735
Copy link
Contributor

@hpux735 hpux735 commented Feb 18, 2016

This change enables xctest to continue to function once the swift sections changes are applied. This pull should not be applied prior to that change, and should be pulled at that time.

swiftlang/swift#1157

@gribozavr @tienex

@@ -112,7 +118,7 @@ def main():
run("{0} -c {1} -emit-object {2} -module-name XCTest -parse-as-library -emit-module "
"-emit-module-path {3}/XCTest.swiftmodule -o {3}/XCTest.o -force-single-frontend-invocation "
"-module-link-name XCTest".format(swiftc, style_options, " ".join(sourcePaths), build_dir))
run("clang {0}/XCTest.o -shared -o {0}/libXCTest.so -Wl,--no-undefined -Wl,-soname,libXCTest.so -L{1}/lib/swift/linux/ -lswiftGlibc -lswiftCore -lm".format(build_dir, swift_build_dir))
run("clang {1}/lib/swift/linux/{2}/swift_begin.o {0}/XCTest.o {1}/lib/swift/linux/{2}/swift_end.o -shared -o {0}/libXCTest.so -Wl,--no-undefined -Wl,-soname,libXCTest.so -L{1}/lib/swift/linux/ -lswiftGlibc -lswiftCore -lm".format(build_dir, swift_build_dir, arch))
Copy link
Contributor

Choose a reason for hiding this comment

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

Fantastic. Thanks, @hpux735! 💯

Personally I've been meaning to reformat this convoluted string interpolation to use identifiers--something like the following:

run('clang {swift_build_dir}/lib/swift/linux/{arch}/swift_begin.o '
    '{build_dir}/XCTest.o '
    '{swift_build_dir}/lib/swift/linux/{arch}/swift_end.o '
    '-shared -o {build_dir}/libXCTest.so '
    '-Wl,--no-undefined -Wl,-soname,libXCTest.so '
    '-L{swift_build_dir}/lib/swift/linux/ '
    '-lswiftGlibc -lswiftCore -lm'.format(
        build_dir=build_dir,
        swift_build_dir=swift_build_dir,
        arch=arch))

Doing so makes it a little easier for me to follow what's going on. I can take care of that at a later time--I think this is fine for now!

@gribozavr
Copy link
Contributor

@hpux735 @modocache Sorry, I need to merge this PR to keep builds correct. Could you submit fixes for @modocache's comments as a separate PR?

gribozavr added a commit that referenced this pull request Feb 18, 2016
Fixes to enable swift section objects
@gribozavr gribozavr merged commit 6a1e783 into swiftlang:master Feb 18, 2016
@modocache
Copy link
Contributor

Makes sense, thanks @gribozavr! I've addressed my comments in #51. Thanks again, @hpux735! 👍

modocache added a commit to modocache/swift-corelibs-xctest that referenced this pull request Feb 18, 2016
@hpux735 hpux735 deleted the gold branch February 18, 2016 18:29
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.

3 participants