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

linux:SystemTimeSupport: make compatible with time64 (64-bit time_t) #19985

Merged

Conversation

plan44
Copy link
Contributor

@plan44 plan44 commented Jun 26, 2022

Some environments (e.g. musl >=1.2.0, as used in OpenWrt) have switched to time64 - using a 64bit type for time_t to prevent year 2037 problems due to 32bit epoch time overflow.

This PR fixes a formatstring error that appears when time_t is 64bit. It does so in a way that keeps compatibility with 32bit time_t while now also compiling and working correctly for 64bit.

Testing:

  • verified correctly building and running in a musl 1.2 based experimental build of mine (time64)
  • verified still correctly working in a standard Linux build (time32)

@CLAassistant
Copy link

CLAassistant commented Jun 26, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

github-actions bot commented Jun 26, 2022

PR #19985: Size comparison from 46b15d6 to 92c7559

Increases (5 builds for cc13x2_26x2, cyw30739, esp32, linux, nrfconnect)
platform target config section 46b15d6 92c7559 change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read only) 668283 668291 8 0.0
.text 591656 591664 8 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 580822 580830 8 0.0
.app_xip_area 457816 457824 8 0.0
esp32 all-clusters-app c3devkit (read only) 1019318 1019320 2 0.0
.flash.text 1019318 1019320 2 0.0
linux thermostat-no-ble arm64 (read only) 2597460 2597476 16 0.0
.rodata 166148 166164 16 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 text 810552 810556 4 0.0
Decreases (1 build for cc13x2_26x2)
platform target config section 46b15d6 92c7559 change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read/write) 174860 174852 -8 -0.0
Full report (30 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 46b15d6 92c7559 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 665755 665755 0 0.0
(read/write) 187244 187244 0 0.0
.bss 75892 75892 0 0.0
.data 3356 3356 0 0.0
.rodata 88059 88059 0 0.0
.text 577380 577380 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 654531 654531 0 0.0
(read/write) 197764 197764 0 0.0
.bss 75188 75188 0 0.0
.data 3356 3356 0 0.0
.rodata 91563 91563 0 0.0
.text 562652 562652 0 0.0
lock-ftd LP_CC2652R7 (read only) 668283 668291 8 0.0
(read/write) 174860 174852 -8 -0.0
.bss 72924 72924 0 0.0
.data 3280 3280 0 0.0
.rodata 76147 76147 0 0.0
.text 591656 591664 8 0.0
lock-mtd LP_CC2652R7 (read only) 617699 617699 0 0.0
(read/write) 146040 146040 0 0.0
.bss 68644 68644 0 0.0
.data 3280 3280 0 0.0
.rodata 76027 76027 0 0.0
.text 541184 541184 0 0.0
pump-app LP_CC2652R7 (read only) 678111 678111 0 0.0
(read/write) 165888 165888 0 0.0
.bss 73012 73012 0 0.0
.data 3280 3280 0 0.0
.rodata 88711 88711 0 0.0
.text 588916 588916 0 0.0
pump-controller-app LP_CC2652R7 (read only) 663991 663991 0 0.0
(read/write) 180128 180128 0 0.0
.bss 73132 73132 0 0.0
.data 3276 3276 0 0.0
.rodata 84551 84551 0 0.0
.text 578960 578960 0 0.0
shell LP_CC2652R7 (read only) 658206 658206 0 0.0
(read/write) 190296 190296 0 0.0
.bss 78196 78196 0 0.0
.data 3360 3360 0 0.0
.rodata 84814 84814 0 0.0
.text 573076 573076 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 580822 580830 8 0.0
.app_xip_area 457816 457824 8 0.0
.bss 65968 65968 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 582390 582390 0 0.0
.app_xip_area 459192 459192 0 0.0
.bss 66160 66160 0 0.0
.data 720 720 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 584582 584582 0 0.0
.app_xip_area 462424 462424 0 0.0
.bss 65176 65176 0 0.0
.data 660 660 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1082704 1082704 0 0.0
.bss 134772 134772 0 0.0
.data 2048 2048 0 0.0
.text 945864 945864 0 0.0
BRD4161A+rpc (read/write) 1137020 1137020 0 0.0
.bss 151460 151460 0 0.0
.data 2260 2260 0 0.0
.text 983276 983276 0 0.0
BRD4161A+rs911x (read/write) 945656 945656 0 0.0
.bss 140488 140488 0 0.0
.data 2048 2048 0 0.0
.text 803100 803100 0 0.0
lock-app BRD4161A+wf200 (read/write) 1122544 1122544 0 0.0
.bss 140936 140936 0 0.0
.data 2060 2060 0 0.0
.text 979528 979528 0 0.0
window-app BRD4161A (read/write) 1067980 1067980 0 0.0
.bss 134852 134852 0 0.0
.data 2076 2076 0 0.0
.text 931032 931032 0 0.0
esp32 all-clusters-app c3devkit (read only) 1019318 1019320 2 0.0
(read/write) 1487018 1487018 0 0.0
.dram0.bss 71840 71840 0 0.0
.dram0.data 14624 14624 0 0.0
.flash.rodata 215128 215128 0 0.0
.flash.text 1019318 1019320 2 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1073427 1073427 0 0.0
(read/write) 489152 489152 0 0.0
.dram0.bss 77360 77360 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 245652 245652 0 0.0
.flash.text 1068043 1068043 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 660424 660424 0 0.0
.bss 71292 71292 0 0.0
.data 1992 1992 0 0.0
.text 581340 581340 0 0.0
lock k32w061+release (read/write) 686832 686832 0 0.0
.bss 71764 71764 0 0.0
.data 2004 2004 0 0.0
.text 607264 607264 0 0.0
linux chip-tool-no-interactive-ipv6only arm64 (read only) 9928900 9928900 0 0.0
(read/write) 675697 675697 0 0.0
.bss 42641 42641 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 614632 614632 0 0.0
.dynamic 528 528 0 0.0
.got 13456 13456 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 473380 473380 0 0.0
.text 7915844 7915844 0 0.0
thermostat-no-ble arm64 (read only) 2597460 2597476 16 0.0
(read/write) 181793 181793 0 0.0
.bss 88721 88721 0 0.0
.data 1704 1704 0 0.0
.data.rel.ro 83256 83256 0 0.0
.dynamic 528 528 0 0.0
.got 5088 5088 0 0.0
.init 24 24 0 0.0
.init_array 400 400 0 0.0
.rodata 166148 166164 16 0.0
.text 2191536 2191536 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2448040 2448040 0 0.0
.bss 215732 215732 0 0.0
.data 5872 5872 0 0.0
.text 1410684 1410684 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1175867 1175867 0 0.0
bss 144666 144666 0 0.0
rodata 141724 141724 0 0.0
text 810552 810556 4 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1156735 1156735 0 0.0
bss 143902 143902 0 0.0
rodata 133656 133656 0 0.0
text 800260 800260 0 0.0
p6 all-clusters-app default (read/write) 2564496 2564496 0 0.0
.bss 150912 150912 0 0.0
.data 2776 2776 0 0.0
.text 1522760 1522760 0 0.0
all-clusters-minimal-app default (read/write) 2510360 2510360 0 0.0
.bss 150192 150192 0 0.0
.data 2776 2776 0 0.0
.text 1468624 1468624 0 0.0
light-app default (read/write) 2440504 2440504 0 0.0
.bss 142248 142248 0 0.0
.data 2592 2592 0 0.0
.text 1398768 1398768 0 0.0
lock-app default (read/write) 2466776 2466776 0 0.0
.bss 142096 142096 0 0.0
.data 2600 2600 0 0.0
.text 1425040 1425040 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 799080 799080 0 0.0
bss 72360 72360 0 0.0
noinit 40416 40416 0 0.0
text 565512 565512 0 0.0
lighting-app tlsr9518adk80d (read/write) 819044 819044 0 0.0
bss 73180 73180 0 0.0
noinit 40416 40416 0 0.0
text 581950 581950 0 0.0

@bzbarsky-apple
Copy link
Contributor

@plan44 Please fix the restyled failure?

@andy31415 andy31415 merged commit 6efefe3 into project-chip:master Jun 27, 2022
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.

8 participants