Skip to content

Commit 9de8373

Browse files
BREAKING - Upgrade to upstream newlib 4.0.0 release (#7708)
* Upgrade to upstream newlib 4.0.0 release Includes 64 bit time_t and 5 years of updates. Binary incompatible with libraries which use time_t (due to the size difference). Recompiling with the new newlib should be sufficient for most libraries, assuming source is available. * Remove tools/sdk/libc directory, it isn't used anywhere Somewhere along the line the copy of libc in tools/sdl/libc was taken out of the build process. Files in there are not used, take add'l time to build and install on a toolchain release, and just cause confusion. Remove them. * Fix 64-bit time for LittleFS The core was setting 64-bit times automatically on new file creation or updates, but would fail when attempting to read them back due to 64/32b confusion. Now attempt to read 64b time, and if that fails fallback to reading 32b time to allow both old and new FS to preserve timestamps. * Update to jjsuwa-sys3175 additions to GCC and newlib @jjsuwa-sys3175 contributed multiple patches to GCC, included in the toolchain, as well as a slightly faster pgm_read_byte() macro. * Rebuild w/addl GCC patches, new BearSSL flags * Remove copied libgcc.a file, is contained in toolchain
1 parent e25ad86 commit 9de8373

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+123
-15192
lines changed

bootloaders/eboot/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ INC += -I../../tools/sdk/include -I../../tools/sdk/uzlib/src
2323

2424
CFLAGS += -std=gnu99
2525

26-
CFLAGS += -Os -fcommon -g -Wall -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals -ffunction-sections -fdata-sections
26+
CFLAGS += -Os -fcommon -g -Wall -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals -ffunction-sections -fdata-sections -free -fipa-pta
2727

2828
CFLAGS += $(INC)
2929

bootloaders/eboot/eboot.elf

28 Bytes
Binary file not shown.

cores/esp8266/time.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
#include <stdlib.h>
2424
#include <../include/time.h> // See issue #6714
2525
#include <sys/time.h>
26+
extern "C" {
27+
#include <sys/_tz_structs.h>
28+
};
2629
#include <sys/reent.h>
2730
#include <errno.h>
2831

libraries/LittleFS/src/LittleFS.h

+31-10
Original file line numberDiff line numberDiff line change
@@ -556,11 +556,35 @@ class LittleFSDirImpl : public DirImpl
556556
}
557557

558558
time_t fileTime() override {
559-
return (time_t)_getAttr4('t');
559+
time_t t;
560+
int32_t t32b;
561+
562+
// If the attribute is 8-bytes, we're all set
563+
if (_getAttr('t', 8, &t)) {
564+
return t;
565+
} else if (_getAttr('t', 4, &t32b)) {
566+
// If it's 4 bytes silently promote to 64b
567+
return (time_t)t32b;
568+
} else {
569+
// OTW, none present
570+
return 0;
571+
}
560572
}
561573

562574
time_t fileCreationTime() override {
563-
return (time_t)_getAttr4('c');
575+
time_t t;
576+
int32_t t32b;
577+
578+
// If the attribute is 8-bytes, we're all set
579+
if (_getAttr('c', 8, &t)) {
580+
return t;
581+
} else if (_getAttr('c', 4, &t32b)) {
582+
// If it's 4 bytes silently promote to 64b
583+
return (time_t)t32b;
584+
} else {
585+
// OTW, none present
586+
return 0;
587+
}
564588
}
565589

566590

@@ -599,20 +623,17 @@ class LittleFSDirImpl : public DirImpl
599623
return _dir.get();
600624
}
601625

602-
uint32_t _getAttr4(char attr) {
603-
if (!_valid) {
604-
return 0;
626+
bool _getAttr(char attr, int len, void *dest) {
627+
if (!_valid || !len || !dest) {
628+
return false;
605629
}
606630
int nameLen = 3; // Slashes, terminator
607631
nameLen += _dirPath.get() ? strlen(_dirPath.get()) : 0;
608632
nameLen += strlen(_dirent.name);
609633
char tmpName[nameLen];
610634
snprintf(tmpName, nameLen, "%s%s%s", _dirPath.get() ? _dirPath.get() : "", _dirPath.get()&&_dirPath.get()[0]?"/":"", _dirent.name);
611-
time_t ftime = 0;
612-
int rc = lfs_getattr(_fs->getFS(), tmpName, attr, (void *)&ftime, sizeof(ftime));
613-
if (rc != sizeof(ftime))
614-
ftime = 0; // Error, so clear read value
615-
return ftime;
635+
int rc = lfs_getattr(_fs->getFS(), tmpName, attr, dest, len);
636+
return (rc == len);
616637
}
617638

618639
String _pattern;

package/package_esp8266com_index.template.json

+85-85
Large diffs are not rendered by default.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Do not edit -- Automatically generated by tools/sdk/ssl/bearssl/Makefile
2-
#define BEARSSL_GIT dca786f
2+
#define BEARSSL_GIT 28bebad

tools/sdk/lib/libbearssl.a

-72.6 KB
Binary file not shown.

tools/sdk/lib/libgcc.a

-646 KB
Binary file not shown.

tools/sdk/lib/libhal.a

0 Bytes
Binary file not shown.

tools/sdk/lib/liblwip2-1460-feat.a

520 Bytes
Binary file not shown.

tools/sdk/lib/liblwip2-1460.a

1.44 KB
Binary file not shown.

tools/sdk/lib/liblwip2-536-feat.a

524 Bytes
Binary file not shown.

tools/sdk/lib/liblwip2-536.a

1.44 KB
Binary file not shown.

tools/sdk/lib/liblwip6-1460-feat.a

-208 Bytes
Binary file not shown.

tools/sdk/lib/liblwip6-536-feat.a

-208 Bytes
Binary file not shown.

tools/sdk/lib/libstdc++-exc.a

13.5 KB
Binary file not shown.

tools/sdk/lib/libstdc++.a

15.9 KB
Binary file not shown.

tools/sdk/libc/xtensa-lx106-elf/include/_ansi.h

-140
This file was deleted.

tools/sdk/libc/xtensa-lx106-elf/include/_syslist.h

-40
This file was deleted.

tools/sdk/libc/xtensa-lx106-elf/include/alloca.h

-21
This file was deleted.

tools/sdk/libc/xtensa-lx106-elf/include/ar.h

-69
This file was deleted.

tools/sdk/libc/xtensa-lx106-elf/include/argz.h

-33
This file was deleted.

0 commit comments

Comments
 (0)