Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use libc from newlib #1752

Merged
merged 6 commits into from
Jun 23, 2016
Merged

Use libc from newlib #1752

merged 6 commits into from
Jun 23, 2016

Conversation

igrr
Copy link
Member

@igrr igrr commented Mar 11, 2016

This pull request attempts to replace all the libc replacements we had in our project with... newlib libc.

We add libc_orig.a, which comes from OS X-built toolchain, and use it to generate libcmin.a.
New shell script (tools/sdk/lib/make_libcmin.sh) has a list of all objects from libcmin.a which should be added. The ones which are to be removed are commented out. This makes it quite easy to add/remove object files as we find cases when newlib implementations do not fit the bill.

All heap management functions are removed, and hooks are added so that newlib functions use global umm_malloc instead. There is no real reentrancy support anyway.

Benefits of this change include support for sscanf, strftime, and other functions which were missing.

Potentially we can make fopen/fclose functions hook into SPIFFS, so that plain C libraries can run on ESP8266 with access to file system.

@igrr igrr mentioned this pull request Mar 11, 2016
@igrr
Copy link
Member Author

igrr commented Mar 11, 2016

Output to stdout is not properly redirected to Serial yet.

@igrr
Copy link
Member Author

igrr commented Mar 11, 2016

Note: might make sense to switch to newlib 2.2.0 from @projectgus
https://github.com/projectgus/newlib-xtensa

@benjamind
Copy link

Any progress on this? Would be a huge help with getting some things working. I still seem to be missing _putc_r definitions. I tried including lib_a-putc.o and lib_a.putc_u.o but this caused a previously working code to crash. Still investigating why.

@igrr
Copy link
Member Author

igrr commented Apr 13, 2016

@benjamind Last time i checked, this was working in my tests. I'm ready to merge once this change has received enough testing.
Could you please let me know what sketch you were compiling when you got missing _putc_r references?

@benjamind
Copy link

I'm attempting to compile Cesanta v7 Javascript engine (https://www.cesanta.com/developer/v7) into a sketch with a bunch of other wifi code, I'm trying to work up the simplest test case now.

@benjamind
Copy link

There's a little example of trying to compile v7 with Arduino here Arduinov7.zip

In order to get this to compile I had to add the lib_a-putc.o and lib_a-putc_u.o symbols back (they're commented out in the make_libcmin.sh above). This gave me _putc_r implementation, but I think the heap management might be off since its crashing in a umm_malloc call. Something related to the heap changes above? Is there another hook I need to make for _putc_r to function correctly?

Only deviation in the v7 here from the official source on github is that I set the following defines in the v7.h. The CS_PLATFORM declares the esp8266_lwip build of v7, and I've disabled STDIO and LIBC usage, while giving it the minimum build profile. I also had to declare _exit since this also seemed to be undefined.

#define CS_PLATFORM 3
#define CS_DISABLE_STDIO
#define V7_BUILD_PROFILE 1
#define NO_LIBC

void _exit(int status) {
  printf("_exit(%d)\n", status);
  abort();
}

Here's the stack trace for the crash:

Exception (29):
epc1=0x4021d69e epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont 
sp: 3fff4260 end: 3fff4530 offset: 01a0

>>>stack>>>
3fff4400:  00000000 00000018 0001770c 40100711  
3fff4410:  3fff4f68 00000018 3fff6084 4020135c  
3fff4420:  00000000 3fff5054 00000024 3fff4e44  
3fff4430:  00000fa0 3fff5044 3fff4f30 4020f25f  
3fff4440:  00000018 feefeffe feefeffe 0001c200  
3fff4450:  0000001c 00000000 00000000 401006e4  
3fff4460:  00000000 00000000 00000000 402147e8  
3fff4470:  00000000 0000000a 3ffec94a 3fff344c  
3fff4480:  3fff4f4c 0000000a 3fff4f68 40213fcd  
3fff4490:  3ffece0c 00000000 3fff344c 3fff344c  
3fff44a0:  3fffdad0 00000000 3fff3500 4020fa75  
3fff44b0:  00000000 00000000 00000000 4021401c  
3fff44c0:  3fffdad0 00000000 3fff3500 40213689  
3fff44d0:  feefeffe feefeffe feefeffe feefeffe  
3fff44e0:  feefeffe feefeffe feefeffe feefeffe  
3fff44f0:  feefeffe feefeffe feefeffe feefeffe  
3fff4500:  feefeffe feefeffe feefeffe 3fff3508  
3fff4510:  3fffdad0 00000000 3fff3500 40214650  
3fff4520:  feefeffe feefeffe 3fff3510 40100964  
<<<stack<<<

Here's the output from the ESP exception parser:

Decoding 12 results
0x4021d69e: memset at ?? line ?
0x40100711: calloc at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c line 1682
0x4020135c: gc_new_block at E:\Temp\build93b5748ed8fde4d231b4b4b5930427cd.tmp\sketch/v7.c line 13957
0x4020f25f: gc_arena_init at E:\Temp\build93b5748ed8fde4d231b4b4b5930427cd.tmp\sketch/v7.c line 13957
:  (inlined by) v7_create_opt at E:\Temp\build93b5748ed8fde4d231b4b4b5930427cd.tmp\sketch/v7.c line 14075
0x401006e4: malloc at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c line 1662
0x402147e8: Print::write(unsigned char const*, unsigned int) at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.cpp line 38
0x40213fcd: Print::write(char const*) at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.cpp line 188
0x4020fa75: v7_create at E:\Temp\build93b5748ed8fde4d231b4b4b5930427cd.tmp\sketch/v7.c line 13957
0x4021401c: Print::println(char const*) at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.cpp line 188
0x40213689: setup at E:\Workspace\ArduinoV7/ArduinoV7.ino line 36
0x40214650: loop_wrapper at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/core_esp8266_main.cpp line 43
0x40100964: cont_norm at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/cont.S line 109

@igrr
Copy link
Member Author

igrr commented Apr 13, 2016

I don't think this crash is related to putc. Looks like a null pointer dereference. Looking at v7 code, I'm not sure this will work out of the box. For instance, cesanta uses a different linker script.
Could you please open a new issue for this topic? It doesn't look like a libc-related issue.

@benjamind
Copy link

Sure I can open another issue.

The missing _putc_r definition should probably be addressed in this ticket
maybe?
On 12 Apr 2016 9:52 pm, "Ivan Grokhotkov" [email protected] wrote:

I don't think this crash is related to putc. Looks like a null pointer
dereference. Looking at v7 code, I'm not sure this will work out of the
box. For instance, cesanta uses a different linker script.
Could you please open a new issue for this topic? It doesn't look like a
libc-related issue.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#1752 (comment)

@igrr
Copy link
Member Author

igrr commented Apr 19, 2016

Size difference report for these changes:

sketch                           data     rodata   bss      text     irom0.text   dram     flash
WiFiMulti.ino                    +1200    +952     +8       -48      +15422       +2160    +17526  
DNSServer.ino                    +1200    +1216    +16      -48      +17966       +2432    +20334  
WiFiClientEvents.ino             +1200    +1880    +8       -48      +22606       +3088    +25638  
BasicOTA.ino                     +1200    +2144    +16      -47      +22910       +3360    +26207  
ChatServer.ino                   +1204    +956     -8       -48      +15168       +2152    +17280  
SDWebServer.ino                  +1200    +1216    +16      -47      +18142       +2432    +20511  
BarometricPressureWebServer.ino  +1204    +948     +0       -48      +15280       +2152    +17384  
CheckFlashConfig.ino             +1200    +1888    +32      -48      +22478       +3120    +25518  
eeprom_clear.ino                 +1204    +956     +16      -48      +15184       +2176    +17296  
BasicHttpClient.ino              +1200    +2144    +16      -48      +23518       +3360    +26814  
UdpNtpClient.ino                 +1204    +956     +8       -48      +15584       +2168    +17696  
CardInfo.ino                     +1204    +952     -8       -48      +15168       +2148    +17276  
Datalogger.ino                   +1204    +960     +0       -48      +16000       +2164    +18116  
Time.ino                         +1264    +1616    +32      -48      +21630       +2912    +24462  
FSBrowser.ino                    +1200    +2144    +16      -47      +25294       +3360    +28591  
WebClientRepeating.ino           +1204    +948     +0       -48      +15168       +2152    +17272  
HTTPSRequest.ino                 +1264    +2424    +8       -48      +29600       +3696    +33240  
Arduino_Wifi_AVRISP.ino          +1200    +2136    +24      -47      +22574       +3360    +25863  
AdvancedWebServer.ino            +1200    +2144    +0       -47      +25646       +3344    +28943  
CaptivePortal.ino                +1200    +1216    +16      -48      +17950       +2432    +20318  
AdvancedChatServer.ino           +1204    +956     +8       -48      +15168       +2168    +17280  
test_overrides.ino               +1200    +952     +8       -48      +15168       +2160    +17272  
Sweep.ino                        +1200    +952     +8       -48      +15184       +2160    +17288  
BlinkWithoutDelay.ino            +1200    +952     -8       -48      +15184       +2144    +17288  
OTALeds.ino                      +1200    +2144    +16      -47      +22910       +3360    +26207  
CallSDKFunctions.ino             +1204    +948     -8       -48      +15168       +2144    +17272  
eeprom_read.ino                  +1204    +956     +24      -48      +15168       +2184    +17280  
mDNS-SD_Extended.ino             +1200    +2144    +16      -47      +22606       +3360    +25903  
sha1.ino                         +1204    +1884    +0       -48      +22448       +3088    +25488  
TelnetClient.ino                 +1204    +956     +8       -48      +15168       +2168    +17280  
FSWrapper.ino                    +1200    +1880    +24      -48      +22814       +3104    +25846  
drawLines.ino                    +1204    +956     +8       -48      +15168       +2168    +17280  
shapes.ino                       +1204    +956     +8       -48      +15344       +2168    +17456  
mDNS_Web_Server.ino              +1200    +1208    +24      -47      +15726       +2432    +18087  
Authorization.ino                +1200    +2144    +16      -48      +23518       +3360    +26814  
drawRectangle.ino                +1204    +956     +8       -48      +15168       +2168    +17280  
httpUpdateSPIFFS.ino             +1200    +2144    +16      -48      +23758       +3360    +27054  
DumpFile.ino                     +1204    +960     +0       -48      +15888       +2164    +18004  
eeprom_write.ino                 +1204    +956     +16      -48      +15184       +2176    +17296  
ReuseConnection.ino              +1200    +2144    +16      -48      +23518       +3360    +26814  
HelloMesh.ino                    +1200    +2144    +0       -48      +24926       +3344    +28222  
Blink.ino                        +1200    +952     -8       -48      +15168       +2144    +17272  
HttpBasicAuth.ino                +1200    +2144    +0       -47      +25342       +3344    +28639  
HelloServer.ino                  +1200    +1216    +0       -47      +17918       +2416    +20287  
WebUpdater.ino                   +1200    +2144    +16      -47      +25358       +3360    +28655  
text.ino                         +1204    +948     +0       -48      +15168       +2152    +17272  
WebClient.ino                    +1204    +948     +0       -48      +15600       +2152    +17704  
WiFiWebServer.ino                +1200    +952     +8       -48      +17662       +2160    +19766  
DhcpChatServer.ino               +1204    +956     -8       -48      +15600       +2152    +17712  
UDPSendReceiveString.ino         +1204    +956     -8       -48      +15168       +2152    +17280  
SSDP.ino                         +1200    +2144    +16      -48      +25918       +3360    +29214  
Files.ino                        +1204    +960     +0       -48      +15888       +2164    +18004  
TickerBasic.ino                  +1204    +956     +8       -48      +15184       +2168    +17296  
DhcpAddressPrinter.ino           +1204    +956     -8       -48      +15600       +2152    +17712  
listfiles.ino                    +1204    +960     +0       -48      +15888       +2164    +18004  
StreamHttpClient.ino             +1200    +2144    +16      -48      +23518       +3360    +26814  
ConfigFile.ino                   +1248    +1804    +288     -48      +27054       +3340    +30058  
OTA-mDNS-SPIFFS.ino              +1200    +2144    +16      -47      +25502       +3360    +28799  
SimpleAuthentification.ino       +1200    +1216    +16      -48      +17950       +2432    +20318  
TickerParameter.ino              +1204    +956     +8       -48      +15184       +2168    +17296  
WiFiTelnetToSerial.ino           +1200    +952     +8       -48      +15422       +2160    +17526  
CaptivePortalAdvanced.ino        +1200    +1216    +16      -47      +18094       +2432    +20463  
WiFiScan.ino                     +1200    +952     +24      -48      +15278       +2176    +17382  
httpUpdate.ino                   +1200    +2144    +16      -48      +23758       +3360    +27054  
NTPClient.ino                    +1200    +952     +24      -48      +15422       +2176    +17526  
drawCircle.ino                   +1204    +956     +8       -48      +15184       +2168    +17296  
WiFiClientBasic.ino              +1200    +944     +16      -48      +15422       +2160    +17518  
ReadWrite.ino                    +1204    +952     -8       -48      +15904       +2148    +18012  
drawNumber.ino                   +1204    +956     +8       -48      +15168       +2168    +17280  
WebUpdate.ino                    +1200    +2144    +16      -47      +25358       +3360    +28655  
test_umm_malloc.ino              +1204    +960     +0       -48      +15184       +2164    +17300  
WiFiAccessPoint.ino              +1200    +1216    +16      -48      +17950       +2432    +20318  
WiFiClient.ino                   +1200    +952     +8       -48      +15406       +2160    +17510  
TestEspApi.ino                   +1204    +1876    +0       -48      +22464       +3080    +25496  
WebServer.ino                    +1204    +956     -8       -48      +15168       +2152    +17280  

Need to investigate where do 2-3k RAM consumption comes from.

@proppy
Copy link

proppy commented May 2, 2016

After trying this branch it seems that _times_r is missing:

/Users/igrokhotkov/e/newlib-xtensa/xtensa-lx106-elf/newlib/libc/time/../../../.././newlib/libc/time/clock.c:62: undefined reference to `_times_r'

@igrr
Copy link
Member Author

igrr commented May 6, 2016

@proppy which code triggers this issue?
Is the code really using times function? If so, for what purpose?

@proppy
Copy link

proppy commented May 6, 2016

@igrr https://github.com/munificent/wren, I'll try to nail down where their codebase trigger the call.

@igrr
Copy link
Member Author

igrr commented May 6, 2016

Ah, okay, that's pretty easy then.
They use clock function to get current time: https://github.com/munificent/wren/blob/master/src/vm/wren_core.c#L1009
clock return process time, not "global" time like gettimeofday. I don't know if this is intentional though.
I suppose we can make a stub for clock function which would return the same value as gettimeofday (up to a multiplier).

@proppy
Copy link

proppy commented May 6, 2016

Thanks for digging!

@igrr I could also open an issue on their end so that they make the system_clock primitive optional (as it doesn't always make sense on a MCUs unless you have dedicated hardwared to support it)

@igrr
Copy link
Member Author

igrr commented May 6, 2016

IMO usage of wall-clock time (or "absolute" time, the one which gettimeofday returns) does make sense on a microcontroller.
Usage of per-process time makes slightly less sense because there are no processes. But I'll add the stubs to return absolute time for these calls anyway.

@proppy
Copy link

proppy commented May 6, 2016

IMO usage of wall-clock time (or "absolute" time, the one which gettimeofday returns) does make sense on a microcontroller.

Excuse my ignorance, but does the ESP has the way to get epoch time without dedicated RTC hardware or talking to a NTP service?

Usage of per-process time makes slightly less sense because there are no processes

Isn't that just == uptime "time since power on" (since the only "process" is the OS+its tasks)? I assumed RTOS was already tracking that.

@igrr
Copy link
Member Author

igrr commented May 6, 2016

NTP is certainly an option on the ESP, and built-in time functions will actually return correct values if you initialize NTP by calling configTime function. Without NTP or some RTC what you will get is some relative value, that is, number of milliseconds since startup. That is also good enough for that clock function as far as i can tell.

@igrr
Copy link
Member Author

igrr commented May 7, 2016

Forgot to post the updated size difference report. It's getting better.

sketch                           data     rodata   bss      text     irom0.text   dram     flash
WiFiMulti.ino                    +368     +156     +8       -48      +7886        +532     +8362   
DNSServer.ino                    +368     +404     +16      -48      +7886        +788     +8610   
WiFiClientEvents.ino             +368     +156     +8       -48      +9230        +532     +9706   
BasicOTA.ino                     +368     +404     +24      -47      +9230        +796     +9955   
ChatServer.ino                   +372     +160     +0       -48      +7760        +532     +8244   
SDWebServer.ino                  +368     +404     +16      -47      +8014        +788     +8739   
BarometricPressureWebServer.ino  +372     +132     +0       -48      +7792        +504     +8248   
CheckFlashConfig.ino             +368     +164     +32      -48      +9246        +564     +9730   
eeprom_clear.ino                 +372     +160     +0       -48      +7696        +532     +8180   
BasicHttpClient.ino              +368     +404     +8       -48      +9502        +780     +10226  
UdpNtpClient.ino                 +372     +160     +0       -48      +8160        +532     +8644   
CardInfo.ino                     +372     +156     +0       -48      +7760        +528     +8240   
Datalogger.ino                   +372     +148     -8       -48      +8144        +512     +8616   
Time.ino                         +432     +348     +40      -48      +10878       +820     +11610  
FSBrowser.ino                    +368     +404     +16      -47      +9214        +788     +9939   
WebClientRepeating.ino           +372     +152     -8       -48      +7760        +516     +8236   
HTTPSRequest.ino                 +432     +692     +8       -48      +12400       +1132    +13476  
Arduino_Wifi_AVRISP.ino          +368     +412     +16      -47      +9086        +796     +9819   
AdvancedWebServer.ino            +368     +404     -8       -47      +9694        +764     +10419  
CaptivePortal.ino                +368     +404     +16      -48      +7886        +788     +8610   
AdvancedChatServer.ino           +372     +160     +0       -48      +7776        +532     +8260   
test_overrides.ino               +376     +156     +16      -48      +7680        +548     +8164   
Sweep.ino                        +376     +160     +0       -48      +7696        +536     +8184   
BlinkWithoutDelay.ino            +376     +160     +0       -48      +7696        +536     +8184   
OTALeds.ino                      +368     +404     +24      -47      +9214        +796     +9939   
CallSDKFunctions.ino             +372     +152     -8       -48      +7760        +516     +8236   
eeprom_read.ino                  +372     +160     +0       -48      +7776        +532     +8260   
mDNS-SD_Extended.ino             +368     +420     +16      -47      +9134        +804     +9875   
sha1.ino                         +372     +144     +0       -48      +9216        +516     +9684   
TelnetClient.ino                 +372     +160     +0       -48      +7776        +532     +8260   
FSWrapper.ino                    +368     +140     +24      -48      +9422        +532     +9882   
drawLines.ino                    +372     +160     +0       -48      +7776        +532     +8260   
shapes.ino                       +372     +160     +0       -48      +8032        +532     +8516   
mDNS_Web_Server.ino              +368     +396     +16      -47      +7758        +780     +8475   
Authorization.ino                +368     +404     +8       -48      +9502        +780     +10226  
drawRectangle.ino                +372     +160     +0       -48      +7776        +532     +8260   
httpUpdateSPIFFS.ino             +368     +404     +8       -48      +9678        +780     +10402  
DumpFile.ino                     +372     +164     +0       -48      +8032        +536     +8520   
eeprom_write.ino                 +372     +160     +0       -48      +7696        +532     +8180   
ReuseConnection.ino              +368     +404     +16      -48      +9502        +788     +10226  
HelloMesh.ino                    +368     +404     -8       -48      +9230        +764     +9954   
Blink.ino                        +376     +160     +0       -48      +7680        +536     +8168   
HttpBasicAuth.ino                +368     +404     +0       -47      +9294        +772     +10019  
HelloServer.ino                  +368     +404     -8       -47      +7790        +764     +8515   
WebUpdater.ino                   +368     +404     +16      -47      +9326        +788     +10051  
text.ino                         +372     +152     +8       -48      +7776        +532     +8252   
WebClient.ino                    +372     +152     -8       -48      +8160        +516     +8636   
WiFiWebServer.ino                +368     +156     +16      -48      +7918        +540     +8394   
DhcpChatServer.ino               +372     +160     +0       -48      +8160        +532     +8644   
UDPSendReceiveString.ino         +372     +160     +0       -48      +7776        +532     +8260   
SSDP.ino                         +368     +404     +16      -48      +9966        +788     +10690  
Files.ino                        +372     +164     -8       -48      +8032        +528     +8520   
TickerBasic.ino                  +372     +160     +0       -48      +7696        +532     +8180   
DhcpAddressPrinter.ino           +372     +160     +0       -48      +8160        +532     +8644   
listfiles.ino                    +372     +164     +8       -48      +8032        +544     +8520   
StreamHttpClient.ino             +368     +404     +16      -48      +9502        +788     +10226  
ConfigFile.ino                   +384     +832     +24      -48      +15662       +1240    +16830  
OTA-mDNS-SPIFFS.ino              +368     +404     +16      -47      +9438        +788     +10163  
SimpleAuthentification.ino       +368     +404     +24      -48      +7934        +796     +8658   
TickerParameter.ino              +372     +160     +0       -48      +7696        +532     +8180   
WiFiTelnetToSerial.ino           +368     +156     +8       -48      +7886        +532     +8362   
CaptivePortalAdvanced.ino        +368     +404     +16      -47      +7966        +788     +8691   
WiFiScan.ino                     +368     +156     +24      -48      +7886        +548     +8362   
httpUpdate.ino                   +368     +404     +24      -48      +9662        +796     +10386  
NTPClient.ino                    +368     +156     +24      -48      +7886        +548     +8362   
drawCircle.ino                   +372     +160     +0       -48      +7776        +532     +8260   
WiFiClientBasic.ino              +368     +148     +16      -48      +7886        +532     +8354   
ReadWrite.ino                    +372     +156     +0       -48      +8048        +528     +8528   
drawNumber.ino                   +372     +160     +0       -48      +7776        +532     +8260   
WebUpdate.ino                    +368     +404     +16      -47      +9326        +788     +10051  
test_umm_malloc.ino              +372     +164     +0       -48      +7696        +536     +8184   
WiFiAccessPoint.ino              +368     +404     +24      -48      +7902        +796     +8626   
WiFiClient.ino                   +368     +140     +8       -48      +7886        +516     +8346   
TestEspApi.ino                   +372     +152     +0       -48      +9216        +524     +9692   
WebServer.ino                    +372     +160     +0       -48      +7776        +532     +8260   

Personally I think +8k flash and +0.5k ram is not a showstopper, since we are adding floating-point format support. Thoughts?

@codecov-io
Copy link

codecov-io commented May 10, 2016

Current coverage is 27.61%

Merging #1752 into master will not change coverage

@@             master      #1752   diff @@
==========================================
  Files            20         20          
  Lines          3686       3686          
  Methods         337        337          
  Messages          0          0          
  Branches        678        678          
==========================================
  Hits           1018       1018          
  Misses         2490       2490          
  Partials        178        178          

Powered by Codecov. Last updated by d28c551...65ec2f8

@igrr igrr modified the milestones: 2.3.0, 2.4.0 Jun 3, 2016
igrr and others added 6 commits June 23, 2016 15:55
This change adds libcmin.a, which is created from newlib libc by selectively removing some of the object files (mostly related to heap management).
The list of files is available in tools/sdk/lib/make_libcmin.sh. Files which are not needed are commented out.
This change adds support for various functions which were missing, like sscanf, strftime, etc.
Built from https://github.com/igrr/newlib-xtensa using:
./configure --with-newlib --enable-multilib --disable-newlib-io-c99-formats --enable-newlib-supplied-syscalls --enable-target-optspace --program-transform-name="s&^&xtensa-lx106-elf-&" --disable-option-checking --with-target-subdir=xtensa-lx106-elf --target=xtensa-lx106-elf --enable-newlib-nano-formatted-io --enable-newlib-reent-small  --prefix=path-to-arduino-core/tools/sdk/libc
CROSS_CFLAGS="-DMALLOC_PROVIDED -DSIGNAL_PROVIDED -DABORT_PROVIDED" make
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants