- Nov 24, 2024
-
-
Fred Wright authored
This provides coverage for the non-UNIX2003 variant on 32-bit platforms. TESTED: Passes on all platforms. Generates expected references.
-
Fred Wright authored
Now that splitandfilterandmergemultiarch and its callers are no longer used (solely to build fdopendir), they can be removed. This also removed the only references to LDX (formerly LD), LIPO, and PLATFORM, so their default definitions are removed as well. TESTED: Build still works (and tests pass) on all platforms.
-
Fred Wright authored
This reworks the fdopendir code to directly build all the needed variants, instead of the horrible splitandfilterandmergemultiarch kludge in the Makefile. Not only does it reduce code duplication, but it also drastically improves readability. It does not change the underlying logic in the "guts", but merely changes the interfacing to the different variants. This was the only use of splitandfilterandmergemultiarch, which will be excised in a subsequent commit. A subtle problem that this introduced is that the empty object filter for the static library was previously failing to filter fdopendir.o due to the way it was constructed, but fixing that resulted in a truly empty static library on 10.15+ platforms. This is actually illegal, so there's now a hack to put one dummy object into the archive in this case. The dummy object defines a single global symbol, thereby avoiding the "has no symbols" warning from 'ar' and other tools. TESTED: Builds and passes all tests (including the new one in a subsequent commit), on all platforms.
-
Fred Wright authored
Referencing the "bare" ar, ld, lipo, and install_name_tool opportunistically uses the MacPorts cctools and ld64 versions, without explicit dependencies. This adds the explicit /usr/bin/ prefix to all but lipo to avoid that. These are still overridable defaults. Since LD and AR are standard make defaults, defaulting them doesn't work. We switch to LDX and ARX to avoid that. The lipo reference is left as is (since the system lipo is inadequate), but is expected to go away in the near future. TESTED: Builds (including tests) on all platforms, with all applicable SDKs.
-
Fred Wright authored
At the time of this writing, fstatat() may choose the wrong variant of stat to return, possibly overflowing the provided buffer. To defend against this, we make the buffer the larger of the two possible sizes, and also move it off the stack for less verbosity when debugging. See the comment in the code. TESTED: All versions pass, including previously crashing ino32 cases.
-
Fred Wright authored
This simply turns the old 'FEEDBACK' compile-time option into a runtime option. Also adds a one-line message on success.
-
Fred Wright authored
This ensures that both 32- and 64-bit inode cases are tested, regardless of the platform default. TESTED: Pass (except known ino32 bug) on all platforms, with all applicable SDKs.
-
Fred Wright authored
Also fixes 32-bit wrapper to use proper config flag, and to disable it on arm64, where it doesn't work. TESTED: Passes on all platforms with all applicable SDKs.
-
Fred Wright authored
The OPT value (default -Os) is included in compile commands, and the DEBUG value is included in both compile and link commands. TESTED: Both default and debug settings work.
-
- Nov 16, 2024
-
-
Fred Wright authored
-
Fred Wright authored
This patched csh script has been replaced by a build of the C version.
-
Fred Wright authored
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.
-
Fred Wright authored
This is used to build a program with the same architecture(s) as a specified program (default /usr/bin/true).
-
Fred Wright authored
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.
-
Fred Wright authored
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.
-
Fred Wright authored
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.
-
Fred Wright authored
TESTED: Message is now correct.
-
Fred Wright authored
This avoids repeatedly looking up the symbol for the OS call. Also cleans up indentation. TESTED: Passes tests on all platforms.
-
Fred Wright authored
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.
-
Fred Wright authored
This avoids repeating the symbol lookup on every call. TESTED: Passes tests on all platforms.
-
Fred Wright authored
-
- Nov 14, 2024
-
-
Fred Wright authored
Although more thorough testing of various path cases would be useful, this one, which just tests a simple nonexistent relative path, is sufficient to demonstrate a bug in the 10.6 non-POSIX realpath(), which returns "success" via an unsafe pointer to an internal buffer. TESTED: Fails in known bad case without the fix; passes in all cases with the fix.
-
Fred Wright authored
This adds our allocating wrapper to the 10.6 non-POSIX case, which returns an unsafe buffer pointer when supplied with a nonexistent path and no buffer. Providing our own malloc()ed buffer avoids the problem. This only affects 32-bit builds, since 64-bit non-POSIX is nonexistent. The original flag is renamed in the process, with the original name now reflecting the combined need for the wrapper. Some whitespace cleanup is also applied to the other composite flag definitions. Updates README to reflect the fix. TESTED: Tests pass on all platforms, including newly added test case (next commit).
-
Fred Wright authored
The rework of the Makefile recipes dropped this, which impacts those test builds for non-default architectures. TESTED: ARCHFLAGS is now honored as intended.
-
- Nov 07, 2024
-
-
Fred Wright authored
The special treatment for 10.4 in splitandfilterandmergemultiarch was not being applied appropriately to x86_64, causing a build failure for fdopendir. Fixing this bug prior to fixing the realpath() wrapper resulted in successfully building code that didn't work correctly, though the realpath() bug wasn't limited to this one configuration. Note that at the time of this writing, when this case is built as a port, the architecture is coerced to i386. Until that is fixed, this fix won't affect the actual port. TESTED: With the realpath() fix, builds successfully on all platforms, including 10.4 x86_64.
-
Fred Wright authored
This tests the macports_legacy_realpath() entry point, which is no longer used by new builds but possibly referenced by old builds. TESTED: Passes on all platforms; fails when the legacy entry is disabled.
-
Fred Wright authored
This excludes testing the non-POSIX version on 10.15, which has a bug (Apple's). Also reverses order of nonposix cases, for consistency, and expands the comment. TESTED: Now passes on all platforms.
-
Fred Wright authored
This ensures that all three versions of realpath() (two in 64-bit builds) have test coverage. The test for the impossible 64-bit non-POSIX case is a dummy. The 10.15 non-POSIX realpath() has a bug (unrelated to legacy-support) causing the relevant test to fail. A subsequent commit excludes that case from the test. This test uncovered real bugs in the former wrapper implementation. TESTED: Without the realpath() fix, fails on 10.5 and on 10.4 with later SDK. With the fix, passes on all platforms (except as noted above).
-
Fred Wright authored
The former implementation didn't necessarily provide all versions of realpath() that might be invoked, and didn't necessarily invoke the proper version. That led to possible crashes and possible unnecessary semantic differences. This fixes all that, though it doesn't retrofit the 10.5+ semantic changes to 10.4 (and neither did the earlier implementation). The former implementation also failed to return any internally allocated buffer on failures, causing a memory leak. That is now fixed as well. TESTED: Builds and passes all tests (including expanded tests) on all platforms, with all applicable SDKs.
-
Fred Wright authored
-
Fred Wright authored
Makes failures more informative, and minimizes output in success case unless -v option is given. Also includes a test for the "traditional" realpath(). TESTED: Provides better information, while still demonstrating the failure on 10.4 x86_64.
-
Fred Wright authored
This provides a tool for investigating the behavior of the different versions of realpath() with specified paths.
-
Fred Wright authored
The recently added test_clean target was initially misisng a couple of items, and became much more deficient with the addition of the new test targets. This fixes all that, as well as removing some redundant entries from the main clean target. TESTED: All build products from test_all are now removed by test_clean.
-
- Nov 04, 2024
-
-
Fred Wright authored
The fix for parallel builds made directories separate targets, but directory dependencies need to be order-only, since their mtimes are updated whenever files are added, removed, or renamed. Failure to do this resulted in intermittent unnecessary rebuilds of libraries when building tests. When building directly in the repo, this is a harmless waste of time, but when building in the MacPorts context, such rebuilds fail due to ownership and permission issues. This change makes directories order-only dependencies, thereby ignoring their mtimes. This also removes unnecessary directory dependencies from the tests that don't use the library. TESTED: Ran tests on all platforms. Intermittent test failures are now gone.
-
Fred Wright authored
This has the same effect as what the Portfile has been doing all along, but in a less kludgy manner. TESTED: Has the desired effect on the sources.
-
Fred Wright authored
The syslib targets run versions of the tests linked against the "system" version of the library, substituting for the normal OS system library. This provides a check that the syslib was built correctly. Targets for all syslib tests and all versions of all tests are added. TESTED: Tests build and pass on all platforms. New targets run all expected tests.
-
Fred Wright authored
Six source files contained "macports_legacy_" prefixes in their filenames, which is redundant and overly verbose. This removes those prefixes. No Makefile adjustment is needed, since it relies on wildcards. TESTED: Build succeeds and tests pass.
-
Fred Wright authored
The result of a function being tested is discarded, which produces a "set but not used" warning from some compilers. We add a void cast to avoid this. TESTED: Previously present warnings are now gone.
-
Fred Wright authored
Creating directories with "install -d" suffers from a race condition, because, although it first-order avoids creating directories that already exist, if multiple instances attempt to create a given directory at the same time, the error due to a collision is not correctly handled. To get around this, we make separate recipes for directory creation, with dependencies on them in the rules that populate them. Unfortunately, this makes the automatic variables useless for some of the populating commands, since they include the directories. In such cases, we need to use explicit variables for the input files. Maintaining the unused ability to put static and dynamic libraries in separate directories (while not actually being separate) would have complicated things, so that capability has been dropped. This special treatment of directories is not applied to the installation of headers, since that's a complicated multi-directory target only used in a single recipe, and hence not vulnerable to parallelism. TESTED: All builds now succeed with parallelism, including those that previously exhibited a failure.
-
Fred Wright authored
The old symbol aliases test relied on looking up symbols with dlsym(), which doesn't work with a statically-linked library. This rewrites it to use ordinary external references, which will fail if the referenced symbols are missing. This means that any errors are build-time errors rather than runtime errors. As noted in the comment, there's theoretically a way to avoid that by using weak references, but we don't bother to wrestle with the added complications of that approach. TESTED: This version passes with both static and dynamic libraries.
-