[disco/master-next 9/9] UBUNTU: [Packaging] dkms-build--nvidia-N -- remove GCC versions
Andy Whitcroft
apw at canonical.com
Tue Mar 12 15:57:19 UTC 2019
Builds contain gcc version markers which trigger a binary delta in the
resulting *.ko files. Remove these as we build to reduce irrelevant delta.
Obviously it is possible the compiler version is a different length and
a 'invalid' missmatch will occur, it is also possible the (different)
compiler could generate different code. In these cases we will still
throw a missmatch.
BugLink: http://bugs.launchpad.net/bugs/1764792
Signed-off-by: Andy Whitcroft <apw at canonical.com>
---
debian/scripts/dkms-build--nvidia-N | 13 ++++++++++++-
debian/scripts/fix-filenames.c | 1 -
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/debian/scripts/dkms-build--nvidia-N b/debian/scripts/dkms-build--nvidia-N
index ee05d575af6d..27da4ca7ecdb 100755
--- a/debian/scripts/dkms-build--nvidia-N
+++ b/debian/scripts/dkms-build--nvidia-N
@@ -20,7 +20,18 @@ build="$( dirname "$objects" )/build"
# any retpoline sequences therein. For our purposes we only want the *.o
# files, elide the rest.
mkdir -p "$pkgdir/bits/scripts"
-(cd "$objects" && find -name \*.o | cpio -Lpd "$pkgdir/bits")
+(
+ gcc_variant1=$(gcc --version | head -1 | sed -e 's/^gcc/GCC:/')
+ gcc_variant2=$(gcc --version | head -1 | sed -e 's/^\(gcc\) \((.*)\) \(.*\)$/\1 version \3 \2/')
+ cd "$objects" || exit 1
+ find -name \*.o | \
+ while read file
+ do
+ cp --parents "$file" "$pkgdir/bits"
+ "$srcdir/debian/scripts/fix-filenames" "$pkgdir/bits/$file" "$gcc_variant1"
+ "$srcdir/debian/scripts/fix-filenames" "$pkgdir/bits/$file" "$gcc_variant2"
+ done
+)
# Install the support files we need.
cp "$srcdir/scripts/module-common.lds" "$pkgdir/bits/scripts"
diff --git a/debian/scripts/fix-filenames.c b/debian/scripts/fix-filenames.c
index f1367922655c..9bd144a6efa8 100644
--- a/debian/scripts/fix-filenames.c
+++ b/debian/scripts/fix-filenames.c
@@ -48,7 +48,6 @@ main(int argc, char *argv[])
exit(1);
}
size = in_info.st_size;
- printf("%s %ld bytes\n", in_name, size);
in = mmap((void *)0, size, PROT_READ|PROT_WRITE, MAP_SHARED, in_fd, (off_t)0);
if (!in) {
--
2.20.1
More information about the kernel-team
mailing list