sdksyms.sh: don't embed the build path

This script generates a header that has a comment containing the build path for
no real reason.  As this source can end up deployed on targets in debug packages
this means there is both potentially sensitive information leakage about the
build environment, and a source of change for reproducible builds.
This commit is contained in:
Ross Burton 2019-08-01 15:24:51 +01:00 committed by Adam Jackson
parent b7dae57f1d
commit 6f41bf3105

View File

@ -302,13 +302,16 @@ LC_ALL=C
export LC_ALL export LC_ALL
${CPP:-cpp} "$@" sdksyms.c > /dev/null || exit $? ${CPP:-cpp} "$@" sdksyms.c > /dev/null || exit $?
${CPP:-cpp} "$@" sdksyms.c | ${AWK:-awk} -v topdir=$topdir ' ${CPP:-cpp} "$@" sdksyms.c | ${AWK:-awk} -v topdir=$topdir '
function basename(file) {
sub(".*/", "", file)
return file
}
BEGIN { BEGIN {
sdk = 0; sdk = 0;
print("/*"); print("/*");
print(" * These symbols are referenced to ensure they"); print(" * These symbols are referenced to ensure they");
print(" * will be available in the X Server binary."); print(" * will be available in the X Server binary.");
print(" */"); print(" */");
printf("/* topdir=%s */\n", topdir);
print("_X_HIDDEN void *xorg_symbols[] = {"); print("_X_HIDDEN void *xorg_symbols[] = {");
printf("sdksyms.c:") > "sdksyms.dep"; printf("sdksyms.c:") > "sdksyms.dep";
@ -337,7 +340,7 @@ BEGIN {
# remove quotes # remove quotes
gsub(/"/, "", $3); gsub(/"/, "", $3);
line = $2; line = $2;
header = $3; header = basename($3);
if (! headers[$3]) { if (! headers[$3]) {
printf(" \\\n %s", $3) >> "sdksyms.dep"; printf(" \\\n %s", $3) >> "sdksyms.dep";
headers[$3] = 1; headers[$3] = 1;