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

toolchain: add API guard for timezone_t #21120

Merged
merged 2 commits into from
Aug 20, 2024
Merged

toolchain: add API guard for timezone_t #21120

merged 2 commits into from
Aug 20, 2024

Conversation

licy183
Copy link
Member

@licy183 licy183 commented Aug 14, 2024

Closes #21113

@Grimler91
Copy link
Member

I guess this issue is not specific to termux, i.e. should we report it to android/ndk team?

@gouravkhunger
Copy link
Contributor

Looks like this PR does fix the issue. Thank you!

@truboxl
Copy link
Contributor

truboxl commented Aug 14, 2024

I guess this issue is not specific to termux, i.e. should we report it to android/ndk team?

Ya I think so. Looking at https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/include/time.h blame seems intentional for the breaking. Maybe we can get some other ideas / workaround. This PR works too.

@TomJo2000
Copy link
Member

TomJo2000 commented Aug 16, 2024

Heads up, it seems like this also effects cpio from what I can tell as part of the NDK 27 build testing I'm currently doing.

Here's the relavant part of the log file.
~/.termux-build/_buildall-aarch64/cpio.out

In file included from /home/builder/.termux-build/tar/src/gnu/fprintftime.c:19:
/home/builder/.termux-build/tar/src/gnu/nstrftime.c:1189:17: error: call to undeclared function 'mktime_z'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 1189 |             t = mktime_z (tz, &ltm);
      |                 ^
/home/builder/.termux-build/tar/src/gnu/nstrftime.c:1189:17: note: did you mean 'mktime'?
/home/builder/.termux-build/_cache/android-r27-api-24-v0/bin/../sysroot/usr/include/time.h:159:8: note: 'mktime' declared here
  159 | time_t mktime(struct tm* _Nonnull __tm);
      |        ^
  CC       libgnu_a-group-member.o
1 error generated.
  CC       libgnu_a-hard-locale.o
make[4]: *** [Makefile:4628: libgnu_a-fprintftime.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory '/home/builder/.termux-build/tar/build/gnu'
make[3]: *** [Makefile:7657: all-recursive] Error 1
make[3]: Leaving directory '/home/builder/.termux-build/tar/build/gnu'
make[2]: *** [Makefile:2975: all] Error 2
make[2]: Leaving directory '/home/builder/.termux-build/tar/build/gnu'
make[1]: *** [Makefile:1882: all-recursive] Error 1
make[1]: Leaving directory '/home/builder/.termux-build/tar/build'
make: *** [Makefile:1822: all] Error 2

After some prodding from Biswa, it looks like tar and dart also also experiencing the exact same problem.

@fornwall
Copy link
Member

I think this PR makes sense and should be ready to merge.

Then we can propose it at https://github.com/android/ndk/issues (do you want to do that @licy183)?

@TomJo2000
Copy link
Member

This seems to be effecting everything that depends on coreutils, I'll spare you the list.

It would be good to get this resolved soon.
Since by my current count this issue accounts for 36 out of the 148 build problems I've found so far as part of the rebuilds.

@truboxl
Copy link
Contributor

truboxl commented Aug 18, 2024

I am thinking of adding mktime_z and friends instead...

@licy183
Copy link
Member Author

licy183 commented Aug 18, 2024

Emmm.... These symbols exist in too many packages (almost every package depending on gnulib) and libandroid-timezone (possible name) will have to be linked against explicitly in all of them.

Anyway, adding them makes sense if some package must use them.

@fornwall
Copy link
Member

I think this is fine to merge, as it basically adds back the behaviour from earlier NDK versions, where timezone_t was not detected - a potential libandroid-timezone addition (if necessary) can come later as a separate PR.

@licy183
Copy link
Member Author

licy183 commented Aug 20, 2024

Yeah. I'll merge this now. libandroid-timezone can be added in a seperate PR.

@licy183 licy183 merged commit be322af into master Aug 20, 2024
7 checks passed
@licy183 licy183 deleted the issue-21113 branch August 20, 2024 13:23
TomJo2000 referenced this pull request in termux/termux-tools Aug 21, 2024
Co-authored-by: 5ec1cff <ewtqyqyewtqyqy@gmail.com>
Co-authored-by: Henrik Grimler <henrik@grimler.se>
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

Successfully merging this pull request may close these issues.

[Bug]: Failed to build package 'coreutils'
6 participants