Skip to content

Commit 557c7e5

Browse files
committed
Merge pull request #249 from hpux735/gold
Companion PR to Swift #1157 and 32-bit bug fixes
2 parents dc4fa2d + 965fc62 commit 557c7e5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

build.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616
if Configuration.current.target.sdk == OSType.Linux:
1717
foundation.CFLAGS = '-DDEPLOYMENT_TARGET_LINUX -D_GNU_SOURCE '
18-
foundation.LDFLAGS = '-Wl,@./CoreFoundation/linux.ld -Xlinker -T ${SDKROOT}/lib/swift/linux/${ARCH}/swift.ld -lswiftGlibc `icu-config --ldflags` -Wl,-defsym,__CFConstantStringClassReference=_TMC10Foundation19_NSCFConstantString -Wl,-Bsymbolic '
19-
18+
foundation.LDFLAGS = '${SWIFT_USE_LINKER} -Wl,@./CoreFoundation/linux.ld -lswiftGlibc `icu-config --ldflags` -Wl,-defsym,__CFConstantStringClassReference=_TMC10Foundation19_NSCFConstantString -Wl,-Bsymbolic '
2019
elif Configuration.current.target.sdk == OSType.FreeBSD:
2120
foundation.CFLAGS = '-DDEPLOYMENT_TARGET_FREEBSD -I/usr/local/include -I/usr/local/include/libxml2 '
2221
foundation.LDFLAGS = ''

lib/product.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def project_headers_path(self):
7171
return Path.path(Configuration.current.build_directory.path_by_appending(self.name).absolute() + "/" + self.PROJECT_HEADERS_FOLDER_PATH)
7272

7373
class Library(Product):
74+
conformance_begin = ""
75+
conformance_end = ""
7476
rule = None
7577
def __init__(self, name):
7678
Product.__init__(self, name)
@@ -88,7 +90,7 @@ def generate(self, flags):
8890
product_flags += " -lstdc++"
8991

9092
generated += """
91-
build """ + self.product.relative() + """: """ + self.rule + """ """ + " ".join(objects) + self.generate_dependencies() + """
93+
build """ + self.product.relative() + """: """ + self.rule + """ """ + self.conformance_begin + """ """ + " ".join(objects) + """ """ + self.conformance_end + """ """ + self.generate_dependencies() + """
9294
flags = """ + product_flags
9395
if self.needs_objc:
9496
generated += """
@@ -114,7 +116,9 @@ def __init__(self, name):
114116
self.product_name = Configuration.current.target.dynamic_library_prefix + name + Configuration.current.target.dynamic_library_suffix
115117

116118
def generate(self):
117-
if Configuration.current.target.sdk == OSType.Linux:
119+
if Configuration.current.target.sdk == OSType.Linux or Configuration.current.target.sdk == OSType.FreeBSD:
120+
self.conformance_begin = '${SDKROOT}/lib/swift/linux/${ARCH}/swift_begin.o'
121+
self.conformance_end = '${SDKROOT}/lib/swift/linux/${ARCH}/swift_end.o'
118122
return Library.generate(self, ["-shared", "-Wl,-soname," + self.product_name, "-Wl,--no-undefined"])
119123
else:
120124
return Library.generate(self, ["-shared"])

0 commit comments

Comments
 (0)