Skip to content

Check for build environment instead of just _GNU_SOURCE#4463

Merged
Cyan4973 merged 1 commit into
facebook:devfrom
brad0:gnu_source_qsort
Aug 21, 2025
Merged

Check for build environment instead of just _GNU_SOURCE#4463
Cyan4973 merged 1 commit into
facebook:devfrom
brad0:gnu_source_qsort

Conversation

@brad0

@brad0 brad0 commented Aug 19, 2025

Copy link
Copy Markdown
Contributor

Fixes the build on OpenBSD and NetBSD. It is too easy for _GNU_SOURCE
to be defined even on non-Linux systems. Found via py-zstandard with
the embedded copy of zstandard and Python defines _GNU_SOURCE.

Also simplify the Linux checking, there is no need to check the rest
of the symbol names.

@meta-cla meta-cla Bot added the CLA Signed label Aug 19, 2025
@brad0
brad0 force-pushed the gnu_source_qsort branch 2 times, most recently from 68f678e to bb7ab0a Compare August 19, 2025 13:56
@Cyan4973 Cyan4973 self-assigned this Aug 19, 2025
@Cyan4973

Copy link
Copy Markdown
Contributor

The proposed change seems to be problematic for Android environment.

@brad0
brad0 force-pushed the gnu_source_qsort branch from bb7ab0a to 8dc984d Compare August 19, 2025 23:53
@brad0

brad0 commented Aug 19, 2025

Copy link
Copy Markdown
Contributor Author

The proposed change seems to be problematic for Android environment.

Yes, I should have noticed that the first time around.

Fixes the build on OpenBSD and NetBSD. It is too easy for _GNU_SOURCE
to be defined even on non-Linux systems. Found via py-zstandard with
the embedded copy of zstandard and Python defines _GNU_SOURCE.

Also simplify the Linux checking, there is no need to check the rest
of the symbol names.
@brad0
brad0 force-pushed the gnu_source_qsort branch from 8dc984d to 0d1f8de Compare August 20, 2025 00:06
@Cyan4973
Cyan4973 merged commit 290e692 into facebook:dev Aug 21, 2025
103 checks passed
@brad0
brad0 deleted the gnu_source_qsort branch August 22, 2025 09:26
brad0 added a commit to brad0/python-zstandard that referenced this pull request Aug 22, 2025
This change reflects a cherry-pick of the following upstream
commit from facebook/zstd#4463:

* 0d1f8de9addeb2fcb53f1a6a68ef4ac505253c0e

This commit is necessary to fix building on OpenBSD and NetBSD.
Python sets _GNU_SOURCE breaking the build.
indygreg pushed a commit to indygreg/python-zstandard that referenced this pull request Aug 23, 2025
This change reflects a cherry-pick of the following upstream
commit from facebook/zstd#4463:

* 0d1f8de9addeb2fcb53f1a6a68ef4ac505253c0e

This commit is necessary to fix building on OpenBSD and NetBSD.
Python sets _GNU_SOURCE breaking the build.

Closes #272.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants