Bug 1596341 - Fix nasm putting garbage in the .debug_loc section on elf32. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 14 Nov 2019 20:59:03 +0000
changeset 502049 7a519aeac6438c53c2eec583b75a25f12dbf695c
parent 502048 2d2a7cb4d6ffcfd51552d08b1aff7fb1b04e3430
child 502050 d168bfd2524c7c7c5110b7dcbca2f3671779c9ea
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1596341
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1596341 - Fix nasm putting garbage in the .debug_loc section on elf32. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D52972
taskcluster/scripts/misc/build-nasm.sh
--- a/taskcluster/scripts/misc/build-nasm.sh
+++ b/taskcluster/scripts/misc/build-nasm.sh
@@ -6,16 +6,33 @@ COMPRESS_EXT=bz2
 cd $MOZ_FETCHES_DIR/nasm-*
 case "$1" in
     win64)
         export PATH="$MOZ_FETCHES_DIR/clang/bin:$PATH"
         ./configure CC=x86_64-w64-mingw32-clang AR=llvm-ar RANLIB=llvm-ranlib --host=x86_64-w64-mingw32
         EXE=.exe
         ;;
     *)
+        # Fix for .debug_loc section containing garbage on elf32
+        # https://bugzilla.nasm.us/show_bug.cgi?id=3392631
+        patch -p1 <<'EOF'
+diff --git a/output/outelf.c b/output/outelf.c
+index de99d076..47031e12 100644
+--- a/output/outelf.c
++++ b/output/outelf.c
+@@ -3275,7 +3275,7 @@ static void dwarf_generate(void)
+     WRITELONG(pbuf,framelen-4); /* initial length */
+ 
+     /* build loc section */
+-    loclen = 16;
++    loclen = is_elf64() ? 16 : 8;
+     locbuf = pbuf = nasm_malloc(loclen);
+     if (is_elf32()) {
+         WRITELONG(pbuf,0);  /* null  beginning offset */
+EOF
         ./configure
         EXE=
         ;;
 esac
 make -j$(nproc)
 
 mv nasm$EXE nasm-tmp
 mkdir nasm