Merge pull request #150079 from bergkvist/darwin-binary-wrapper-fixes
This commit is contained in:
@@ -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 {});
|
||||
|
||||
@@ -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 @@
|
||||
--chdir /tmp/foo
|
||||
--chdir ./tmp/foo
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
CWD=/tmp/foo
|
||||
CWD=SUBST_CWD/tmp/foo
|
||||
SUBST_ARGV0
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 }:
|
||||
|
||||
Reference in New Issue
Block a user