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

Fails to build on 32-bit PowerPC with 64-bit timestamps #34

Open
glaubitz opened this issue Dec 7, 2024 · 0 comments
Open

Fails to build on 32-bit PowerPC with 64-bit timestamps #34

glaubitz opened this issue Dec 7, 2024 · 0 comments

Comments

@glaubitz
Copy link

glaubitz commented Dec 7, 2024

Debian has switched its 32-bit targets to use 64-bit timestamps (i.e. sizeof(time_t) == 8) which causes ppc64-diag failing to build on 32-bit PowerPC:

lpd/usysident.c: In function ‘main’:
lpd/usysident.c:432:44: warning: the comparison will always evaluate as ‘true’ for the address of ‘devname’ will never be NULL [-Waddress]
  432 |                                 if (dvalue && current->devname &&
      |                                            ^~
In file included from lpd/usysident.c:39:
lpd/indicator.h:111:25: note: ‘devname’ declared here
  111 |         char            devname[DEV_LENGTH];    /* like sda, sdb etc */
      |                         ^~~~~~~
rtas_errd/v6ela.c: In function ‘report_menugoal’:
gcc -DHAVE_CONFIG_H -I. -I./config   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -I ./common/ -I ./ela/ -I ./diags -I ./lpd/ -I /usr/include/ncurses/ -Wall -g -DDEBUG -DDEST_DIR='"/usr"' -DVERSION='"2.7.9"' -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIE -Wstack-protector --param=ssp-buffer-size=1 -c -o diags/7031_D24_T24.o diags/7031_D24_T24.c
rtas_errd/v6ela.c:366:65: error: passing argument 1 of ‘time’ from incompatible pointer type [-Wincompatible-pointer-types]
  366 |                                                 time_loc = time((long *)0);
      |                                                                 ^~~~~~~~~
      |                                                                 |
      |                                                                 long int *
In file included from /usr/include/features.h:510,
                 from /usr/include/powerpc-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from rtas_errd/v6ela.c:21:
/usr/include/time.h:85:15: note: expected ‘time_t *’ {aka ‘long long int *’} but argument is of type ‘long int *’
   85 | extern time_t __REDIRECT_NTH (time, (time_t *__timer), __time64);
      |               ^~~~~~~~~~~~~~
rtas_errd/v6ela.c:367:66: error: passing argument 1 of ‘localtime’ from incompatible pointer type [-Wincompatible-pointer-types]
  367 |                                                 date = localtime(&time_loc);
      |                                                                  ^~~~~~~~~
      |                                                                  |
      |                                                                  long int *
/usr/include/time.h:141:19: note: expected ‘const time_t *’ {aka ‘const long long int *’} but argument is of type ‘long int *’
  141 | extern struct tm *__REDIRECT_NTH (localtime, (const time_t *__timer),
      |                   ^~~~~~~~~~~~~~
gcc -DHAVE_CONFIG_H -I. -I./config   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -I ./common/ -I ./ela/ -I ./diags -I ./lpd/ -I /usr/include/ncurses/ -Wall -g -DDEBUG -DDEST_DIR='"/usr"' -DVERSION='"2.7.9"' -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIE -Wstack-protector --param=ssp-buffer-size=1 -c -o diags/bluehawk.o diags/bluehawk.c
make[1]: *** [Makefile:2170: rtas_errd/v6ela.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/include/string.h:548,
                 from rtas_errd/extract_platdump.c:26:
In function ‘strcat’,
    inlined from ‘extract_platform_dump’ at rtas_errd/extract_platdump.c:274:3:
/usr/include/powerpc-linux-gnu/bits/string_fortified.h:140:10: warning: ‘dumpid’ may be used uninitialized [-Wmaybe-uninitialized]
  140 |   return __builtin___strcat_chk (__dest, __src, __glibc_objsize (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<built-in>: In function ‘extract_platform_dump’:
<built-in>: note: by argument 2 of type ‘const char *’ to ‘__builtin___strcpy_chk’ declared here
rtas_errd/extract_platdump.c:223:17: note: ‘dumpid’ declared here
  223 |         char    dumpid[5];
      |                 ^~~~~~

Full build log available at: https://buildd.debian.org/status/fetch.php?pkg=ppc64-diag&arch=powerpc&ver=2.7.9-1.1&stamp=1733512224&raw=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant