Skip to content

Commit b6ddd87

Browse files
authored
Take a step toward complete BB domination (JuliaLang#33125)
This provides a number of benefits: * Significantly reduces the amount of work in win-extras, which I've always thought was an annoying wart in our build system. * Provides a consistent 7z executable on all platforms, which can be picked up by Pkg/BinaryProvider for consistent unzipping/untarring/ungzipping on all platforms. Note that on Windows, 7z is a repackaged binary from sourceforge and is the "full" 7z, whereas on all other platforms it is a p7zip build of the standalone 7za executable with all relevant patches applied. There are some format capability differences, but for the important things it should be fine.
1 parent 493c797 commit b6ddd87

File tree

68 files changed

+540
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+540
-36
lines changed

LICENSE.md

+1-2

Make.inc

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ USE_SYSTEM_LIBSSH2:=0
5252
USE_SYSTEM_CURL:=0
5353
USE_SYSTEM_LIBGIT2:=0
5454
USE_SYSTEM_PATCHELF:=0
55+
USE_SYSTEM_ZLIB:=0
56+
USE_SYSTEM_P7ZIP:=0
5557

5658
# Link to the LLVM shared library
5759
USE_LLVM_SHLIB := 1
@@ -1005,7 +1007,7 @@ USE_BINARYBUILDER ?= 0
10051007
endif
10061008

10071009
# This is the set of projects that BinaryBuilder dependencies are hooked up for.
1008-
BB_PROJECTS := OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV
1010+
BB_PROJECTS := OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP
10091011
define SET_BB_DEFAULT
10101012
# First, check to see if BB is disabled on a global setting
10111013
ifeq ($$(USE_BINARYBUILDER),0)

Makefile

+8-32
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1)
275275
else
276276
@$(MAKE) $(QUIET_MAKE) release
277277
endif
278-
@for subdir in $(bindir) $(datarootdir)/julia/stdlib/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir); do \
278+
@for subdir in $(bindir) $(datarootdir)/julia/stdlib/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir) $(libexecdir); do \
279279
mkdir -p $(DESTDIR)$$subdir; \
280280
done
281281

@@ -293,6 +293,9 @@ endif
293293
-$(INSTALL_M) $(build_bindir)/libopenlibm.dll.a $(DESTDIR)$(libdir)/
294294
else
295295

296+
# Install `7z` into libexec/
297+
$(INSTALL_M) $(build_bindir)/7z $(DESTDIR)$(libexecdir)/
298+
296299
# Copy over .dSYM directories directly for Darwin
297300
ifneq ($(DARWIN_FRAMEWORK),1)
298301
ifeq ($(OS),Darwin)
@@ -454,8 +457,6 @@ ifeq ($(OS), Darwin)
454457
endif
455458

456459
ifeq ($(OS), WINNT)
457-
[ ! -d $(JULIAHOME)/dist-extras ] || ( cd $(JULIAHOME)/dist-extras && \
458-
cp 7z.exe 7z.dll libexpat-1.dll zlib1.dll $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin )
459460
cd $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin && rm -f llvm* llc.exe lli.exe opt.exe LTO.dll bugpoint.exe macho-dump.exe
460461

461462
# create file listing for uninstall. note: must have Windows path separators and line endings.
@@ -465,7 +466,7 @@ ifeq ($(OS), WINNT)
465466
cd $(BUILDROOT) && $(call spawn,$(JULIAHOME)/dist-extras/nsis/makensis.exe) -NOCD -DVersion=$(JULIA_VERSION) -DArch=$(ARCH) -DCommit=$(JULIA_COMMIT) -DJULIAHOME="$(call cygpath_w,$(JULIAHOME))" $(call cygpath_w,$(JULIAHOME)/contrib/windows/build-installer.nsi) | iconv -f latin1
466467

467468
# compress nsis installer and combine with 7zip self-extracting header
468-
cd $(BUILDROOT) && $(JULIAHOME)/dist-extras/7z a -mx=9 "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" julia-installer.exe
469+
cd $(BUILDROOT) && $(JULIAHOME)/usr/bin/7z a -mx=9 "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" julia-installer.exe
469470
cd $(BUILDROOT) && cat $(JULIAHOME)/contrib/windows/7zS.sfx $(JULIAHOME)/contrib/windows/7zSFX-config.txt "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" > "$(JULIA_BINARYDIST_FILENAME).exe"
470471
chmod a+x "$(BUILDROOT)/$(JULIA_BINARYDIST_FILENAME).exe"
471472
-rm -f $(BUILDROOT)/julia-install-$(JULIA_COMMIT)-$(ARCH).7z
@@ -585,37 +586,12 @@ test-%: check-whitespace $(JULIA_BUILD_MODE)
585586
# download target for some hardcoded windows dependencies
586587
.PHONY: win-extras wine_path
587588
win-extras:
588-
[ -d $(JULIAHOME)/dist-extras ] || mkdir $(JULIAHOME)/dist-extras
589-
ifneq ($(BUILD_OS),WINNT)
590-
ifeq (,$(findstring CYGWIN,$(BUILD_OS)))
591-
cp /usr/lib/p7zip/7z /usr/lib/p7zip/7z.so $(JULIAHOME)/dist-extras
592-
endif
593-
endif
594-
ifneq (,$(filter $(ARCH), i386 i486 i586 i686))
595-
cd $(JULIAHOME)/dist-extras && \
596-
$(JLDOWNLOAD) https://sourceforge.net/projects/sevenzip/files/7-Zip/19.00/7z1900.exe && \
597-
$(JLCHECKSUM) 7z1900.exe && \
598-
7z x -y 7z1900.exe 7z.exe 7z.dll && \
599-
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2 \
600-
"mingw32-libexpat1 mingw32-zlib1" && \
601-
cp usr/i686-w64-mingw32/sys-root/mingw/bin/*.dll .
602-
else ifeq ($(ARCH),x86_64)
603-
cd $(JULIAHOME)/dist-extras && \
604-
$(JLDOWNLOAD) https://downloads.sourceforge.net/project/sevenzip/7-Zip/19.00/7z1900-x64.exe && \
605-
$(JLCHECKSUM) 7z1900-x64.exe && \
606-
7z x -y 7z1900-x64.exe 7z.exe 7z.dll && \
607-
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2 \
608-
"mingw64-libexpat1 mingw64-zlib1" && \
609-
cp usr/x86_64-w64-mingw32/sys-root/mingw/bin/*.dll .
610-
else
611-
$(error no win-extras target for ARCH=$(ARCH))
612-
endif
589+
@$(MAKE) -C $(BUILDROOT)/deps install-p7zip
590+
mkdir -p $(JULIAHOME)/dist-extras
613591
cd $(JULIAHOME)/dist-extras && \
614592
$(JLDOWNLOAD) https://sourceforge.net/projects/nsis/files/NSIS%203/3.04/nsis-3.04-setup.exe && \
615593
$(JLCHECKSUM) nsis-3.04-setup.exe && \
616-
chmod a+x 7z.exe && \
617-
chmod a+x 7z.dll && \
618-
$(call spawn,./7z.exe) x -y -onsis nsis-3.04-setup.exe && \
594+
$(call spawn,$(JULIAHOME)/usr/bin/7z.exe) x -y -onsis nsis-3.04-setup.exe && \
619595
chmod a+x ./nsis/makensis.exe
620596

621597
# various statistics about the build that may interest the user

contrib/refresh_bb_tarballs.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
TRIPLETS="i686-linux-gnu x86_64-linux-gnu aarch64-linux-gnu arm-linux-gnueabihf powerpc64le-linux-gnu i686-linux-musl x86_64-linux-musl aarch64-linux-musl arm-linux-musleabihf x86_64-apple-darwin14 x86_64-unknown-freebsd11.1 i686-w64-mingw32 x86_64-w64-mingw32"
1313

1414
# These are the projects currently using BinaryBuilder; both GCC-expanded and non-GCC-expanded:
15-
BB_PROJECTS="gmp mbedtls libssh2 mpfr curl libgit2 pcre libuv unwind osxunwind dsfmt objconv"
15+
BB_PROJECTS="gmp mbedtls libssh2 mpfr curl libgit2 pcre libuv unwind osxunwind dsfmt objconv p7zip zlib"
1616
BB_GCC_EXPANDED_PROJECTS="llvm openblas suitesparse openlibm"
1717

1818
# If we've been given a project name, filter down to that one:

deps/Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ ifeq ($(USE_SYSTEM_UTF8PROC), 0)
139139
DEP_LIBS += utf8proc
140140
endif
141141

142+
ifeq ($(USE_SYSTEM_LIBZ), 0)
143+
DEP_LIBS += libz
144+
endif
145+
146+
ifeq ($(USE_SYSTEM_P7ZIP), 0)
147+
DEP_LIBS += p7zip
148+
endif
149+
150+
142151
# Only compile standalone LAPACK if we are not using OpenBLAS.
143152
# OpenBLAS otherwise compiles LAPACK as part of its build.
144153
# This is useful where one wants to use the vendor BLAS, but
@@ -191,3 +200,5 @@ include $(SRCDIR)/libssh2.mk
191200
include $(SRCDIR)/curl.mk
192201
include $(SRCDIR)/libgit2.mk
193202
include $(SRCDIR)/libwhich.mk
203+
include $(SRCDIR)/zlib.mk
204+
include $(SRCDIR)/p7zip.mk

deps/Versions.make

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ LIBUV_VER = 1.29.1
3232
LIBUV_BB_REL = 0
3333
OBJCONV_VER = 2.49.0
3434
OBJCONV_BB_REL = 0
35+
ZLIB_VER = 1.2.11
36+
ZLIB_BB_REL = 3
37+
P7ZIP_VER = 16.2.0
38+
P7ZIP_BB_REL = 1
3539

3640
# Specify the version of the Mozilla CA Certificate Store to obtain.
3741
# The versions of cacert.pem are identified by the date (YYYY-MM-DD) of their changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
489c5ebbca174fdbfae86846e270e112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
da1bac181754711c50909492127f855c9acc2928951ce95310a6d32c03bb731d82fe2f0f97ae482c0da319b09d74b91aa143bd90b992489d386beee492d30e6f
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e132449b6a56b91aa6db9e9b1c386517
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7faf95166293b65f0c348417520b590b89cffcce6f2be19684398c9d313393a8405aeabbde0855e770a06a858c8684f298ec0123b60c75ff187dbf735be871b1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d570463290c9ad88b480a88d593ec430
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d66c7b423723ecef0cd281ba143fb8a67b8730d30db25df8f9f1e4dc7e615bd0ea590b04e89c94fb6d5be9cc5017e537b03e3888d5a5f327d7e35694992669ed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
11f531921e5311f55d98b7088ab1914a
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ab871eaa4eb1f54d5ecf6675e8bef11976fe7fe2eb93a5ad3c918fa401f7fd1562ca09b592a86c4919627f9cf10650b40fb80d706a43d3e212c39985e819b862
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
83e87e8f40bf6ed602bcc47574cb25d6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
801c1795ddadd8c6fd340a0854c3245e68cabb39225a75b747f674e466b70fa44afbdb9db01f45f165b56e62f9869dfd28072c4b8530f9c4eaa664baddb8b813
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bdc858aa86b135f1bb25466a1d725a1f
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
c1c6585f4e5a042de0d7d0de6d46149a4befd861c9664abdb049220d882c5e894b7a63483598656c5b9564bfccf01063d8689bda230f251e0dd519ab82494392
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5c8b8ae739dfe3bb6e5c07908e760924
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4e3c336333413a1916a281a107ab8d252837a6e3b80cdcbc855c1ef2400576a80cbc66bf6f58ca45209926a1347db9854928e161006557239d080496089a0e15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dcf64207e69f152de7ed27ff17990e92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
505d2a54063325ea88cd14c85f6caaa18c4f2bfa91ea4dbf8f4b461cdfca4a75424d198b1d54ae4e45505fec7ae20128c054dcef8a263c852ed6e3d0eebf62fb
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4bac35015bfc195e0a7e55baf40e8baa
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
60f959b1f77eeb5f8ed9e94e3ec300b0e23ea90feb67255956257aaddcb1b0ed65ed6d26deacb9b4b5337a757f5e4e2a7ef37d5534432975dbdcac36e63e33a9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5e584cf6cbeac6c4c3d9157fb9cf1c8a
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2498c7dae82060c9c90dbd4e2d213ff49996d438abd1d47349ff5154fa1917cb082e10481e8eae61b047d29d014052b6fa7a647990eb16dc6a5111afd83bb155
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
61d1dafed4ea486f317e332e84059b68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3761830c2c67b2e30c484dba487fb7a35d2a8eb0cd64da726f2a73bb2ab789215db02c292b43832d4ad4cd22165a9e63a11b3c9c7710188faf5c3b6a0ee9ec09
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3a88149d4bca1386d467e2317d483901
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
83d65ec48ed89dcdbc3fa3a70c3f859619ae980cdd457408fd4b9f01fbbecc6987a0156a2ab6dfe25c5a41a7b2a5647baa79a69d0b29ca50d0906270dd1effb6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f4ace8b649c3fc186421c5fd67503e39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
04eefb7fe95725672db39e37a7b0c791456e0df6c58ac9e291bf9f02f50aac103e43879b1befe6ba3bf8ca11a1ff1ec4647ab40105594b17a0a5d67059b46670
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a0128d661cfe7cc8c121e73519c54fbf
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d2c4d53817f96bb4c7683f42045198d4cd509cfc9c3e2cb85c8d9dc4ab6dfa7496449edeac4e300ecf986a9cbbc90bd8f8feef8156895d94617c04e507add55f
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
97011a65a2d0fafd74e81bc3445654dc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9de77aab797e8c9a1785e121a1a33d0f007f58529b2107b181a22f1032f836e374a937214c0cabf72bb1f8ca32b70b71e3e1a12d895b301cdfe35ac3ba1fcb10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
90d4ebc185099fd1425607bc18118df2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aa2d6c285076de80e1f0b91860bdee7dfba7074f8abd5a95b8a9d66a8419b2a0ed5f835daeb3dc2a23c5ba33edb451710cc4aa8998005fc40536a5950c65d635
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3e170698971fbe88c72933f1b5040588
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5a1026a5540a40ec6b5b7cbf1660cca7b6b8b50693b7737ced333e137e7a881c7eb0f1d0f4b3f82d92c07b7fec754375caabd1399196bde731bc9505cd1c5ada
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
da71ac0e0a16b11fca6953b8dbaf921c
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7655a1501ea4fea55165945da394f8aad366b453d2da00f585eeebfb9cc2e421545f3bfabbc5eb7b9859d6470a9d652a0503f2bdbfcd72f94553e149b11ff92d
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
951385b34aba01cdcef4e07e66942951
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2d655e6d3d5d26bed81817bfbcece8084bfcbf4fc5e491c6ebec72490ccca4db72cc1f962a3ef5ceab5c5abe2cc4e9b9e9524d25c158ed8af32b6aff4b722d00
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4e005a19cef586bc407953a0d03caf6d
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6c55576e1f3907435fea1aa6db0c124dee155ab1dac6cdf72ebe1ad4380bcd585d0a8d755b86621a498c63a95523dbf56053076c3f7398e6c0411db0fc1099be
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a193ac18bf72645e8132c0303d285aab
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
eb82dd1b1cbacd76b2440a73b3c2a3167d5c8e88afddd27e0912f4d43d21040112a130f32efbe8af978dda5f698310e5253091c2b144b50384117e362d711256
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
33ee9c368767a7dc4ecc176b107a1344
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2f801688be550705f10061e1be92c53a4388c90138159763ab63835730fb794cea54928dd3da72d203fcfc047ecf4c6b10644f914c849436058013e24381126d
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dbcfff4fd3ee79040fcee45ad70e8115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
66ca063b9b7ffb1e36db3fb71de7ef0a0b22782dabafa1b7f6ba89dd7931bcb4491920cf77970c3ebc2f14741ce21c3c28e7c8ae57ad14d6c2dc54676f853177
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e4ba040e655fc4a82a16e41620171233
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fdc322926de636060699daf87dd69003e092a10cc7125a0963a94fa588f0af9562dd5da2adcf6aa4fdf74e1c01ab46c25ff5e36c6f5665a1781a8b8240ac5624
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14875b7aa0e3d6a6c8773dce64abdcb2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9cbadcc3b52ec36c9885c04156ec6521d4959f5de78afc0ed867c308ad33994da4fa39ec63f455403587e8b21c6269f1c88c98980744628c4a37470693012e81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6fff391800713934b3f008906349ddb2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
887feb7e197c7cdf3ec65a8fde1809c2c82500b6ddf8a114400ace9bbbd9cb22fc947d3397ae189b6c5d76b55fc4b98c39e02aec298edcdeca997115828af080
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1732e69ed7e9d5201637421c7dad93cd
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8354d68e07e77d0f9679f5daa27a373013b6edefaafff070629ca260a001f1160850637563f16419f37a59fb397b3b273ca4293bc38a72371feff1ecd17c2fc1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
93d10d4dd040f14ae63417070d1346e8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a1e9c5a2963266a582192d0fe88c179f5239245f11c4df4427dda755ad77d31e1fcf045d7d3fe49141090f4ff8da13d9a2e8d8d317fe6460a5f3e9bdea29b883

deps/p7zip.mk

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## p7zip ##
2+
3+
ifneq ($(USE_BINARYBUILDER_P7ZIP),1)
4+
# Force optimization for P7ZIP flags (Issue #11668)
5+
$(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2: | $(SRCCACHE)
6+
$(JLDOWNLOAD) $@ https://downloads.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2
7+
8+
$(BUILDDIR)/p7zip-$(P7ZIP_VER)/source-extracted: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2
9+
$(JLCHECKSUM) $<
10+
mkdir -p $(dir $@)
11+
cd $(dir $@) && $(TAR) --strip-components 1 -jxf $<
12+
echo $1 > $@
13+
14+
$(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-12-CVE-2016-9296.patch-applied: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/source-extracted
15+
cd $(dir $@) && patch -p1 -f < $(SRCDIR)/patches/p7zip-12-CVE-2016-9296.patch
16+
echo 1 > $@
17+
18+
$(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-13-CVE-2017-17969.patch-applied: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-12-CVE-2016-9296.patch-applied
19+
cd $(dir $@) && patch -p1 -f < $(SRCDIR)/patches/p7zip-13-CVE-2017-17969.patch
20+
echo 1 > $@
21+
22+
$(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-15-Enhanced-encryption-strength.patch-applied: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-13-CVE-2017-17969.patch-applied
23+
cd $(dir $@) && patch -p4 -f < $(SRCDIR)/patches/p7zip-15-Enhanced-encryption-strength.patch
24+
echo 1 > $@
25+
26+
$(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-15-Enhanced-encryption-strength.patch-applied
27+
$(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-compiled: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured
28+
$(MAKE) -C $(dir $<) $(MAKE_COMMON) CC="$(CC)" CXX="$(CXX)" 7za
29+
echo 1 > $@
30+
31+
define P7ZIP_INSTALL
32+
mkdir -p $2/$$(build_bindir)
33+
cp -a $1/bin/7za $2/$$(build_bindir)/7z
34+
endef
35+
$(eval $(call staged-install, \
36+
p7zip,p7zip-$(P7ZIP_VER), \
37+
P7ZIP_INSTALL,,,))
38+
39+
clean-p7zip:
40+
-rm $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-compiled
41+
-rm $(build_bindir)/7za
42+
-$(MAKE) -C $(BUILDDIR)/p7zip-$(P7ZIP_VER) clean
43+
44+
distclean-p7zip:
45+
-rm -rf $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2 $(SRCCACHE)/p7zip-$(P7ZIP_VER) $(BUILDDIR)/p7zip-$(P7ZIP_VER)
46+
47+
48+
get-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2
49+
extract-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER)/source-extracted
50+
configure-p7zip: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured
51+
compile-p7zip: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-compiled
52+
fastcheck-p7zip: check-p7zip
53+
check-p7zip: compile-p7zip
54+
55+
56+
else # USE_BINARYBUILDER_P7ZIP
57+
P7ZIP_BB_URL_BASE := https://github.com/JuliaBinaryWrappers/p7zip_jll.jl/releases/download/p7zip-v$(P7ZIP_VER)+$(P7ZIP_BB_REL)
58+
P7ZIP_BB_NAME := p7zip.v$(P7ZIP_VER)
59+
$(eval $(call bb-install,p7zip,P7ZIP,false))
60+
61+
endif
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
From: Robert Luberda <[email protected]>
2+
Date: Sat, 19 Nov 2016 08:48:08 +0100
3+
Subject: Fix nullptr dereference (CVE-2016-9296)
4+
5+
Patch taken from https://sourceforge.net/p/p7zip/bugs/185/
6+
---
7+
CPP/7zip/Archive/7z/7zIn.cpp | 3 ++-
8+
1 file changed, 2 insertions(+), 1 deletion(-)
9+
10+
diff --git a/CPP/7zip/Archive/7z/7zIn.cpp b/CPP/7zip/Archive/7z/7zIn.cpp
11+
index b0c6b98..7c6dde2 100644
12+
--- a/CPP/7zip/Archive/7z/7zIn.cpp
13+
+++ b/CPP/7zip/Archive/7z/7zIn.cpp
14+
@@ -1097,7 +1097,8 @@ HRESULT CInArchive::ReadAndDecodePackedStreams(
15+
if (CrcCalc(data, unpackSize) != folders.FolderCRCs.Vals[i])
16+
ThrowIncorrect();
17+
}
18+
- HeadersSize += folders.PackPositions[folders.NumPackStreams];
19+
+ if (folders.PackPositions)
20+
+ HeadersSize += folders.PackPositions[folders.NumPackStreams];
21+
return S_OK;
22+
}
23+
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From: =?utf-8?q?Antoine_Beaupr=C3=A9?= <[email protected]>
2+
Date: Fri, 2 Feb 2018 11:11:41 +0100
3+
Subject: Heap-based buffer overflow in 7zip/Compress/ShrinkDecoder.cpp
4+
5+
Origin: vendor, https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/27d7/attachment/CVE-2017-17969.patch
6+
Forwarded: https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/#27d7
7+
Bug: https://sourceforge.net/p/p7zip/bugs/204/
8+
Bug-Debian: https://bugs.debian.org/888297
9+
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17969
10+
Reviewed-by: Salvatore Bonaccorso <[email protected]>
11+
Last-Update: 2018-02-01
12+
Applied-Upstream: 18.00-beta
13+
---
14+
CPP/7zip/Compress/ShrinkDecoder.cpp | 7 ++++++-
15+
1 file changed, 6 insertions(+), 1 deletion(-)
16+
17+
diff --git a/CPP/7zip/Compress/ShrinkDecoder.cpp b/CPP/7zip/Compress/ShrinkDecoder.cpp
18+
index 80b7e67..ca37764 100644
19+
--- a/CPP/7zip/Compress/ShrinkDecoder.cpp
20+
+++ b/CPP/7zip/Compress/ShrinkDecoder.cpp
21+
@@ -121,8 +121,13 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *
22+
{
23+
_stack[i++] = _suffixes[cur];
24+
cur = _parents[cur];
25+
+ if (cur >= kNumItems || i >= kNumItems)
26+
+ break;
27+
}
28+
-
29+
+
30+
+ if (cur >= kNumItems || i >= kNumItems)
31+
+ break;
32+
+
33+
_stack[i++] = (Byte)cur;
34+
lastChar2 = (Byte)cur;
35+

0 commit comments

Comments
 (0)