You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
640 B
26 lines
640 B
// Copyright 2021 The ChromiumOS Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// Add "-static-libgcc" flag to compiler command line unless
|
|
// already specified by user or user has passed "-shared-libgcc".
|
|
func processLibGCCFlags(builder *commandBuilder) {
|
|
fromUser := false
|
|
for _, arg := range builder.args {
|
|
if arg.fromUser && (strings.HasPrefix(arg.value, "-shared-libgcc") ||
|
|
strings.HasPrefix(arg.value, "-static-libgcc")) {
|
|
fromUser = true
|
|
break
|
|
}
|
|
}
|
|
if !fromUser {
|
|
builder.addPreUserArgs("-static-libgcc")
|
|
}
|
|
}
|