Merge pull request #150079 from bergkvist/darwin-binary-wrapper-fixes

This commit is contained in:
Doron Behar
2021-12-17 16:51:31 +02:00
committed by GitHub
6 changed files with 18 additions and 10 deletions
-2
View File
@@ -35,8 +35,6 @@ with pkgs;
macOSSierraShared = callPackage ./macos-sierra-shared {};
make-binary-wrapper = callPackage ./make-binary-wrapper { inherit makeBinaryWrapper; };
cross = callPackage ./cross {};
php = recurseIntoAttrs (callPackages ./php {});
+1 -1
View File
@@ -5,7 +5,7 @@
#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0)
int main(int argc, char **argv) {
assert_success(chdir("/tmp/foo"));
assert_success(chdir("./tmp/foo"));
argv[0] = "/send/me/flags";
return execv("/send/me/flags", argv);
}
+1 -1
View File
@@ -1 +1 @@
--chdir /tmp/foo
--chdir ./tmp/foo
+1 -1
View File
@@ -1,2 +1,2 @@
CWD=/tmp/foo
CWD=SUBST_CWD/tmp/foo
SUBST_ARGV0
+2 -2
View File
@@ -1,12 +1,12 @@
{ lib, coreutils, python3, gcc, writeText, writeScript, runCommand, makeBinaryWrapper }:
let
env = { nativeBuildInputs = [ makeBinaryWrapper ]; };
env = { buildInputs = [ makeBinaryWrapper ]; };
envCheck = runCommand "envcheck" env ''
${gcc}/bin/cc -Wall -Werror -Wpedantic -o $out ${./envcheck.c}
'';
makeGoldenTest = testname: runCommand "test-wrapper_${testname}" env ''
mkdir -p /tmp/foo
mkdir -p ./tmp/foo
params=$(<"${./.}/${testname}.cmdline")
eval "makeCWrapper /send/me/flags $params" > wrapper.c
+13 -3
View File
@@ -698,11 +698,21 @@ with pkgs;
--replace " @CC@ " " ${cc}/bin/cc ${san} "
'';
in
makeSetupHook { deps = [ dieHook ]; } script;
makeSetupHook {
deps = [ dieHook cc ];
substitutions.passthru.tests = callPackage ../test/make-binary-wrapper {
makeBinaryWrapper = makeBinaryWrapper.override {
sanitizers = (if stdenv.isDarwin && stdenv.isAarch64
then [ ]
else [ "undefined" "address" ]
);
};
};
} script;
in
lib.makeOverridable f {
cc = stdenv.cc.cc;
sanitizers = [ "undefined" "address" ];
cc = stdenv.cc;
sanitizers = [ ];
};
makeModulesClosure = { kernel, firmware, rootModules, allowMissing ? false }: