-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Introduce 10.13 xnu #273016
base: master
Are you sure you want to change the base?
Introduce 10.13 xnu #273016
Conversation
a833604
to
e3e00a1
Compare
--replace-fail "-Werror " "" | ||
|
||
substituteInPlace SETUP/kextsymboltool/Makefile \ | ||
--replace-fail "-lstdc++" "-lc++ -lc++abi" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: -lc++abi
is not needed.
--replace-fail "-lstdc++" "-lc++ -lc++abi" | |
--replace-fail "-lstdc++" "-lc++" |
tho i think that clang changes -lstdc++
to -lc++
too so the entire substituteInPlace might be unneeded as well as long as the link step is initiated by clang and not ld
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still builds without the substitute but I can't find documentation on this. Do you know where to find some?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't i just stumbled on it. it seems like it is related to the flag -stdlib=xxx
. when -stdlib=libstdc++
no translation is made. -stdlib=libc++
then -lstdc++ -> -lc++
. and perhaps the default is -stdlib=platform
and for darwin seems to be libc++
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some spelunking on this because it doesn't seem to be documented anywhere.
The -lstdc++
flag gets rewritten to OPT_Z_reserved_lib_stdcxx
.
The reserved lib option is handled and depending on the -stdlib
option it can be rewritten as -lc++
.
The `applePackageMapping` function will allow us to keep expressions for the newer releases separate from the originals where necessary, without needing to change `generate-sdk-packages.sh`. If we ever want to support multiple versions of source releases simultaneously we should consider changing that to point to versioned subdirectories of all the packages. Many of the source releases introduced here will need changes to the expression to build successfully. These will be introduced one by one.
Releases with dependencies on other releases, e.g., libresolv depends on Libinfo, mDNSResponder and configdHeaders, were getting those releases from pkgs.darwin rather than pkgs.darwin."10.13.6". By making the scope of callPackage overridable we can manipulate which packages are used to supply dependencies.
Some of the source releases build without changes to their expressions, others require changes or the passing in of exceptional arguments. To avoid evaluation of the entire "10.13.6" subset causing evaluation errors we can include just the functional source releases.
By introducing the new XNU without disturbing the old version, we avoid causing a stdenv rebuild. We can still depend on this new XNU in a new bootstrap-tools and further source releases. I'm doing this in the hope it'll enable smaller reviewable changes rather than needing to understand everything all at once.
e3e00a1
to
6dcca9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM tho i don't have any domain knowledge here. seems to mostly parallel default.nix
We need to raise the `HOST_OS_VERSION` to at least `10.12` according to an `ld` warning. Since we're bumping anyway I don't see a good reason not to bump these all the way to the source releases we'll be packaging.
These are the versions from `AvailabilityVersions/availability.pl` for macOS 10.13.6. The only reason we create the shell script is to avoid a dependency on Perl in the bootstrap. We should consider packaging AvailabilityVersions so the script becomes something that consumes `availability.pl`, that way we don't need to keep the versions synchronized manually.
The `bridgeos(x)` platform function isn't defined in Apple's XNU but it is used in Security, so we implement it here.
Co-authored-by: paparodeo <170618376+paparodeo@users.noreply.github.com>
6dcca9d
to
1f7fee5
Compare
Description of changes
By introducing the new XNU without disturbing the old version, we avoid causing a stdenv rebuild. We can still depend on this new XNU in a new bootstrap-tools and further source releases.
I'm doing this in the hope it'll enable smaller reviewable changes rather than needing to understand everything all at once.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.