-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Mostly SDK-related changes, including __DARWIN_C_LEVEL stuff #92
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This makes the hack to handle "earlier" SDKs conditional on providing MACPORTS_LEGACY_MIN_EARLY_SDK_ALLOWED to specify the earliest such SDK supported. See the comments for more details. Also adds code to ensure that the required version macros are defined in 11.x+ SDKs, even with _POSIX_C_SOURCE defined. See the comments for more details. Also adds another if/elif entry for the upcoming OS/SDK version. TESTED: Builds and passes tests on all platforms, including allowable "later" mismatched SDK cases. The checksdkversion test passes in both "earlier" and "later" cases, with "earlier" only being recognized when allowed by the new option.
This makes the sdkversion.h->AvailabilityMacros.h->Availability.h path behave more like some programs might expect. Because it now allows the include, AvailabilityInternal.h also needs the fix for the "recursion" case. TESTED: Builds and passes tests on all platforms, including with mismatched SDK cases where allowed.
This is needed to ensure that the __DARWIN_C_* definitions are available with SDKs prior to 10.7. Also adds a test for the effects of __DARWIN_C_LEVEL, initially just as a test that the three macros are defined. Also adds a new manual test, which simply reports the values of the relevant macros. Re: https://trac.macports.org/ticket/69688 TESTED: Test fails without the new sys/cdefs.h, and passes with it. Manual test reports as expected.
This reworks the flags that interact with __DARWIN_C_LEVEL conditionals, to allow proper testing with different SDKs. Re: https://trac.macports.org/ticket/69867 Also fixes a warning and cleans up some whitespace in sys/stat.h. TESTED: Builds and passes tests on all platforms, including with allowable mismatched SDK cases.
Some constant definitions were wrapped in #ifndef/#endif to defend against the possibility of building with a later SDK that provided those definitions. But in cases where a proper SDK version conditional is used, this is redundant. TESTED: Builds and passes tests on all platforms, including with allowable mismatched SDK cases.
The assumed SDK version derived from the OS version may include the minor component, which wasn't being handled correctly. Also fixes a couple of warnings. TESTED: No longer gives false errors with nonzero minor versions. No longer generates warnings in -Weverything mode.
Also corrects misnamed feature flag for lchmod(). Also removes unnecessary feature flags for AI_NUMERICSERV and PTHREAD_RWLOCK_*. Also removes unnecessary #includes where not needed for unnecessary feature flags. Also renames guard macro in dirfuncs_compat.h to avoid confusion with feature flags. Re: https://trac.macports.org/ticket/69867 TESTED: Builds and passes tests on all platforms, including with allowable mismatched SDK cases.
TESTED: Builds and passes tests on all platforms.
The old method of deriving sysconf wrapper needs from ifndefs was incompatible with SDK flexibility. This sets up the usual SDK/lib flags, referenced to the appropriate OS versions (and the i386 fix). See: https://trac.macports.org/ticket/69867 TESTED: Builds and passes tests on all platforms.
Also adds a tool to extract the macro list from an SDK. Closes: https://trac.macports.org/ticket/69867 TESTED: Builds and passes tests on all platforms. Version macros are absent where appropriate in the darwin_c tests.
This reduces the output in the success case to a single line, unless the -v option is given.
This adds conditionals on __DARWIN_C_LEVEL matching the ones in the SDK headers that provide the relevant functions. These conditionals exist to allow building against an older version of the standard, without risk of collisions between recently added functions and same-named functions in the project. This change extends that behavior to the functions provided by legacy-support. Since sys/stdio.h is unavailable prior to 10.7, our sys/stdio.h includes sys/cdefs.h in that case to get the __DARWIN_C_* defs. Closes: https://trac.macports.org/ticket/69688 Also makes a couple of cosmetic cleanups to affected headers. TESTED: Builds and passes tests on all platforms, including the new tests for the various __DARWIN_C_LEVEL cases.
See: https://trac.macports.org/ticket/69688 TESTED: Without the fixes, all tests get expected errors with the given SDK selection. With the fixes, all tests pass in all cases.
@mascguy |
Merged
mascguy
approved these changes
Jul 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See the individual commit messages for more details.
Tested on:
The
checksdkversion
anddarwin_c_all
tests were run on all combinations of OS/CPU and SDK, excluding cases where the SDK is incompatible with the CPU. The main test suite was run on all OS/CPU/SDK combinations where the SDK version is no earlier than the OS version, again excluding CPU-incompatible SDKs.