Skip to content

build: migrate to the new ELF registration scheme #1330

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
Nov 30, 2017
Merged
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: 4 additions & 7 deletions lib/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ def project_headers_path(self):
return Path.path(Configuration.current.build_directory.path_by_appending(self.name).absolute() + "/" + self.PROJECT_HEADERS_FOLDER_PATH)

class Library(Product):
conformance_begin = ""
conformance_end = ""
runtime_object = ''
rule = None
def __init__(self, name):
Product.__init__(self, name)
Expand All @@ -91,7 +90,7 @@ def generate(self, flags, objects = []):
product_flags += " -lstdc++"

generated += """
build """ + self.product.relative() + """: """ + self.rule + """ """ + self.conformance_begin + """ """ + " ".join(objects) + """ """ + self.conformance_end + """ """ + self.generate_dependencies() + """
build """ + self.product.relative() + """: """ + self.rule + """ """ + self.runtime_object + """ """ + " ".join(objects) + """ """ + self.generate_dependencies() + """
flags = """ + product_flags
if self.needs_objc:
generated += """
Expand Down Expand Up @@ -119,8 +118,7 @@ def generate(self, objects = []):
self.rule = "Link"
self.product_name = Configuration.current.target.dynamic_library_prefix + self.name + Configuration.current.target.dynamic_library_suffix
if Configuration.current.target.sdk == OSType.Linux or Configuration.current.target.sdk == OSType.FreeBSD:
self.conformance_begin = '${SDKROOT}/lib/swift/${OS}/${ARCH}/swift_begin.o'
self.conformance_end = '${SDKROOT}/lib/swift/${OS}/${ARCH}/swift_end.o'
self.runtime_object = '${SDKROOT}/lib/swift/${OS}/${ARCH}/swiftrt.o'
return Library.generate(self, ["-shared", "-Wl,-soname," + self.product_name, "-Wl,--no-undefined"], objects)
else:
return Library.generate(self, ["-shared"], objects)
Expand Down Expand Up @@ -182,8 +180,7 @@ def __init__(self, name):
def generate(self, objects = []):
self.rule = "Archive"
self.product_name = Configuration.current.target.static_library_prefix + self.name + Configuration.current.target.static_library_suffix
self.conformance_begin = ''
self.conformance_end = ''
self.runtime_object = ''
return Library.generate(self, [], objects)

class StaticAndDynamicLibrary(StaticLibrary, DynamicLibrary):
Expand Down