Skip to content

Commit 6a1e783

Browse files
committed
Merge pull request #50 from hpux735/gold
Fixes to enable swift section objects
2 parents 3d09338 + c78d9f6 commit 6a1e783

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

build_script.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,17 @@ def main():
8181
action="store_true",
8282
dest="test",
8383
default=False)
84+
parser.add_argument("--arch",
85+
help="target architecture",
86+
action="store",
87+
dest="arch",
88+
default=None)
8489
args = parser.parse_args()
8590

8691
swiftc = os.path.abspath(args.swiftc)
8792
build_dir = os.path.abspath(args.build_dir)
8893
swift_build_dir = os.path.abspath(args.swift_build_dir)
94+
arch = args.arch
8995

9096
if not os.path.exists(build_dir):
9197
run("mkdir -p {}".format(build_dir))
@@ -112,7 +118,7 @@ def main():
112118
run("{0} -c {1} -emit-object {2} -module-name XCTest -parse-as-library -emit-module "
113119
"-emit-module-path {3}/XCTest.swiftmodule -o {3}/XCTest.o -force-single-frontend-invocation "
114120
"-module-link-name XCTest".format(swiftc, style_options, " ".join(sourcePaths), build_dir))
115-
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))
121+
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))
116122

117123
# If we were given an install directive, perform installation
118124
if args.module_path is not None and args.lib_path is not None:

0 commit comments

Comments
 (0)