Ticket #20439: 0001-Bug-20439-Add-options-to-make-the-build-PIE-on-OSX.patch

File 0001-Bug-20439-Add-options-to-make-the-build-PIE-on-OSX.patch, 2.4 KB (added by boklm, 3 years ago)
  • gitian/descriptors/mac/gitian-firefox.yml

    From 47045e2a9b5cfea712d6442ccdcec8448b227249 Mon Sep 17 00:00:00 2001
    From: Nicolas Vigier <boklm@torproject.org>
    Date: Mon, 24 Oct 2016 01:18:26 +0200
    Subject: [PATCH] Bug 20439: Add options to make the build PIE on OSX
    
    ---
     gitian/descriptors/mac/gitian-firefox.yml | 13 +++++++++++++
     gitian/patches/mac-pie.patch              | 13 +++++++++++++
     2 files changed, 26 insertions(+)
     create mode 100644 gitian/patches/mac-pie.patch
    
    diff --git a/gitian/descriptors/mac/gitian-firefox.yml b/gitian/descriptors/mac/gitian-firefox.yml
    index 7461031..fb906e9 100644
    a b files: 
    2424- "dzip.sh"
    2525- "fix-info-plist.py"
    2626- "versions"
     27- "mac-pie.patch"
    2728script: |
    2829  INSTDIR="$HOME/install/"
    2930  source versions
    script: | 
    4041  tar xaf ../MacOSX10.7.sdk.tar.gz
    4142  tar xaf ../cctools.tar.gz
    4243  unzip ../clang-linux64-wheezy-utils.zip
     44  mv clang/bin/clang clang/bin/clang.real
     45  mv clang/bin/clang++ clang/bin/clang++.real
     46  cat > clang/bin/clang << EOF
     47  #!/bin/sh
     48  exec $(pwd)/clang/bin/clang.real -fPIE "\$@"
     49  EOF
     50  cat > clang/bin/clang++ << EOF
     51  #!/bin/sh
     52  exec $(pwd)/clang/bin/clang++.real -fPIE "\$@"
     53  EOF
     54  chmod +x clang/bin/clang clang/bin/clang++
    4355  TB_COMMIT_DATE=$(git show -s --format='%ci')
    4456  COPYRIGHT_YEAR=${TB_COMMIT_DATE%%-*}
     57  patch -p1 < ~/build/mac-pie.patch
    4558  mv .mozconfig-mac .mozconfig
    4659  # run get-moz-build-date before removing .git, which is used to get the year
    4760  chmod +x ~/build/get-moz-build-date
  • new file gitian/patches/mac-pie.patch

    diff --git a/gitian/patches/mac-pie.patch b/gitian/patches/mac-pie.patch
    new file mode 100644
    index 0000000..f66c4bb
    - +  
     1diff --git a/.mozconfig-mac b/.mozconfig-mac
     2index 96f036a..cda309a 100644
     3--- a/.mozconfig-mac
     4+++ b/.mozconfig-mac
     5@@ -10,7 +10,7 @@ export CC="$topsrcdir/clang/bin/clang $FLAGS"
     6 export CXX="$topsrcdir/clang/bin/clang++ $FLAGS"
     7 export CPP="$topsrcdir/clang/bin/clang $FLAGS -E"
     8 export LLVMCONFIG=$topsrcdir/clang/bin/llvm-config
     9-export LDFLAGS="-Wl,-syslibroot,$CROSS_SYSROOT -Wl,-dead_strip"
     10+export LDFLAGS="-Wl,-syslibroot,$CROSS_SYSROOT -Wl,-dead_strip -Wl,-pie"
     11 export TOOLCHAIN_PREFIX=$CROSS_CCTOOLS_PATH/bin/x86_64-apple-darwin10-
     12 #TODO: bug 1184202 - would be nice if these could be detected with TOOLCHAIN_PREFIX automatically
     13 export AR=${TOOLCHAIN_PREFIX}ar