Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/Driver/UnixToolChains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,15 @@ toolchains::GenericUnix::constructInvocation(const DynamicLinkJobAction &job,
SmallString<128> SharedResourceDirPath;
getResourceDirPath(SharedResourceDirPath, context.Args, /*Shared=*/true);

bool embeddedEnabled = false;
for (const Arg *A : context.Args.filtered(options::OPT_enable_experimental_feature)) {
StringRef value = A->getValue();
if (value == "Embedded") {
embeddedEnabled = true;
break;
}
}

SmallString<128> swiftrtPath = SharedResourceDirPath;
llvm::sys::path::append(swiftrtPath,
swift::getMajorArchitectureName(getTriple()));
Expand Down Expand Up @@ -341,6 +350,8 @@ toolchains::GenericUnix::constructInvocation(const DynamicLinkJobAction &job,
llvm::sys::path::append(linkFilePath, "static-executable-args.lnk");
} else if (staticStdlib) {
llvm::sys::path::append(linkFilePath, "static-stdlib-args.lnk");
} else if (embeddedEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to fix SwiftDriver in a similar way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea; I have a patch for that almost ready

Copy link
Contributor Author

Choose a reason for hiding this comment

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

linkFilePath.clear();
} else {
linkFilePath.clear();
Arguments.push_back("-lswiftCore");
Expand Down
3 changes: 3 additions & 0 deletions stdlib/public/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ if(SWIFT_BUILD_STDLIB)

set(EMBEDDED_STDLIB_TARGET_TRIPLES
# arch module_name target triple
"armv6 armv6-none-none-eabi armv6-none-none-eabi"
"armv7 armv7-none-none-eabi armv7-none-none-eabi"
"armv6 armv6-apple-none-macho armv6-apple-none-macho"
"armv7 armv7-apple-none-macho armv7-apple-none-macho"
"arm64 arm64-apple-none-macho arm64-apple-none-macho"
"x86_64 x86_64-apple-macos x86_64-apple-macos10.13"
Expand Down
1 change: 1 addition & 0 deletions utils/swift_build_support/swift_build_support/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ class StdlibDeploymentTarget(object):
# to build the stdlib as standalone and/or statically linked.
Freestanding = Platform("freestanding", archs=[
"i386", "x86_64",
"armv6", "armv6m",
"armv7", "armv7s", "armv7k", "armv7m", "armv7em",
"arm64", "arm64e", "arm64_32"])

Expand Down