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

Several updates - see individual commits #100

Merged
merged 12 commits into from
Nov 16, 2024
Merged

Conversation

fhgwright
Copy link
Contributor

Notably:

  • Caches dlsym() results in most remaining cases.
  • Replacement which for 10.4 is now 10.5+ version.

Tested, both from repo and via Portfile, on:

Mac OS X 10.4.11 8S165, PPC, Xcode 2.5 8M2558
Mac OS X 10.4.11 8S2167, i386, Xcode 2.5 8M2558
Mac OS X 10.5.8 9L31a, PPC, 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.10 20G1427, x86_64, Xcode 13.2.1 13C100
macOS 11.7.10 20G1427, 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.1 22H221, arm64, Xcode 15.2 15C500b
macOS 14.7.1 23H222, arm64, Xcode 16.1 16B40
macOS 15.1 24B83, arm64, Xcode 16.1 16B40

This avoids repeating the symbol lookup on every call.

TESTED:
Passes tests on all platforms.
It's a silly waste of time to use the string-lookup version of
sysconf() rather than using the numeric version, even though that's
what Apple's code does.

Also adds comment explaining 32-bit issues.

Also, since the "i386" bug in Apple's code is really a 32-bit bug, the
feature-flag condition is adjusted to be more honest.  This has no
actual effect, since i386 is the only supported 32-bit processor in
the relevant OS versions.  This removes the only reference to
__MPLS_APPLE_I386__, but the definition is retained in case it's
useful in the future.

TESTED:
Passes tests on all platforms.
This avoids repeatedly looking up the symbol for the OS call.

Also cleans up indentation.

TESTED:
Passes tests on all platforms.
This creates a simple Makefile for C programs, with architecture(s)
derived from macports.conf.

TESTED:
Makefile has proper architectures with all options on all platforms.
This brings in the sources for Apple's 10.5 C-based 'which' (from
FreeBSD), verbatim @shell_cmds-116.  A future commit will use them.
Provides a dummy definition of __FBSDID to avoid compile errors,
without deleting the ID string inherited from FreeBSD.

TESTED:
Builds now work on 10.4, including universal builds where applicable.
This is used to build a program with the same architecture(s) as
a specified program (default /usr/bin/true).
Unlike the 10.5+ 'which' command, which is a C program, the
OS-supplied 10.4 version is a csh script, with some deficiencies.
Since 2019, legacy-support has been supplying a patched version
of the csh script correcting some, but not all, deficiencies.  In
particular, the replacement version doesn't implement the '-a'
option, without providing an informative error message.

This change replaces the patched csh script with a build of the
10.5 version.  For consistency, it has the same universality as
the Apple-supplied programs, regardless of whether legacy-support
is being built universal in general.  Specifically, it uses the
new binarchs tool to copy the architectures from /usr/bin/true,
since full universal builds don't work on 10.4 ppc.

TESTED:
Built and tested with all option combinations.
Tested the updated install target.
This patched csh script has been replaced by a build of the C version.
@mascguy mascguy merged commit 42217f1 into macports:master Nov 16, 2024
@fhgwright
Copy link
Contributor Author

@mascguy
I was going to comment further here, but I see the PR is already merged. :-)

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.

2 participants