2022-10-06 18:32:54 +00:00
|
|
|
From 301b2d82cdbfaffe4dfba1d2cfed068a4115f730 Mon Sep 17 00:00:00 2001
|
2022-06-16 17:23:12 +00:00
|
|
|
From: =?UTF-8?q?Mustafa=20=C3=87al=C4=B1=C5=9Fkan?= <muscaln@protonmail.com>
|
|
|
|
Date: Sat, 30 Apr 2022 16:18:31 +0300
|
|
|
|
Subject: [PATCH 2/3] Add clang header path
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/builder/builtins.go b/builder/builtins.go
|
2022-10-06 18:32:54 +00:00
|
|
|
index 121398fa..a589988b 100644
|
2022-06-16 17:23:12 +00:00
|
|
|
--- a/builder/builtins.go
|
|
|
|
+++ b/builder/builtins.go
|
2022-10-06 18:32:54 +00:00
|
|
|
@@ -170,7 +170,7 @@ var aeabiBuiltins = []string{
|
2022-06-16 17:23:12 +00:00
|
|
|
var CompilerRT = Library{
|
|
|
|
name: "compiler-rt",
|
|
|
|
cflags: func(target, headerPath string) []string {
|
|
|
|
- return []string{"-Werror", "-Wall", "-std=c11", "-nostdlibinc"}
|
|
|
|
+ return []string{"-Werror", "-Wall", "-std=c11", "-isystem", "@clang_include@"}
|
|
|
|
},
|
|
|
|
sourceDir: func() string {
|
|
|
|
llvmDir := filepath.Join(goenv.Get("TINYGOROOT"), "llvm-project/compiler-rt/lib/builtins")
|
|
|
|
diff --git a/builder/picolibc.go b/builder/picolibc.go
|
|
|
|
index f1b061ae..159f90cf 100644
|
|
|
|
--- a/builder/picolibc.go
|
|
|
|
+++ b/builder/picolibc.go
|
|
|
|
@@ -27,7 +27,7 @@ var Picolibc = Library{
|
|
|
|
"-D_COMPILING_NEWLIB",
|
|
|
|
"-DHAVE_ALIAS_ATTRIBUTE",
|
|
|
|
"-DTINY_STDIO",
|
|
|
|
- "-nostdlibinc",
|
|
|
|
+ "-isystem", "@clang_include@",
|
|
|
|
"-isystem", picolibcDir + "/include",
|
|
|
|
"-I" + picolibcDir + "/tinystdio",
|
|
|
|
"-I" + headerPath,
|
|
|
|
diff --git a/compileopts/config.go b/compileopts/config.go
|
2022-10-06 18:32:54 +00:00
|
|
|
index a006b673..3a105b49 100644
|
2022-06-16 17:23:12 +00:00
|
|
|
--- a/compileopts/config.go
|
|
|
|
+++ b/compileopts/config.go
|
2022-10-06 18:32:54 +00:00
|
|
|
@@ -279,6 +279,7 @@ func (c *Config) CFlags() []string {
|
2022-06-16 17:23:12 +00:00
|
|
|
path, _ := c.LibcPath("picolibc")
|
|
|
|
cflags = append(cflags,
|
|
|
|
"--sysroot="+path,
|
|
|
|
+ "-isystem", "@clang_include@",
|
|
|
|
"-isystem", filepath.Join(path, "include"), // necessary for Xtensa
|
|
|
|
"-isystem", filepath.Join(picolibcDir, "include"),
|
|
|
|
"-isystem", filepath.Join(picolibcDir, "tinystdio"),
|
2022-10-06 18:32:54 +00:00
|
|
|
@@ -288,7 +289,6 @@ func (c *Config) CFlags() []string {
|
2022-06-16 17:23:12 +00:00
|
|
|
path, _ := c.LibcPath("musl")
|
|
|
|
arch := MuslArchitecture(c.Triple())
|
|
|
|
cflags = append(cflags,
|
|
|
|
- "-nostdlibinc",
|
|
|
|
"-isystem", filepath.Join(path, "include"),
|
|
|
|
"-isystem", filepath.Join(root, "lib", "musl", "arch", arch),
|
|
|
|
"-isystem", filepath.Join(root, "lib", "musl", "include"),
|
|
|
|
--
|
2022-10-06 18:32:54 +00:00
|
|
|
2.37.2
|
2022-06-16 17:23:12 +00:00
|
|
|
|