Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
lsof: Don't record compiler flags / build kernel
Browse files Browse the repository at this point in the history
This removed glibc.dev from the closure and improves binary
reproducibility.
  • Loading branch information
edolstra committed Oct 8, 2018
1 parent a3382a8 commit 1eff910
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/development/tools/misc/lsof/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stdenv.mkDerivation rec {

unpackPhase = "tar xvjf $src; cd lsof_*; tar xvf lsof_*.tar; sourceRoot=$( echo lsof_*/); ";

patches = stdenv.lib.optional stdenv.isDarwin ./darwin-dfile.patch;
patches = [ ./no-build-info.patch ] ++ stdenv.lib.optional stdenv.isDarwin ./darwin-dfile.patch;

postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
substituteInPlace dialects/linux/dlsof.h --replace "defined(__UCLIBC__)" 1
Expand Down
43 changes: 43 additions & 0 deletions pkgs/development/tools/misc/lsof/no-build-info.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff -ru -x '*~' lsof_4.91_src-orig/usage.c lsof_4.91_src/usage.c
--- lsof_4.91_src-orig/usage.c 2018-02-14 15:20:32.000000000 +0100
+++ lsof_4.91_src/usage.c 2018-10-08 21:57:45.718560869 +0200
@@ -930,26 +930,6 @@
(void) fprintf(stderr, " configuration info: %s\n", cp);
#endif /* defined(LSOF_CINFO) */

- if ((cp = isnullstr(LSOF_CCDATE)))
- (void) fprintf(stderr, " constructed: %s\n", cp);
- cp = isnullstr(LSOF_HOST);
- if (!(cp1 = isnullstr(LSOF_LOGNAME)))
- cp1 = isnullstr(LSOF_USER);
- if (cp || cp1) {
- if (cp && cp1)
- cp2 = "by and on";
- else if (cp)
- cp2 = "on";
- else
- cp2 = "by";
- (void) fprintf(stderr, " constructed %s: %s%s%s\n",
- cp2,
- cp1 ? cp1 : "",
- (cp && cp1) ? "@" : "",
- cp ? cp : ""
- );
- }
-
#if defined(LSOF_BLDCMT)
if ((cp = isnullstr(LSOF_BLDCMT)))
(void) fprintf(stderr, " builder's comment: %s\n", cp);
@@ -959,12 +939,8 @@
(void) fprintf(stderr, " compiler: %s\n", cp);
if ((cp = isnullstr(LSOF_CCV)))
(void) fprintf(stderr, " compiler version: %s\n", cp);
- if ((cp = isnullstr(LSOF_CCFLAGS)))
- (void) fprintf(stderr, " compiler flags: %s\n", cp);
if ((cp = isnullstr(LSOF_LDFLAGS)))
(void) fprintf(stderr, " loader flags: %s\n", cp);
- if ((cp = isnullstr(LSOF_SYSINFO)))
- (void) fprintf(stderr, " system info: %s\n", cp);
(void) report_SECURITY(" ", ".\n");
(void) report_WARNDEVACCESS(" ", "are", ".\n");
(void) report_HASKERNIDCK(" K", "is");

0 comments on commit 1eff910

Please sign in to comment.