sdksyms-no-build-path.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/merge_requests/253]
  2. Signed-off-by: Ross Burton <ross.burton@intel.com>
  3. From ca832598d38ba55a001088b57d73c6d7261dc9a7 Mon Sep 17 00:00:00 2001
  4. From: Ross Burton <ross.burton@intel.com>
  5. Date: Thu, 1 Aug 2019 15:24:51 +0100
  6. Subject: [PATCH] sdksyms.sh: don't embed the build path
  7. This script generates a header that has a comment containing the build path for
  8. no real reason. As this source can end up deployed on targets in debug packages
  9. this means there is both potentially sensitive information leakage about the
  10. build environment, and a source of change for reproducible builds.
  11. ---
  12. hw/xfree86/sdksyms.sh | 7 +++++--
  13. 1 file changed, 5 insertions(+), 2 deletions(-)
  14. diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
  15. index 39e33711d..bdf47a71a 100755
  16. --- a/hw/xfree86/sdksyms.sh
  17. +++ b/hw/xfree86/sdksyms.sh
  18. @@ -302,13 +302,16 @@ LC_ALL=C
  19. export LC_ALL
  20. ${CPP:-cpp} "$@" sdksyms.c > /dev/null || exit $?
  21. ${CPP:-cpp} "$@" sdksyms.c | ${AWK:-awk} -v topdir=$topdir '
  22. +function basename(file) {
  23. + sub(".*/", "", file)
  24. + return file
  25. +}
  26. BEGIN {
  27. sdk = 0;
  28. print("/*");
  29. print(" * These symbols are referenced to ensure they");
  30. print(" * will be available in the X Server binary.");
  31. print(" */");
  32. - printf("/* topdir=%s */\n", topdir);
  33. print("_X_HIDDEN void *xorg_symbols[] = {");
  34. printf("sdksyms.c:") > "sdksyms.dep";
  35. @@ -337,7 +340,7 @@ BEGIN {
  36. # remove quotes
  37. gsub(/"/, "", $3);
  38. line = $2;
  39. - header = $3;
  40. + header = basename($3);
  41. if (! headers[$3]) {
  42. printf(" \\\n %s", $3) >> "sdksyms.dep";
  43. headers[$3] = 1;
  44. --
  45. 2.20.1