Skip to content

Adapt QNX support to the introduction of LINKER_DRIVER #398

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions Sources/SWBCore/Settings/BuiltinMacros.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2683,6 +2683,7 @@ public enum LinkerDriverChoice: String, Equatable, Hashable, EnumerationMacroTyp

case clang
case swiftc
case qcc
}

/// Enumeration macro type for the value of the `INFOPLIST_KEY_LSApplicationCategoryType` build setting.
Expand Down
4 changes: 4 additions & 0 deletions Sources/SWBCore/SpecImplementations/ProductTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ public class ProductTypeSpec : Spec, SpecType, @unchecked Sendable {
args += ["-compatibility_version", compatibilityVersion]
case .swiftc:
args += ["-Xlinker", "-compatibility_version", "-Xlinker", compatibilityVersion]
case .qcc:
break
}
}

Expand All @@ -285,6 +287,8 @@ public class ProductTypeSpec : Spec, SpecType, @unchecked Sendable {
args += ["-current_version", currentVersion]
case .swiftc:
args += ["-Xlinker", "-current_version", "-Xlinker", currentVersion]
case .qcc:
break
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ public final class LdLinkerSpec : GenericLinkerSpec, SpecIdentifierType, @unchec
return cbc.producer.hostOperatingSystem.imageFormat.executableName(basename: "clang")
case .swiftc:
return cbc.producer.hostOperatingSystem.imageFormat.executableName(basename: "swiftc")
case .qcc:
return cbc.producer.hostOperatingSystem.imageFormat.executableName(basename: "qcc")
}
}

Expand Down
2 changes: 2 additions & 0 deletions Sources/SWBQNXPlatform/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ struct QNXSDKRegistryExtension: SDKRegistryExtension {

"ARCH_NAME_x86_64": .plString("x86_64"),
"ARCH_NAME_aarch64": .plString("aarch64le"),

"LINKER_DRIVER": "qcc",
]

return [(qnxSdk.sysroot, qnxPlatform, [
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBUniversalPlatform/Specs/Ld.xcspec
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
{
Name = "LD_OPTIMIZATION_LEVEL";
Type = String;
Condition = "$(LINKER_DRIVER) == clang";
Condition = "$(LINKER_DRIVER) == clang || $(LINKER_DRIVER) == qcc";
DefaultValue = "$(GCC_OPTIMIZATION_LEVEL)";
"CommandLinePrefixFlag" = "-O";
},
Expand Down