[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser-build/master] Bug 25862: move mingw helper scripts to firefox



commit 8fd3d1dc7f27a96129328af98b69e18d161cef97
Author: Nicolas Vigier <boklm@xxxxxxxxxxxxxx>
Date:   Fri Apr 20 18:41:15 2018 +0200

    Bug 25862: move mingw helper scripts to firefox
    
    Stop using mingw helper scripts everywhere except for the firefox build.
    
    At the same time as we move them to firefox, we simplify the helper
    scripts by using var/CFLAGS and var/LDFLAGS from rbm.conf instead of
    redefining the flags.
    
    We are also now building firefox with -fstack-protector-strong instead
    of -fstack-protector.
---
 projects/firefox/build    | 23 +++++++++++++++++++++++
 projects/mingw-w64/build  | 19 -------------------
 projects/mingw-w64/config |  2 +-
 projects/nsis/build       |  2 --
 rbm.conf                  |  2 +-
 5 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/projects/firefox/build b/projects/firefox/build
index a7441bd..c3536c6 100644
--- a/projects/firefox/build
+++ b/projects/firefox/build
@@ -17,6 +17,29 @@
 distdir=/var/tmp/dist/[% project %]
 mkdir -p /var/tmp/build
 
+[% IF c("var/windows") -%]
+  mingwdir=/var/tmp/dist/mingw-w64
+  mkdir -p $mingwdir/helpers
+
+  cat > $mingwdir/helpers/[% c("arch") %]-w64-mingw32-g++ << 'EOF'
+#!/bin/sh
+/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-g++ [% c("var/LDFLAGS") %] [% c("var/CFLAGS") %] "$@"
+EOF
+
+  cat > $mingwdir/helpers/[% c("arch") %]-w64-mingw32-gcc << 'EOF'
+#!/bin/sh
+/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-gcc [% c("var/LDFLAGS") %] [% c("var/CFLAGS") %] "$@"
+EOF
+
+  cat > $mingwdir/helpers/[% c("arch") %]-w64-mingw32-ld << 'EOF'
+#!/bin/sh
+/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-ld [% c("var/LDFLAGS") %] "$@"
+EOF
+
+  chmod +x $mingwdir/helpers/*
+  export PATH="$mingwdir/helpers:$PATH"
+[% END -%]
+
 [% IF c("var/linux") %]
   mkdir -p /var/tmp/dist
   tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %]
diff --git a/projects/mingw-w64/build b/projects/mingw-w64/build
index 8ce5048..a142c38 100644
--- a/projects/mingw-w64/build
+++ b/projects/mingw-w64/build
@@ -55,25 +55,6 @@ mkdir -p $distdir/gcclibs
 cp [% c("arch") %]-w64-mingw32/libssp/.libs/libssp-0.dll $distdir/gcclibs
 cp [% c("arch") %]-w64-mingw32/libgcc/shlib/[% c("var/libgcc_dll") %] $distdir/gcclibs
 
-mkdir -p $distdir/helpers
-
-cat > $distdir/helpers/[% c("arch") %]-w64-mingw32-g++ << 'EOF'
-#!/bin/sh
-/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-g++ -Wl,--dynamicbase -Wl,--nxcompat -Wl,--enable-reloc-section -fstack-protector --param ssp-buffer-size=4 -fno-strict-overflow "$@"
-EOF
-
-cat > $distdir/helpers/[% c("arch") %]-w64-mingw32-gcc << 'EOF'
-#!/bin/sh
-/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-gcc -Wl,--dynamicbase -Wl,--nxcompat -Wl,--enable-reloc-section -fstack-protector --param ssp-buffer-size=4 -fno-strict-overflow "$@"
-EOF
-
-cat > $distdir/helpers/[% c("arch") %]-w64-mingw32-ld << 'EOF'
-#!/bin/sh
-/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-ld --dynamicbase --nxcompat --enable-reloc-section -lssp -L$gcclibs "$@"
-EOF
-
-chmod +x $distdir/helpers/*
-
 cd /var/tmp/dist
 [% c('tar', {
         tar_src => [ project ],
diff --git a/projects/mingw-w64/config b/projects/mingw-w64/config
index 01d0c37..fb9ef21 100644
--- a/projects/mingw-w64/config
+++ b/projects/mingw-w64/config
@@ -15,7 +15,7 @@ var:
     [% c("var/setarch") -%]
     mkdir -p /var/tmp/dist
     tar -C /var/tmp/dist -xf $rootdir/[% c("compiler_tarfile") %]
-    export PATH="/var/tmp/dist/mingw-w64/helpers:/var/tmp/dist/mingw-w64/bin:$PATH"
+    export PATH="/var/tmp/dist/mingw-w64/bin:$PATH"
     export gcclibs=/var/tmp/dist/mingw-w64/gcclibs
 targets:
   windows-i686:
diff --git a/projects/nsis/build b/projects/nsis/build
index af19dd7..81ed4d4 100755
--- a/projects/nsis/build
+++ b/projects/nsis/build
@@ -1,8 +1,6 @@
 #!/bin/bash
 [% c("var/set_default_env") -%]
 [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
-# remove hardening wrappers
-rm -Rf /var/tmp/dist/mingw-w64/helpers
 mkdir -p /var/tmp/dist
 mkdir -p /var/tmp/build
 tar -C /var/tmp/build -xf nsis-[% c('version') %].tar.bz2
diff --git a/rbm.conf b/rbm.conf
index bb53bcb..6adcd6f 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -216,7 +216,7 @@ targets:
       container:
         suite: jessie
       configure_opt: '--host=[% c("arch") %]-w64-mingw32 CFLAGS="[% c("var/CFLAGS") %]" LDFLAGS="[% c("var/LDFLAGS") %]"'
-      CFLAGS: '[% c("var/flag_mwindows") %] -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 -fno-strict-overflow -Wno-missing-field-initializers -Wformat -Wformat-security'
+      CFLAGS: '[% c("var/flag_mwindows") %] -fstack-protector-strong -fno-strict-overflow -Wno-missing-field-initializers -Wformat -Wformat-security'
       LDFLAGS: '[% c("var/flag_mwindows") %] -Wl,--dynamicbase -Wl,--nxcompat -Wl,--enable-reloc-section -lssp -L$gcclibs'
       flag_mwindows: '-mwindows'
       compiler: mingw-w64

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits