Skip to content

Add required flags for using the new SwiftOnoneSupport library #266

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 25, 2016

Conversation

swiftix
Copy link
Contributor

@swiftix swiftix commented Feb 25, 2016

This is a PR related to the following PR: swiftlang/swift#1429
They should be merged in sync, otherwise foundation builds will fail after the mentioned PR is merged.

@swiftix swiftix force-pushed the wip-prespecializations-module branch from 03b405a to 5be5be5 Compare February 25, 2016 20:02
foundation.LDFLAGS += ' -lswiftSwiftOnoneSupport '
# In the future, remove the LDFLAGS line above and enable
# the optimizations. But currently, it results in a segmentation
# fault on one of the tests.
Copy link
Contributor

Choose a reason for hiding this comment

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

if this causes a segfault in one of the tests and it is currently working that probably means there is an expectation failure that is not met in your library:

it is worth noting the lines below are incorrect and should not be modified at that point:

from lib/script.py:111

        if Configuration.current.build_mode == Configuration.Debug:
            swift_flags += "-g -Onone "
        elif Configuration.current.build_mode == Configuration.Release:
            swift_flags += "-O "

that modification runs just fine without your changes; can you get me the crash point by attaching lldb?

cd swift-corelibs-foundation
ninja test
LD_LIBRARY_PATH=../build/Ninja-ReleaseAssert/foundation-linux-x86_64/Foundation/:/home/phausler/Public/build/Ninja-ReleaseAssert/xctest-linux-x86_64 ../build/Ninja-ReleaseAssert/lldb-linux-x86_64/bin/lldb ../build/Ninja-ReleaseAssert/foundation-linux-x86_64/TestFoundation/TestFoundation

presuming you built as release mode in the standard layouts

@swiftix
Copy link
Contributor Author

swiftix commented Feb 25, 2016

@phausler Actually, I was wrong. There is no crash anymore. Looks like I fixed it on the Swift side after I tested yesterday. Which means, that we can enable -O for Release, if we want. Or we can continue with foundation.LDFLAGS += ' -lswiftSwiftOnoneSupport '. It is up to you what you prefer for foundation.

@swiftix
Copy link
Contributor Author

swiftix commented Feb 25, 2016

Let me know if you want me to submit the corresponding PR or if you want to commit this one-liner yourself.

@phausler
Copy link
Contributor

I will change the -O for release mode in a follow up

@swiftix
Copy link
Contributor Author

swiftix commented Feb 25, 2016

OK. Should I then just remove the Release related part altogether and have only the change for LDFLAGS in Debug mode?

@swiftix
Copy link
Contributor Author

swiftix commented Feb 25, 2016

Or should I remove the comment about -O which is obsolete by now.

@phausler
Copy link
Contributor

as soon as the corresponding swift commit is merged I will merge this and push corrections for the release builds

@swiftix
Copy link
Contributor Author

swiftix commented Feb 25, 2016

OK. Understood. I'm about to merge the Swift commit now.

@swiftix
Copy link
Contributor Author

swiftix commented Feb 25, 2016

Done.

phausler added a commit that referenced this pull request Feb 25, 2016
Add required flags for using the new SwiftOnoneSupport library
@phausler phausler merged commit 8263fa1 into swiftlang:master Feb 25, 2016
@swiftix
Copy link
Contributor Author

swiftix commented Feb 25, 2016

With your -O commit, you probably want to remove the
Configuration.current.build_mode == Configuration.Release: block from the build script. It is not needed in -O builds. If you leave it there, it may result in SwiftOnoneSupport being linked and referred even though it is not used by an app or a dylib.

But let's first see that everything builds fine. Once everything is fine, we can remove this if-statement.

@swiftix
Copy link
Contributor Author

swiftix commented Feb 26, 2016

@phausler Thanks for your support!

atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
[5.3] [build-script] Remove hard-coded install prefix of /usr and pass it in instead
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.

2 participants