Skip to content

glibc: add backwards compatibility for some symbols#15101

Merged
andrewrk merged 2 commits intoziglang:masterfrom
motiejus:glibc_compat
Apr 6, 2023
Merged

glibc: add backwards compatibility for some symbols#15101
andrewrk merged 2 commits intoziglang:masterfrom
motiejus:glibc_compat

Conversation

@motiejus
Copy link
Contributor

This PR makes it possible to use fcntl with glibc 2.27 or older and the res_* functions with glibc 2.33 or older.

These patches will become redundant with universal-headers and can be dropped. But we have to do with what we have now.

Closes #9485

Related: 39083c3

@marler8997
Copy link
Contributor

Besides the test you added, is there anything else we can do to make the upgrade path easier here. Sounds like a pain to upgrade glibc, then have to debug this failing test and try to slueth out that you need to re-apply this diff.

@motiejus
Copy link
Contributor Author

Besides the test you added, is there anything else we can do to make the upgrade path easier here. Sounds like a pain to upgrade glibc, then have to debug this failing test and try to slueth out that you need to re-apply this diff.

Good question. I will make this a bit easier to apply:

  • separate the commit to glibc and the test
  • collect all such commits to a single place, like lib/libc/glibc/ZIG-PATCHES.md. AFAIK we have one right now, this will be the second one.

- `fcntl` was renamed to `fcntl64` in glibc 2.28 (see ziglang#9485)
- `res_{,n}{search,query,querydomain}` became "their own" symbols since
  glibc 2.34: they were prefixed with `__` before.

This PR makes it possible to use `fcntl` with glibc 2.27 or older and
the `res_*` functions with glibc 2.33 or older.

These patches will become redundant with universal-headers and can be
dropped. But we have to do with what we have now.

Closes ziglang#9485
@BratishkaErik
Copy link
Contributor

@andrewrk
Copy link
Member

Besides the test you added, is there anything else we can do to make the upgrade path easier here. Sounds like a pain to upgrade glibc, then have to debug this failing test and try to slueth out that you need to re-apply this diff.

Hello, it's me from the future. It's no problem at all since the documented process tells you to run git log -- lib/libc/glibc lib/libc/include and inspect the commits since the last update, looking for patches to re-apply.

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.

glibc 2.27 or older: fcntl64 not found, but zig's glibc headers refer it

4 participants