View Issue Details

IDProjectCategoryView StatusLast Update
0002801libpasastroGeneralpublic25-01-30 22:46
ReporterMattia Verga Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Summary0002801: libpasastro doesn't build with GCC15
DescriptionFedora just introduced GCC15 in what will become the next release and libpasastro now fails to build.
I have been trying to fix the compilation myself, but I'm getting stuck on wcs sources. Be advised that I'm not really sure I know what I'm doing, I reached the point where I made this patch:
https://mattia.fedorapeople.org/fix_gcc15-c++23.patch

Now the plan404 sources doesn't error anymore and I've also fixed some errors on wcs, but I'm stuck at:

gcc -w -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -std=c17 -D_XOPEN_SOURCE=500 -c -o dateutil.o dateutil.c
make[1]: Leaving directory '/builddir/build/BUILD/libpasastro-1.4.3-build/libpasastro-1.4.3/wcs'
dateutil.c: In function ‘lt2dt’:
dateutil.c:879:21: error: storage size of ‘tzp’ isn’t known
  879 | struct timezone tzp;
      | ^~~
dateutil.c: In function ‘lt2fd’:
dateutil.c:909:21: error: storage size of ‘tzp’ isn’t known
  909 | struct timezone tzp;
      | ^~~
dateutil.c: In function ‘ut2dt’:
dateutil.c:3164:21: error: storage size of ‘tzp’ isn’t known
 3164 | struct timezone tzp;
      | ^~~
dateutil.c: In function ‘ut2fd’:
dateutil.c:3221:21: error: storage size of ‘tzp’ isn’t known
 3221 | struct timezone tzp;
      | ^~~
make[1]: *** [<builtin>: dateutil.o] Error 1
TagsNo tags attached.

Activities

Patrick Chevalley

25-01-23 19:21

administrator   ~0009276

Hi Mattia,

I not have gcc 15 to test but I just take a look at the code.

The "timezone" structure is not in the wcs code, it is most probably from the system provided time.h

dateutil.c contain two #include for <time.h> and <sys/time.h>, I don't know the reason for that, but a change in this two files can produce this error. Maybe try to remove one or the other?



Mattia Verga

25-01-24 09:54

reporter   ~0009277

I have found a possible solution in another package. I have updated the patch as in https://mattia.fedorapeople.org/libpasastro_fix_gcc15-c++23.patch and now the build succeed.
I'll ask for a review on Fedora mailing list too, let's see I'm doing something wrong...

Patrick Chevalley

25-01-25 09:57

administrator   ~0009284

Thank you Mattia.

I do some test with my GCC 14 and get the same issue when the option -std=c17 is specified , same with -std=c11.
Your patch also work for me.
From your patch it look like TimeZone definition is a GNU extension?

Mattia Verga

25-01-25 10:21

reporter   ~0009285

As I understand, wcstools code is based on a lot of POSIX functions which aren't standard in GNU.
I was able to fix some of the errors with `-std=c99 -D_XOPEN_SOURCE=500`, but the timezone definition in dateutil needs `#define _GNU_SOURCE`. I've taken this solution from https://src.fedoraproject.org/rpms/xephem/c/6098e65f257349c14bfc24ade87edaac8b147874?branch=rawhide
Also, the `#include <strings.h>` is needed for some functions to work (`#include <string.h>` only does not work).

For plan404 I specified functions argument types based on what the compiler error showed me and avoided redefine some mathematical functions available in math.h.

BTW there's an "updated" version of wcstools upstream, but still outdated and still requires more or less the same patch.

Mattia Verga

25-01-30 18:35

reporter   ~0009300

I had no reply from other Fedora users... so I'm going to send a PR on github and apply this patch to Fedora sources. And see if anything breaks...

Patrick Chevalley

25-01-30 22:46

administrator   ~0009301

Than you Mattia, I merge the PR, all work fine for me.

Issue History

Date Modified Username Field Change
25-01-23 18:54 Mattia Verga New Issue
25-01-23 19:21 Patrick Chevalley Note Added: 0009276
25-01-24 09:54 Mattia Verga Note Added: 0009277
25-01-25 09:57 Patrick Chevalley Note Added: 0009284
25-01-25 10:21 Mattia Verga Note Added: 0009285
25-01-30 18:35 Mattia Verga Note Added: 0009300
25-01-30 22:46 Patrick Chevalley Status new => resolved
25-01-30 22:46 Patrick Chevalley Resolution open => fixed
25-01-30 22:46 Patrick Chevalley Note Added: 0009301