File tree 1 file changed +13
-12
lines changed
1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -111,22 +111,23 @@ ToolChain::InvocationInfo toolchains::GenericUnix::constructInvocation(
111
111
return II;
112
112
}
113
113
// Amazon Linux 2023 requires lld as the default linker.
114
- std::string toolchains::GenericUnix::getDefaultLinker () const {
115
- if ( getTriple (). isOSLinux ()) {
116
- std::ifstream file ( " /etc/os-release " ) ;
117
- std::string line;
118
-
119
- while ( std::getline (file, line) ) {
120
- if (line.substr (0 , 12 ) == " PRETTY_NAME= " ) {
121
- if (line. substr ( 12 ) == " \" Amazon Linux 2023 \" " ) {
122
- file. close () ;
123
- return " lld " ;
114
+ bool isAmazonLinux2023Host () {
115
+ std::ifstream file ( " /etc/os-release " );
116
+ std::string line ;
117
+
118
+ while ( std::getline (file, line)) {
119
+ if (line. substr ( 0 , 12 ) == " PRETTY_NAME= " ) {
120
+ if (line.substr (12 ) == " \" Amazon Linux 2023 \" " ) {
121
+ file. close ();
122
+ return true ;
123
+ }
124
124
}
125
125
}
126
+ return false ;
126
127
}
127
- }
128
128
129
- if (getTriple ().isAndroid ())
129
+ std::string toolchains::GenericUnix::getDefaultLinker () const {
130
+ if (getTriple ().isAndroid () || isAmazonLinux2023Host ())
130
131
return " lld" ;
131
132
132
133
switch (getTriple ().getArch ()) {
You can’t perform that action at this time.
0 commit comments