Skip to content

Multiple updates - see individual commit messages#130

Open
fhgwright wants to merge 45 commits into
macports:masterfrom
fhgwright:fixes
Open

Multiple updates - see individual commit messages#130
fhgwright wants to merge 45 commits into
macports:masterfrom
fhgwright:fixes

Conversation

@fhgwright

Copy link
Copy Markdown
Contributor

Notably:

  • Provides missing Xplugin.h for 10.4
  • Provides missing CFStringCreateWithBytesNoCopy prototype for 10.4
  • Provides 10.4 context names compatible with 10.5+
  • Supports _DARWIN_C_SOURCE in some 10.4 headers
  • Fixes 10.4 ppc64 signal bug (crashes in SA_SIGINFO case)
  • Fixes incompatible typedefs in 10.4 OpenGL/gl.h
  • Adds & fixes CommonDigest macros for 10.4 and 10.5
  • Fixes some issues with SDK 27

Tested on:

Mac OS X 10.4.11 8S165, ppc, Xcode 2.5 8M2558
Mac OS X 10.4.11 8S165, ppc64, Xcode 2.5 8M2558
Mac OS X 10.4.11 8S2167, i386, Xcode 2.5 8M2558
Mac OS X 10.4.11 8S2167, x86_64, Xcode 2.5 8M2558
Mac OS X 10.4.11 8S2167, ppc (i386 Rosetta), Xcode 2.5 8M2558
Mac OS X 10.5.8 9L31a, ppc, Xcode 3.1.4 9M2809
Mac OS X 10.5.8 9L31a, ppc64, Xcode 3.1.4 9M2809
Mac OS X 10.5.8 9L31a, i386, Xcode 3.1.4 9M2809
Mac OS X 10.5.8 9L31a, x86_64, Xcode 3.1.4 9M2809
Mac OS X 10.5.8 9L31a, ppc (i386 Rosetta), Xcode 3.1.4 9M2809
Mac OS X 10.6.8 10K549, i386, Xcode 3.2.6 10M2518
Mac OS X 10.6.8 10K549, x86_64, Xcode 3.2.6 10M2518
Mac OS X 10.6.8 10K549, ppc (i386 Rosetta), Xcode 3.2.6 10M2518
Mac OS X 10.7.5 11G63, x86_64, Xcode 4.6.3 4H1503
OS X 10.8.5 12F2560, x86_64, Xcode 5.1.1 5B1008
OS X 10.9.5 13F1911, x86_64, Xcode 6.2 6C131e
OS X 10.10.5 14F2511, x86_64, Xcode 7.2 7C68
OS X 10.11.6 15G22010, x86_64, Xcode 8.1 8B62
macOS 10.12.6 16G2136, x86_64, Xcode 9.2 9C40b
macOS 10.13.6 17G14042, x86_64, Xcode 10.1 10B61
macOS 10.14.6 18G9323, x86_64, Xcode 11.3.1 11C505
macOS 10.15.7 19H15, x86_64, Xcode 12.4 12D4e
macOS 11.7.11 20G1443, x86_64, Xcode 13.2.1 13C100
macOS 11.7.11 20G1443, arm64, Xcode 13.2.1 13C100
macOS 12.7.6 21H1320, x86_64, Xcode 14.2 14C18
macOS 12.7.6 21H1320, arm64, Xcode 14.2 14C18
macOS 13.7.8 22H730, arm64, Xcode 15.2 15C500b
macOS 14.8.7 23J520, arm64, Xcode 16.2 16C5032a
macOS 15.7.7 24G720, arm64, Xcode 26.3 17C529
macOS 26.5.1 25F80, arm64, Xcode 26.5 17F42

fhgwright added 30 commits May 8, 2026 21:49
This splits off the __MPLS_TARGET_OSVER definition into a separate
header, to facilitate using it in most places that care about the
build target.  It exempts code that's intended to be similar or
identical to Apple's code, as well as one test specifically
intended to report such macro values.

It also (at present) leaves alone a couple of tests that have not
(yet) been touched recently.

TESTED:
All tests pass on all tested platforms.
The issue fixed by our USB.h actually appeared in gcc 4.3, not 4.5 as
was assumed.

Also reworks the logic to use the correct number of dummy aligns for
the SDK version (since we now know the SDK version), and expands the
comments to explain the issue without having to read the full bug
description.

TESTED:
Passes the test with all available compilers, including GCC 4.3 and
4.4.
This file is missing from the Xcode 2.5 10.4 SDK, but present in the
Xcode 3.1/3.2 versions.  We bring it in here so that the omission can
be corrected.
This adds a wrapper to provide the possibly missing Xplugin.h on 10.4.

TESTED:
New Xplugin test passes on 10.4 with this change.
TESTED:
Correctly detects failing case, and passes with fix.
TESTED:
The tool correctly doesn't add Xplugin.h to [all|rev]headers.h
The function exists in 10.4, but the prototype is missing from the
SDK, so all we need to do is add it.  Note that the 10.4
CoreFoundation library lacks 64-bit slices altogether, so this fix
only works for 32-bit builds.

This does nothing to fix the numerous issues with building against
CoreFoundation with a "mismatched" SDK.

TESTED:
Passes new test on 10.4.
TESTED:
Detects missing prototype (as warning) on 10.4.
Passes on 10.4 with fix, as well as on 10.5+ always.
Also updates allheaders correspondingly.

TESTED:
New test now passes in all cases, including GCC 4.2 and SDK 26.
TESTED:
Detects failing case, and passes with fix.
This adds the (mildly) needed undefs for recently added version
macros.

TESTED:
Tests pass on all platforms.
This provides a macro structure for contexts similar to 10.5+, as well
as adding aliases for the double-underscore versions of many field
names.  Since the latter has some (probably low) risk of collisions,
the _MACPORTS_LEGACY_DISABLE_CONTEXT_ALIASES flag is provided to
disable that aspect.

The net result is that most programs built with these headers don't
need to treat 10.4 differently than 10.5+

TESTED:
All tests (including new context test) pass on all tested platforms.
TESTED:
Passes updated test on all tested platforms, including 10.4.
Since the __dd_* aliases are now provided by dirent.h for 10.4,
the definitions in the two uses are obsolete.

TESTED:
Still builds and passes tests.
This provides a flag in sdkversion.h for the troublesome case of
_DARWIN_C_SOURCE on 10.4, as well as some derivative flags for common
use cases.

Fixes are currently applied to pthread.h, time.h, and dirent.h.

See: https://trac.macports.org/ticket/72407

TESTED:
New test passes on all tested platforms, including 10.4.
TESTED:
All new targets work.
Currently this tests pthread.h, time.h, and dirent.h.

TESTED:
Without fixes, fails as expected on 10.4.
Otherwise, passes on all tested platforms.
TESTED:
Detects failures on 10.4 without fix.
Otherwise passes on all tested platforms.
This makes the sources part of the library build in the case requiring
the bugfixes, but does not include the actual bugfixes.

The fixes in question are theoretically applicable to ppc as well as
ppc64, but since no failures have been observed on ppc, we limit their
use to ppc64.

TESTED:
New code appears in library when expected.
TESTED:
New signals test now passes on 10.4 ppc64.
This tests some basic signal handling cases, including the ones
that crash on 10.4 ppc64.

TESTED:
Detects failure on 10.4 ppc64 without fix; otherwise passes.
TESTED:
Now builds (and tests pass) with 10.5 SDK, as well as 10.4.
10.6+ is irrelevant, due to lack of ppc64 support.
In 10.4, this checks both the existence and correctness of the field
name aliases.  In 10.5+, it merely checks the existence of the normal
names.

TESTED:
Detects both missing and incorrect names in 10.4, without correct fix.
Passes on all tested platforms otherwise.
This switches to the more recent and more reliable SDK version
detection method.

It also uses our more standard naming for its flag macro.

TESTED:
All tests pass, though there's no specific test for this header.
Apple provides "AGL" as their version of OpenGL (prior to 10.7).  In
many cases (including this one), the AGL file is just a symlink to its
OpenGL counterpart.  To make this fix work in the AGL case, we
duplicate the wrapper header with the one obvious adjustment.

Also adds AGL to the allheaders.sh exemption list.

TESTED:
All tests pass,	though there's no specific test	for this header.
This brings in the OpenGL header with the original 10.4 typedefs, as
well as creating the corresponding symlink for its "AGL" version.  It
comes from the 10.4 SDK.

This header has five typedefs which are inconsistent with subsequent
versions.  They will be fixed in a subsequent commit.
A few types are defined differently in 10.4 than in later versions.
This sometimes causes trouble for programs expecting the 10.5+
definitions.  This changes those types to match 10.5+.

TESTED:
With corresponding wrapper headers, passes new test on 10.4.
fhgwright added 15 commits June 18, 2026 13:04
This adds a header to either substitute an updated version of the
10.4 header or pass through a 10.5+ header.

It applies the same treatment to AGL.

TESTED:
Passes new test, including on 10.4.
This tests the OpenGL types that changed between 10.4 and 10.5.

It also tests the AGL version, where applicable.

TESTED:
Fails on 10.4 without fix.
Otherwise, passes on all tested platforms.
This works around the ugly version spoofing hack in 11.x+ OS
versions.  See the comment.

TESTED:
Now reports correct OS versions, including in spoofing cases.
This adds the missing macros for SHA256, SHA384, AND SHA512, as
provided by the 10.5+ header.

Also updates [all|rev]headers.h.

TESTED:
New test passes on all tested platforms, including 10.4.
Provides _MACPORTS_LEGACY_DISABLE_ARGLESS_DIGEST to disable this
behavior if it's unwanted.

TESTED:
Passes new test on all tested platforms, including 10.4 and 10.5.
This tests the definitions that are normally missing from 10.4.

TESTED:
Fails as expected on 10.4 without the fix.
Otherwise passes on all tested platforms.
This didn't work with the "function" macros used in the pre-10.6
header.  This test verifies that our update works.

TESTED:
Passes on all tested platforms, including 10.4 and 10.5.
Makes the usual adjustments for a new SDK version.

TESTED:
Passes all tests with default compilers.
Needs fix (next commit) for clang 6-15.
This avoids build failures with clang 6-15.

TESTED:
Passes tests with all available compilers, including clang 6-15.
TESTED:
Passes tests with all available compilers, including clang 6-15.
Avoids warnings except in "bare" include case with clang 6-15.
TESTED:
Tests pass on all tested platforms.
TESTED:
Passes on all tested platforms.
This now includes TargetConditionals.h before all other includes, to
test cases where it doesn't benefit from earlier includes (such as the
__is_target_environment()) workaround.

TESTED:
Passes on all tested platforms.
Demonstrates unnecessary workaround prior to SDK 27.
This is probably a long-standing bug exacerbated by having the test
include this header before all others.

TESTED:
Tests pass on all tested platforms.
@fhgwright

Copy link
Copy Markdown
Contributor Author

@mascguy
Here's a long-overdue batch of updates. Since these are mostly 10.4-related, it probably doesn't make sense to make a -devel port for this round, but there's no reason not to update the source. Unless you'd prefer an even bigger batch later. :-) Everything here is fully tested, as usual.

This is almost entirely just header and test changes. In fact, I was originally planning for this batch to be entirely headers (and tests), but the nasty 10.4 ppc64 bug got in the way of testing the context changes, so I fixed that. So the only library change is for 10.4 ppc64.

@fhgwright

Copy link
Copy Markdown
Contributor Author

@mascguy
I forgot to mention - this imports a few Apple sources. In such cases, I did verbatim imports separately from their modifications, for easier reviewing. About half of the added code lines are imports.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant