[tor-commits] [tor-browser-build/master] Bug 31844: Fix unquoted paths in OpenSSL Windows build

gk at torproject.org gk at torproject.org
Thu Sep 26 19:24:50 UTC 2019


commit 7bab743e199ea3d3ba8ca3f5ba5289609035f37c
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Wed Sep 25 14:10:12 2019 +0200

    Bug 31844: Fix unquoted paths in OpenSSL Windows build
    
    The default OPENSSLDIR on Windows builds contain spaces and parenthesis,
    which break the build as the unquoted path is used in several places. We
    fix this by escaping the spaces and parenthesis.
    
    This is fixing part of the issues mentioned in:
    https://github.com/openssl/openssl/issues/9520
---
 projects/openssl/build                   |  3 +++
 projects/openssl/config                  |  2 ++
 projects/openssl/escape-openssldir.patch | 28 ++++++++++++++++++++++++++++
 3 files changed, 33 insertions(+)

diff --git a/projects/openssl/build b/projects/openssl/build
index d53185e..3ee3571 100644
--- a/projects/openssl/build
+++ b/projects/openssl/build
@@ -13,6 +13,9 @@ export CC='gcc -m32'
   ln -s $clangdir/bin/clang $clangdir/bin/x86_64-apple-darwin11-cc
   export CC="cc [% c("var/FLAGS") %]"
 [% END -%]
+[% IF c("var/windows") -%]
+  patch -p1 < $rootdir/escape-openssldir.patch
+[% END -%]
 export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
 ./Configure [% c('var/configure_opts') %]
 make
diff --git a/projects/openssl/config b/projects/openssl/config
index f648598..2fc46ea 100644
--- a/projects/openssl/config
+++ b/projects/openssl/config
@@ -29,3 +29,5 @@ input_files:
     project: '[% c("var/compiler") %]'
   - URL: 'https://www.openssl.org/source/openssl-[% c("version") %].tar.gz'
     sha256sum: 1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
+  - filename: escape-openssldir.patch
+    enable: '[% c("var/windows") %]'
diff --git a/projects/openssl/escape-openssldir.patch b/projects/openssl/escape-openssldir.patch
new file mode 100644
index 0000000..684a179
--- /dev/null
+++ b/projects/openssl/escape-openssldir.patch
@@ -0,0 +1,28 @@
+diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
+index 7db7578a4b..e5ba20b589 100644
+--- a/Configurations/unix-Makefile.tmpl
++++ b/Configurations/unix-Makefile.tmpl
+@@ -215,6 +215,7 @@ INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet
+                   $prefix_dev -}
+ INSTALLTOP_dir={- my $x = File::Spec::Win32->canonpath($prefix_dir);
+                   $x =~ s|\\|/|g;
++                  $x =~ s/([ \(\)])/\\$1/g;
+                   $x -}
+ OPENSSLDIR_dev={- #
+                   # The logic here is that if no --openssldir was given,
+@@ -239,6 +240,7 @@ OPENSSLDIR_dev={- #
+                   $openssldir_dev -}
+ OPENSSLDIR_dir={- my $x = File::Spec::Win32->canonpath($openssldir_dir);
+                   $x =~ s|\\|/|g;
++                  $x =~ s/([ \(\)])/\\$1/g;
+                   $x -}
+ LIBDIR={- our $libdir = $config{libdir} || "lib";
+           File::Spec::Win32->file_name_is_absolute($libdir) ? "" : $libdir -}
+@@ -253,6 +255,7 @@ ENGINESDIR_dev={- use File::Spec::Win32;
+                   $enginesdir_dev -}
+ ENGINESDIR_dir={- my $x = File::Spec::Win32->canonpath($enginesdir_dir);
+                   $x =~ s|\\|/|g;
++                  $x =~ s/([ \(\)])/\\$1/g;
+                   $x -}
+ # In a Windows environment, $(DESTDIR) is harder to contatenate with other
+ # directory variables, because both may contain devices.  What we do here is





More information about the tor-commits mailing list