diff options
author | Ayke van Laethem <[email protected]> | 2021-12-09 02:52:08 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-01-09 11:04:10 +0100 |
commit | ebd4969cde351cdc31eb142f14dd4c1ce1352de1 (patch) | |
tree | 1e15d66126a03d1d5183b6d94f03c0b5608c9913 /compileopts/config.go | |
parent | 32a7b8cc4e78799c6447064b9f5576c7f16c4f88 (diff) | |
download | tinygo-ebd4969cde351cdc31eb142f14dd4c1ce1352de1.tar.gz tinygo-ebd4969cde351cdc31eb142f14dd4c1ce1352de1.zip |
all: switch to LLVM 13
This adds support for building with `-tags=llvm13` and switches to LLVM
13 for tinygo binaries that are statically linked against LLVM.
Some notes on this commit:
* Added `-mfloat-abi=soft` to all Cortex-M targets because otherwise
nrfx would complain that floating point was enabled on Cortex-M0.
That's not the case, but with `-mfloat-abi=soft` the `__SOFTFP__`
macro is defined which silences this warning.
See: https://reviews.llvm.org/D100372
* Changed from `--sysroot=<root>` to `-nostdlib -isystem <root>` for
musl because with Clang 13, even with `--sysroot` some system
libraries are used which we don't want.
* Changed all `-Xclang -internal-isystem -Xclang` to simply
`-isystem`, for consistency with the above change. It appears to
have the same effect.
* Moved WebAssembly function declarations to the top of the file in
task_asyncify_wasm.S because (apparently) the assembler has become
more strict.
Diffstat (limited to 'compileopts/config.go')
-rw-r--r-- | compileopts/config.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/compileopts/config.go b/compileopts/config.go index d0c5a47c5..c8660f1c8 100644 --- a/compileopts/config.go +++ b/compileopts/config.go @@ -257,17 +257,18 @@ func (c *Config) CFlags() []string { path, _ := c.LibcPath("picolibc") cflags = append(cflags, "--sysroot="+path, - "-Xclang", "-internal-isystem", "-Xclang", filepath.Join(picolibcDir, "include"), - "-Xclang", "-internal-isystem", "-Xclang", filepath.Join(picolibcDir, "tinystdio"), + "-isystem", filepath.Join(picolibcDir, "include"), + "-isystem", filepath.Join(picolibcDir, "tinystdio"), ) case "musl": root := goenv.Get("TINYGOROOT") path, _ := c.LibcPath("musl") arch := MuslArchitecture(c.Triple()) cflags = append(cflags, - "--sysroot="+path, - "-Xclang", "-internal-isystem", "-Xclang", filepath.Join(root, "lib", "musl", "arch", arch), - "-Xclang", "-internal-isystem", "-Xclang", filepath.Join(root, "lib", "musl", "include"), + "-nostdlibinc", + "-isystem", filepath.Join(path, "include"), + "-isystem", filepath.Join(root, "lib", "musl", "arch", arch), + "-isystem", filepath.Join(root, "lib", "musl", "include"), ) case "wasi-libc": root := goenv.Get("TINYGOROOT") @@ -277,8 +278,8 @@ func (c *Config) CFlags() []string { path, _ := c.LibcPath("mingw-w64") cflags = append(cflags, "--sysroot="+path, - "-Xclang", "-internal-isystem", "-Xclang", filepath.Join(root, "lib", "mingw-w64", "mingw-w64-headers", "crt"), - "-Xclang", "-internal-isystem", "-Xclang", filepath.Join(root, "lib", "mingw-w64", "mingw-w64-headers", "defaults", "include"), + "-isystem", filepath.Join(root, "lib", "mingw-w64", "mingw-w64-headers", "crt"), + "-isystem", filepath.Join(root, "lib", "mingw-w64", "mingw-w64-headers", "defaults", "include"), "-D_UCRT", ) case "": |