about summary refs log tree commit diff
path: root/src/ci/docker/scripts
diff options
context:
space:
mode:
authorMarco A L Barbosa <malbarbo@gmail.com>2018-01-03 13:24:56 -0200
committerMarco A L Barbosa <malbarbo@gmail.com>2018-01-03 13:49:13 -0200
commit00b54130874b6a6541626b9b023948440fe11141 (patch)
tree3eb73504ecf688b5ce2ac22272b0c78b906aa6d4 /src/ci/docker/scripts
parent10a759130e763206bb961deb4c9da6e0466c71a1 (diff)
downloadrust-00b54130874b6a6541626b9b023948440fe11141.tar.gz
rust-00b54130874b6a6541626b9b023948440fe11141.zip
ci: use musl shared script in dist-i586-gnu-i686-musl
Diffstat (limited to 'src/ci/docker/scripts')
-rw-r--r--src/ci/docker/scripts/musl.sh37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/ci/docker/scripts/musl.sh b/src/ci/docker/scripts/musl.sh
index dad0e8e2c2b..b704e37d592 100644
--- a/src/ci/docker/scripts/musl.sh
+++ b/src/ci/docker/scripts/musl.sh
@@ -39,7 +39,11 @@ fi
 
 cd $MUSL
 ./configure --disable-shared --prefix=/musl-$TAG $@
-hide_output make -j$(nproc)
+if [ "$TAG" = "i686" ]; then
+  hide_output make -j$(nproc) AR=ar RANLIB=ranlib
+else
+  hide_output make -j$(nproc)
+fi
 hide_output make install
 hide_output make clean
 
@@ -50,6 +54,37 @@ LLVM=39
 if [ ! -d libunwind-release_$LLVM ]; then
   curl -L https://github.com/llvm-mirror/llvm/archive/release_$LLVM.tar.gz | tar xzf -
   curl -L https://github.com/llvm-mirror/libunwind/archive/release_$LLVM.tar.gz | tar xzf -
+  # Whoa what's this mysterious patch we're applying to libunwind! Why are we
+  # swapping the values of ESP/EBP in libunwind?!
+  #
+  # Discovered in #35599 it turns out that the vanilla build of libunwind is not
+  # suitable for unwinding i686 musl. After some investigation it ended up
+  # looking like the register values for ESP/EBP were indeed incorrect (swapped)
+  # in the source. Similar commits in libunwind (r280099 and r282589) have noticed
+  # this for other platforms, and we just need to realize it for musl linux as
+  # well.
+  #
+  # More technical info can be found at #35599
+  cd libunwind-release_$LLVM
+  patch -Np1 << EOF
+diff --git a/include/libunwind.h b/include/libunwind.h
+index c5b9633..1360eb2 100644
+--- a/include/libunwind.h
++++ b/include/libunwind.h
+@@ -151,8 +151,8 @@ enum {
+   UNW_X86_ECX = 1,
+   UNW_X86_EDX = 2,
+   UNW_X86_EBX = 3,
+-  UNW_X86_EBP = 4,
+-  UNW_X86_ESP = 5,
++  UNW_X86_ESP = 4,
++  UNW_X86_EBP = 5,
+   UNW_X86_ESI = 6,
+   UNW_X86_EDI = 7
+ };
+fi
+EOF
+  cd ..
 fi
 
 mkdir libunwind-build