-
Notifications
You must be signed in to change notification settings - Fork 148
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
misc fixes from building on 32-bit architectures with 64-bit time_t #5009
Conversation
As mentioned at #4887 (comment) , I think configure.ac should call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial testing:
- compiles on Fedora 39 with GCC 13.3.1and passes cunit and Cass tests
- does NOT compile on Fedora 40 with GCC 14.2.1
CCLD cunit/unit
/usr/bin/ld: cunit/timeofday.o: in function `real_gettimeofday':
/home/ken/cyrus-imapd-upstream/cunit/timeofday.c:203:(.text+0x44d): undefined reference to `__gettimeofday64'
I tried #including <sys/time.h> to solve this but then it complains that gettimeofday() is defined twice
Huh, curious. I wonder what that's about |
@ksmurchison can you do something like @rsto Can you try building this PR too please? I'm curious whether it works ok for you, has the same issues, or has different ones. |
@elliefm it builds fine for me on Debian 12.6 (bookworm) gcc (Debian 12.2.0-14) 12.2.0 CFLAGS="-g -Og -fPIC -W -Wall -Werror -fstack-protector-all -fno-semantic-interposition -Bsymbolic -fno-omit-frame-pointer" |
@ksmurchison also, what version of libc does Fedora 40 have? You can find the version with |
ldd (GNU libc) 2.39 |
Emailed |
This already worked correctly on 64-bit platforms, and on 32-bit platforms with 32-bit time, but was broken on 32-bit platforms with 64-bit time.
decf941
to
8dc12ff
Compare
The behaviour of the 64-bit time macros changed: https://sourceware.org/git/?p=glibc.git;a=commit;h=dd535f4f19ef2b5c367a362af445ecadcf45401e
@ksmurchison Thanks, that was helpful. Looks like this is a libc change rather than a Debian/Fedora thing, turns out the macros for dealing with 64-bit time on 32-bit hardware were changed in libc 2.39. I've updated cunit/timeofday.c again to accommodate this... hopefully! It still works for me with libc 2.36, so I don't think I've broken anything that already worked, but I can't test whether I've actually fixed it for 2.39 or not. Can you try it out again please? Thanks |
@elliefm Looks good on my end |
I spent some time a few months ago trying to track down a variety of build failures on armel, armhf, and some others platforms affected by Debian's transition to providing a 64-bit time_t on these 32-bit platforms (#4876, #4887), but eventually stalled out on a stack smashing problem that seemed to be coming from within libical. @rjbs and I decided that it wasn't worth spending more time chasing the problem around since it makes no sense to run an IMAP service on these sort of devices anyway.
This PR is a distillation of the useful changes I made while investigating.