-
Notifications
You must be signed in to change notification settings - Fork 125
Force linker to lld on amazon linux 2. #892
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
Force linker to lld on amazon linux 2. #892
Conversation
There is a bug in the gold linker on amazon linux 2 See: https://sourceware.org/bugzilla/show_bug.cgi?id=23016 It is triggered when linking relocatable objects built with LLVM based compilers. * Add gear to detect the os distribution and version * For amazon linux 2 force ALTERNATE_LINKER to lld
* Add a series of tests for checking distribution logic.
08ff7c4 to
97a028f
Compare
|
@swift-ci test |
Previously was getting the computed property multiple times which would reparse files in the filesystem takeing time. Get the propertry once.
…ectly. Tests were reimplementing the parsing, which is not of much value. Call the detectHostLinuxDistribution() function directly to exercise the parsing logic. Add a way to pass in a filesystem so we can pass the mocked filesystem.
jakepetroules
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this looks great! Just some minor formatting feedback.
| let osReleasePath = Path("/etc/os-release") | ||
| if fs.exists(osReleasePath) { | ||
| if let osReleaseData = try? fs.read(osReleasePath), | ||
| let osRelease = String(data: Data(osReleaseData.bytes), encoding: .utf8) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: prefer the stdlib constructor instead of the Foundation one:
| let osRelease = String(data: Data(osReleaseData.bytes), encoding: .utf8) { | |
| let osRelease = String(decoding: Data(osReleaseData.bytes), as: UTF8.self) { |
| #expect(distribution == nil) | ||
| } | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: files should end with newlines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, can you please fix this before merging? #893 adds some validations
|
@swift-ci test |
d75a53d to
19f6a31
Compare
Mocked filesystem does not work properly with paths like /etc/os-release. No point in running them on Windows
19f6a31 to
2da727f
Compare
|
@swift-ci test |
There is a bug in the gold linker on amazon linux 2
See: https://sourceware.org/bugzilla/show_bug.cgi?id=23016
It is triggered when linking relocatable objects built with LLVM based compilers.