Public bug reported:

[Impact]
The virtium plugin can cause FTBFS due to 64-bit time_t on 32-bit architectures

[Fix]
Changing timestamp types to time_t ensures correct builds on 32-bit systems 
even with 64-bit time_t (e.g. armhf). This has been fixed by the following 
upstream patch:
 - fa0296794e49 plugins/virtium: use time_t for time_stamp values
   https://github.com/linux-nvme/nvme-cli/commit/fa0296794e49

This has been merged into v2.10 upstream.

[Test Plan]
When building with 64-bit time_t and without the fix, the following build error 
will occur (e.g. Oracular on armhf):

[242/476] cc -Invme.p -I. -I.. -Iccan -I../ccan -I/usr/include/json-c 
-fdiagnostics-color=always -Wall -Winvalid-pch -std=gnu99 -fomit-frame-pointer 
-D_GNU_SOURCE -include config.h -g -O2 -Werror=implicit-function-declaration 
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat 
-Werror=format-security -fno-stack-clash-protection 
-fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/nvme-cli-2.9.1-1ubuntu1 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time 
-D_FORTIFY_SOURCE=3 -MD -MQ nvme.p/plugins_virtium_virtium-nvme.c.o -MF 
nvme.p/plugins_virtium_virtium-nvme.c.o.d -o 
nvme.p/plugins_virtium_virtium-nvme.c.o -c ../plugins/virtium/virtium-nvme.c
FAILED: nvme.p/plugins_virtium_virtium-nvme.c.o 
cc -Invme.p -I. -I.. -Iccan -I../ccan -I/usr/include/json-c 
-fdiagnostics-color=always -Wall -Winvalid-pch -std=gnu99 -fomit-frame-pointer 
-D_GNU_SOURCE -include config.h -g -O2 -Werror=implicit-function-declaration 
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat 
-Werror=format-security -fno-stack-clash-protection 
-fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/nvme-cli-2.9.1-1ubuntu1 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time 
-D_FORTIFY_SOURCE=3 -MD -MQ nvme.p/plugins_virtium_virtium-nvme.c.o -MF 
nvme.p/plugins_virtium_virtium-nvme.c.o.d -o 
nvme.p/plugins_virtium_virtium-nvme.c.o -c ../plugins/virtium/virtium-nvme.c
../plugins/virtium/virtium-nvme.c: In function ‘vt_header_to_string’:
../plugins/virtium/virtium-nvme.c:205:63: error: passing argument 1 of 
‘localtime’ from incompatible pointer type [-Wincompatible-pointer-types]
  205 |         strftime(timebuff, 50, "%Y-%m-%d %H:%M:%S", 
localtime(&(header->time_stamp)));
      |                                                               
^~~~~~~~~~~~~~~~~~~~~
      |                                                               |
      |                                                               const 
long int *
In file included from /usr/include/features.h:510,
                 from /usr/include/fcntl.h:25,
                 from ../plugins/virtium/virtium-nvme.c:2:
/usr/include/time.h:141:19: note: expected ‘const time_t *’ {aka ‘const long 
long int *’} but argument is of type ‘const long int *’
  141 | extern struct tm *__REDIRECT_NTH (localtime, (const time_t *__timer),
      |                   ^~~~~~~~~~~~~~

After the patch, the virtium plugin files should build correctly (i.e.
no incompatible pointer types).

[Where problems could occur]
This patch could expose any bugs that were not present before the usage of 
time_t. Given this is specifically within the virtium plugins, no issues 
outside of this scope are expected.

** Affects: nvme-cli (Ubuntu)
     Importance: Undecided
         Status: Fix Released

** Affects: nvme-cli (Ubuntu Noble)
     Importance: Low
     Assignee: Heitor Alves de Siqueira (halves)
         Status: In Progress

** Also affects: nvme-cli (Ubuntu Noble)
   Importance: Undecided
       Status: New

** Changed in: nvme-cli (Ubuntu)
       Status: New => Fix Released

** Changed in: nvme-cli (Ubuntu Noble)
     Assignee: (unassigned) => Heitor Alves de Siqueira (halves)

** Changed in: nvme-cli (Ubuntu Noble)
       Status: New => In Progress

** Changed in: nvme-cli (Ubuntu Noble)
   Importance: Undecided => Low

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2076668

Title:
  FTBFS on armhf due to t64

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nvme-cli/+bug/2076668/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to