mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
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
This commit is contained in:
committed by
GitHub
parent
e25ad86c91
commit
9de8373f1b
@ -556,11 +556,35 @@ public:
|
||||
}
|
||||
|
||||
time_t fileTime() override {
|
||||
return (time_t)_getAttr4('t');
|
||||
time_t t;
|
||||
int32_t t32b;
|
||||
|
||||
// If the attribute is 8-bytes, we're all set
|
||||
if (_getAttr('t', 8, &t)) {
|
||||
return t;
|
||||
} else if (_getAttr('t', 4, &t32b)) {
|
||||
// If it's 4 bytes silently promote to 64b
|
||||
return (time_t)t32b;
|
||||
} else {
|
||||
// OTW, none present
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
time_t fileCreationTime() override {
|
||||
return (time_t)_getAttr4('c');
|
||||
time_t t;
|
||||
int32_t t32b;
|
||||
|
||||
// If the attribute is 8-bytes, we're all set
|
||||
if (_getAttr('c', 8, &t)) {
|
||||
return t;
|
||||
} else if (_getAttr('c', 4, &t32b)) {
|
||||
// If it's 4 bytes silently promote to 64b
|
||||
return (time_t)t32b;
|
||||
} else {
|
||||
// OTW, none present
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -599,20 +623,17 @@ protected:
|
||||
return _dir.get();
|
||||
}
|
||||
|
||||
uint32_t _getAttr4(char attr) {
|
||||
if (!_valid) {
|
||||
return 0;
|
||||
bool _getAttr(char attr, int len, void *dest) {
|
||||
if (!_valid || !len || !dest) {
|
||||
return false;
|
||||
}
|
||||
int nameLen = 3; // Slashes, terminator
|
||||
nameLen += _dirPath.get() ? strlen(_dirPath.get()) : 0;
|
||||
nameLen += strlen(_dirent.name);
|
||||
char tmpName[nameLen];
|
||||
snprintf(tmpName, nameLen, "%s%s%s", _dirPath.get() ? _dirPath.get() : "", _dirPath.get()&&_dirPath.get()[0]?"/":"", _dirent.name);
|
||||
time_t ftime = 0;
|
||||
int rc = lfs_getattr(_fs->getFS(), tmpName, attr, (void *)&ftime, sizeof(ftime));
|
||||
if (rc != sizeof(ftime))
|
||||
ftime = 0; // Error, so clear read value
|
||||
return ftime;
|
||||
int rc = lfs_getattr(_fs->getFS(), tmpName, attr, dest, len);
|
||||
return (rc == len);
|
||||
}
|
||||
|
||||
String _pattern;
|
||||
|
Reference in New Issue
Block a user