summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2020-06-15 13:53:53 (GMT)
committerTony Theodore <tonyt@logyst.com>2020-06-15 13:53:53 (GMT)
commit2c3c6d939a5829157262f34b02d83b88de25226c (patch)
treeb014a0cac231ca25d38927fef23276a0688e1ae2
parent7d3a2b539886cadedb7da3788733aa3154b98f75 (diff)
downloadmxe-2c3c6d939a5829157262f34b02d83b88de25226c.zip
mxe-2c3c6d939a5829157262f34b02d83b88de25226c.tar.gz
mxe-2c3c6d939a5829157262f34b02d83b88de25226c.tar.bz2
nsis: update 3.04-->3.05, fix gcc10, retry build
-rw-r--r--src/nsis-1-fixes.patch67
-rw-r--r--src/nsis.mk30
2 files changed, 84 insertions, 13 deletions
diff --git a/src/nsis-1-fixes.patch b/src/nsis-1-fixes.patch
new file mode 100644
index 0000000..38e8063
--- /dev/null
+++ b/src/nsis-1-fixes.patch
@@ -0,0 +1,67 @@
+This file is part of MXE. See LICENSE.md for licensing information.
+
+Contains ad hoc patches for cross building.
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marius=20Negru=C8=9Biu?= <marius.negrutiu@protonmail.com>
+Date: Mon, 8 Jun 2020 14:08:49 +0300
+Subject: [PATCH 1/1] Fixed memmove() linker error caused by gcc/10.1.0-3
+ compiler optimizer
+
+see:
+https://sourceforge.net/p/nsis/bugs/1248/
+
+taken from:
+https://github.com/negrutiu/nsis/commit/c252106dd8203515706d9240e99a92cd0c7e3acb.patch
+
+diff --git a/Source/bzip2/decompress.c b/Source/bzip2/decompress.c
+index 1111111..2222222 100755
+--- a/Source/bzip2/decompress.c
++++ b/Source/bzip2/decompress.c
+@@ -263,7 +263,16 @@ Int32 NSISCALL BZ2_decompress ( DState* s )
+ for (i = 0; i < nSelectors; i++) {
+ v = s->selectorMtf[i];
+ tmp = pos[v];
++/*
++ [Marius]
++ gcc/10.1.0-3 compiler optimizer replace the following line with a msvcrt!memmove() call.
++ This file is built into projects compiled with the -nostdlib parameter, therefore a linker error will occur.
++ We'll qualify the destination array as `volatile` to prevent GCC from optimizing it.
++ Related topic: https://stackoverflow.com/questions/2219829/how-to-prevent-gcc-optimizing-some-statements-in-c
++ -----------------------------------------
+ while (v > 0) { pos[v] = pos[v-1]; v--; }
++*/
++ while (v > 0) { ((volatile UChar*)pos)[v] = pos[v-1]; v--; }
+ pos[0] = tmp;
+ s->selector[i] = tmp;
+ }
+@@ -388,7 +397,14 @@ Int32 NSISCALL BZ2_decompress ( DState* s )
+ }
+ */
+ while (nn > 0) {
++/*
++ [Marius]
++ Mark destination array as `volatile` to prevent GCC optimizer to generate msvcrt!memmove() calls.
++ See comments above.
++ -----------------------------------------
+ s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--;
++*/
++ ((volatile UChar*)s->mtfa)[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--;
+ };
+ s->mtfa[pp] = uc;
+ } else {
+@@ -398,7 +414,14 @@ Int32 NSISCALL BZ2_decompress ( DState* s )
+ pp = s->mtfbase[lno] + off;
+ uc = s->mtfa[pp];
+ while (pp > s->mtfbase[lno]) {
++/*
++ [Marius]
++ Mark destination array as `volatile` to prevent GCC optimizer to generate msvcrt!memmove() calls.
++ See comments above.
++ -----------------------------------------
+ s->mtfa[pp] = s->mtfa[pp-1]; pp--;
++*/
++ ((volatile UChar*)s->mtfa)[pp] = s->mtfa[pp-1]; pp--;
+ };
+ s->mtfbase[lno]++;
+ while (lno > 0) {
diff --git a/src/nsis.mk b/src/nsis.mk
index 0d1c0ea..b8667c4 100644
--- a/src/nsis.mk
+++ b/src/nsis.mk
@@ -4,8 +4,8 @@ PKG := nsis
$(PKG)_WEBSITE := https://nsis.sourceforge.io/
$(PKG)_DESCR := NSIS
$(PKG)_IGNORE :=
-$(PKG)_VERSION := 3.04
-$(PKG)_CHECKSUM := 609536046c50f35cfd909dd7df2ab38f2e835d0da3c1048aa0d48c59c5a4f4f5
+$(PKG)_VERSION := 3.05
+$(PKG)_CHECKSUM := b6e1b309ab907086c6797618ab2879cb95387ec144dab36656b0b5fb77e97ce9
$(PKG)_SUBDIR := nsis-$($(PKG)_VERSION)-src
$(PKG)_FILE := nsis-$($(PKG)_VERSION)-src.tar.bz2
$(PKG)_URL := https://$(SOURCEFORGE_MIRROR)/project/nsis/NSIS 3/$($(PKG)_VERSION)/$($(PKG)_FILE)
@@ -17,6 +17,17 @@ define $(PKG)_UPDATE
tail -1
endef
+define $(PKG)_SCONS_OPTS
+ XGCC_W32_PREFIX='$(TARGET)-' \
+ PREFIX='$(PREFIX)/$(TARGET)' \
+ `[ -d /usr/local/include ] && echo APPEND_CPPPATH=/usr/local/include` \
+ `[ -d /usr/local/lib ] && echo APPEND_LIBPATH=/usr/local/lib` \
+ $(if $(findstring x86_64-w64-mingw32,$(TARGET)),\
+ SKIPPLUGINS='System' TARGET_ARCH=amd64) \
+ SKIPUTILS='MakeLangId,Makensisw,NSIS Menu,zip2exe' \
+ NSIS_MAX_STRLEN=8192
+endef
+
define $(PKG)_BUILD
# scons supports -j option but nsis parallel build fails
# nsis uses it's own BUILD_PREFIX which isn't user configurable
@@ -26,16 +37,9 @@ define $(PKG)_BUILD
$(SED) -i 's/pei-i386/pei-x86-64/' '$(1)/SCons/Config/linker_script' && \
$(SED) -i 's/m_target_type=TARGET_X86ANSI/m_target_type=TARGET_AMD64/' '$(SOURCE_DIR)/Source/build.cpp')
- # scons does various PATH manipulations that don't play well with ccache
- cd '$(SOURCE_DIR)' && PATH='$(PREFIX)/bin:$(PATH)' $(PYTHON2) '$(BUILD_DIR).scons/scons.py' \
- XGCC_W32_PREFIX='$(TARGET)-' \
- PREFIX='$(PREFIX)/$(TARGET)' \
- `[ -d /usr/local/include ] && echo APPEND_CPPPATH=/usr/local/include` \
- `[ -d /usr/local/lib ] && echo APPEND_LIBPATH=/usr/local/lib` \
- $(if $(findstring x86_64-w64-mingw32,$(TARGET)),\
- SKIPPLUGINS='System' TARGET_ARCH=amd64) \
- SKIPUTILS='MakeLangId,Makensisw,NSIS Menu,zip2exe' \
- NSIS_MAX_STRLEN=8192 \
- install
+ cd '$(SOURCE_DIR)' && $(SCONS_LOCAL) $($(PKG)_SCONS_OPTS) -j '$(JOBS)' -k || \
+ cd '$(SOURCE_DIR)' && $(SCONS_LOCAL) $($(PKG)_SCONS_OPTS) -j '$(JOBS)'
+ cd '$(SOURCE_DIR)' && $(SCONS_LOCAL) $($(PKG)_SCONS_OPTS) -j 1 install
+
$(INSTALL) -m755 '$(PREFIX)/$(TARGET)/bin/makensis' '$(PREFIX)/bin/$(TARGET)-makensis'
endef