@@ -3,7 +3,6 @@ package builder
33import (
44 "os"
55 "path/filepath"
6- "strings"
76
87 "github.com/tinygo-org/tinygo/goenv"
98)
@@ -25,16 +24,13 @@ var libPicolibc = Library{
2524 "-Werror" ,
2625 "-Wall" ,
2726 "-std=gnu11" ,
28- "-D_COMPILING_NEWLIB" ,
29- "-D_HAVE_ALIAS_ATTRIBUTE" ,
3027 "-D__TINY_STDIO" ,
3128 "-D_XOPEN_SOURCE=700" ,
32- "-DPOSIX_IO" ,
3329 "-D__IO_DEFAULT='i'" , // use __i_vfprintf and __i_vfscanf by default
3430 "-D__IEEE_LIBM" ,
3531 "-D__OBSOLETE_MATH_FLOAT=1" , // use old math code that doesn't expect a FPU
3632 "-D__OBSOLETE_MATH_DOUBLE=0" ,
37- "-D_WANT_IO_C99_FORMATS " ,
33+ "-D__IO_C99_FORMATS " ,
3834 "-D__PICOLIBC_ERRNO_FUNCTION=__errno_location" ,
3935 "-nostdlibinc" ,
4036 "-isystem" , picolibcDir + "/libc/include" ,
@@ -46,17 +42,7 @@ var libPicolibc = Library{
4642 },
4743 sourceDir : func () string { return filepath .Join (goenv .Get ("TINYGOROOT" ), "lib/picolibc" ) },
4844 librarySources : func (target string , _ bool ) ([]string , error ) {
49- sources := append ([]string (nil ), picolibcSources ... )
50- if ! strings .HasPrefix (target , "avr" ) {
51- // Small chips without long jumps can't compile many files (printf,
52- // pow, etc). Therefore exclude those source files for those chips.
53- // Unfortunately it's difficult to exclude only some chips, so this
54- // excludes those files on all AVR chips for now.
55- // More information:
56- // https://github.com/llvm/llvm-project/issues/67042
57- sources = append (sources , picolibcSourcesLarge ... )
58- }
59- return sources , nil
45+ return append ([]string (nil ), picolibcSources ... ), nil
6046 },
6147}
6248
@@ -165,10 +151,7 @@ var picolibcSources = []string{
165151 "libc/string/wmempcpy.c" ,
166152 "libc/string/wmemset.c" ,
167153 "libc/string/xpg_strerror_r.c" ,
168- }
169154
170- // Parts of picolibc that are too large for small AVRs.
171- var picolibcSourcesLarge = []string {
172155 // srcs_stdio
173156 "libc/stdio/asprintf.c" ,
174157 "libc/stdio/bufio.c" ,
0 commit comments