Update dependencies (#1813)

This commit is contained in:
Wim
2022-04-25 23:50:10 +02:00
committed by GitHub
parent 2fca3c7563
commit 67adad3e08
288 changed files with 266038 additions and 3755 deletions

2
vendor/modernc.org/cc/v3/Makefile generated vendored
View File

@@ -70,8 +70,10 @@ build_all_targets:
GOOS=linux GOARCH=riscv64 go build -v ./...
GOOS=linux GOARCH=s390x go build -v ./...
GOOS=netbsd GOARCH=amd64 go build -v ./...
GOOS=openbsd GOARCH=amd64 go build -v ./...
GOOS=windows GOARCH=386 go build -v ./...
GOOS=windows GOARCH=amd64 go build -v ./...
GOOS=windows GOARCH=arm64 go build -v ./...
devbench:
date 2>&1 | tee log-devbench

View File

@@ -29,6 +29,7 @@ var (
{"openbsd", "amd64"}: true,
{"windows", "386"}: true,
{"windows", "amd64"}: true,
{"windows", "arm64"}: true,
}
)
@@ -213,6 +214,29 @@ var abiTypes = map[[2]string]map[Kind]ABIType{
Decimal64: {8, 8, 8},
Decimal128: {16, 16, 16},
},
// clang version 14.0.0 (https://github.com/llvm/llvm-project.git 329fda39c507e8740978d10458451dcdb21563be)
// Target: aarch64-w64-windows-gnu
{"windows", "arm64"}: {
Void: {1, 1, 1},
Bool: {1, 1, 1},
Char: {1, 1, 1},
SChar: {1, 1, 1},
UChar: {1, 1, 1},
Short: {2, 2, 2},
UShort: {2, 2, 2},
Enum: {4, 4, 4},
Int: {4, 4, 4},
UInt: {4, 4, 4},
Long: {4, 4, 4},
ULong: {4, 4, 4},
LongLong: {8, 8, 8},
ULongLong: {8, 8, 8},
Ptr: {8, 8, 8},
Function: {8, 8, 8},
Float: {4, 4, 4},
Double: {8, 8, 8},
LongDouble: {8, 8, 8},
},
// $ i686-w64-mingw32-gcc main.c && wine a.exe
{"windows", "386"}: {
Void: {1, 1, 1},

76
vendor/modernc.org/cc/v3/cc.go generated vendored
View File

@@ -792,6 +792,14 @@ func (c *context) openFile(name string, sys bool) (io.ReadCloser, error) {
// Execution of HostConfig is not free, so caching of the results is
// recommended.
func HostConfig(cpp string, opts ...string) (predefined string, includePaths, sysIncludePaths []string, err error) {
if predefined, includePaths, sysIncludePaths, err = hostConfigv3(cpp, opts...); err == nil {
return predefined, includePaths, sysIncludePaths, nil
}
return hostConfigv4(opts)
}
func hostConfigv3(cpp string, opts ...string) (predefined string, includePaths, sysIncludePaths []string, err error) {
if cpp == "" {
cpp = "cpp"
}
@@ -843,6 +851,74 @@ func HostConfig(cpp string, opts ...string) (predefined string, includePaths, sy
return "", nil, nil, fmt.Errorf("failed parsing %s -v output", cpp)
}
func hostConfigv4(opts []string) (predefined string, includePaths, sysIncludePaths []string, err error) {
for _, cc := range []string{os.Getenv("CC"), "cc", "gcc"} {
if cc == "" {
continue
}
cc, err = exec.LookPath(cc)
if err != nil {
continue
}
args := append(opts, "-dM", "-E", "-")
pre, err := exec.Command(cc, args...).CombinedOutput()
if err != nil {
continue
}
sep := "\n"
if env("GOOS", runtime.GOOS) == "windows" {
sep = "\r\n"
}
a := strings.Split(string(pre), sep)
w := 0
for _, v := range a {
if strings.HasPrefix(v, "#") {
a[w] = v
w++
}
}
predefined = strings.Join(a[:w], "\n")
args = append(opts, "-v", "-E", "-")
out, err := exec.Command(cc, args...).CombinedOutput()
if err != nil {
continue
}
a = strings.Split(string(out), sep)
for i := 0; i < len(a); {
switch a[i] {
case "#include \"...\" search starts here:":
loop:
for i = i + 1; i < len(a); {
switch v := a[i]; {
case strings.HasPrefix(v, "#") || v == "End of search list.":
break loop
default:
includePaths = append(includePaths, strings.TrimSpace(v))
i++
}
}
case "#include <...> search starts here:":
for i = i + 1; i < len(a); {
switch v := a[i]; {
case strings.HasPrefix(v, "#") || v == "End of search list.":
return predefined, includePaths, sysIncludePaths, nil
default:
sysIncludePaths = append(sysIncludePaths, strings.TrimSpace(v))
i++
}
}
default:
i++
}
}
}
return "", nil, nil, fmt.Errorf("cannot determine C compiler configuration")
}
func env(key, val string) string {
if s := os.Getenv(key); s != "" {
return s