-
-
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
Multiple updates - see individual commits #101
Conversation
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.
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.
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.
This simply turns the old 'FEEDBACK' compile-time option into a runtime option. Also adds a one-line message on success.
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.
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.
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.
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.
This provides coverage for the non-UNIX2003 variant on 32-bit platforms. TESTED: Passes on all platforms. Generates expected references.
@mascguy |
No worries, though |
Thanks for the quick review and merge. I wasn't suggesting that there was any reason to hold merged commits back from a -devel update; I was just thinking of the cost/benefit of the "churn" when the number of user-impacting changes is small. I expect the next round to include the |
Notably:
scandir
andfdopendir
fdopendir
test now defends againstfstatat
buffer overrun bug.cctools
andld64
.fdopendir
now handles variants directly, without ugly Makefile kludge.Tested (both from repo and via temp Portfile) on: