summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2017-02-04 10:33:53 (GMT)
committerTony Theodore <tonyt@logyst.com>2017-02-07 03:33:26 (GMT)
commit5da81682638fb00f9250c442ecc413b2984dce4e (patch)
tree914310c7a0a462e2db3dc09f5a281132254ab456
parent27facf1c6fcb7973781568dde9b0c1072e28f669 (diff)
downloadmxe-5da81682638fb00f9250c442ecc413b2984dce4e.zip
mxe-5da81682638fb00f9250c442ecc413b2984dce4e.tar.gz
mxe-5da81682638fb00f9250c442ecc413b2984dce4e.tar.bz2
allow non-default exception handling targets
-rw-r--r--Makefile20
-rw-r--r--README.md7
-rw-r--r--docs/index.html4
-rw-r--r--src/gcc.mk4
4 files changed, 33 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 68b0fb6..ed91454 100644
--- a/Makefile
+++ b/Makefile
@@ -87,8 +87,26 @@ MXE_CONFIGURE_OPTS = \
--disable-static --enable-shared ) \
$(MXE_DISABLE_DOC_OPTS)
+# GCC threads and exceptions
MXE_GCC_THREADS = \
- $(if $(findstring posix,$(TARGET)),posix,win32)
+ $(if $(findstring posix,$(or $(TARGET),$(1))),posix,win32)
+
+# allowed exception handling for targets
+# default (first item) and alternate, revisit if gcc/mingw-w64 change defaults
+i686-w64-mingw32_EH := sjlj dw2
+x86_64-w64-mingw32_EH := seh sjlj
+
+# functions to determine exception handling from user-specified target
+# $(or $(TARGET),$(1)) allows use as both function and inline snippet
+TARGET_EH_LIST = $($(firstword $(call split,.,$(or $(TARGET),$(1))))_EH)
+DEFAULT_EH = $(firstword $(TARGET_EH_LIST))
+GCC_EXCEPTIONS = \
+ $(lastword $(DEFAULT_EH) \
+ $(filter $(TARGET_EH_LIST),$(call split,.,$(or $(TARGET),$(1)))))
+MXE_GCC_EXCEPTION_OPTS = \
+ $(if $(call seq,sjlj,$(GCC_EXCEPTIONS)),--enable-sjlj-exceptions) \
+ $(if $(call seq,dw2,$(GCC_EXCEPTIONS)),--disable-sjlj-exceptions)
+
# Append these to the "make" and "make install" steps of autotools packages
# in order to neither build nor install unwanted binaries, manpages,
diff --git a/README.md b/README.md
index 16b4d45..37c4a20 100644
--- a/README.md
+++ b/README.md
@@ -33,5 +33,12 @@ various target platforms, which:
* GCC Threading Libraries (`winpthreads` is always available):
- win32
- [posix (experimental)](https://github.com/mxe/mxe/pull/958)
+ * GCC Exception Handling:
+ - Default
+ - i686: sjlj
+ - x86_64: seh
+ - [Alternatives (experimental)](https://github.com/mxe/mxe/pull/1664)
+ - i686: dw2
+ - x86_64: sjlj
Please see [mxe.cc](http://mxe.cc/) for further information and package support matrix.
diff --git a/docs/index.html b/docs/index.html
index 6b298ba..b2961d3 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -163,6 +163,10 @@
Experimental support for GCC with posix threads was
added in <a href="https://github.com/mxe/mxe/pull/958">November 2015</a>.
</p>
+ <p>
+ Experimental support for alternate GCC Exception Handling was
+ added in <a href="https://github.com/mxe/mxe/pull/1664">February 2017</a>.
+ </p>
</div>
diff --git a/src/gcc.mk b/src/gcc.mk
index 31e8d28..5186555 100644
--- a/src/gcc.mk
+++ b/src/gcc.mk
@@ -37,6 +37,7 @@ define $(PKG)_CONFIGURE
--without-x \
--disable-win32-registry \
--enable-threads=$(MXE_GCC_THREADS) \
+ $(MXE_GCC_EXCEPTION_OPTS) \
--enable-libgomp \
--with-gmp='$(PREFIX)/$(BUILD)' \
--with-isl='$(PREFIX)/$(BUILD)' \
@@ -45,7 +46,8 @@ define $(PKG)_CONFIGURE
--with-as='$(PREFIX)/bin/$(TARGET)-as' \
--with-ld='$(PREFIX)/bin/$(TARGET)-ld' \
--with-nm='$(PREFIX)/bin/$(TARGET)-nm' \
- $(shell [ `uname -s` == Darwin ] && echo "LDFLAGS='-Wl,-no_pie'")
+ $(shell [ `uname -s` == Darwin ] && echo "LDFLAGS='-Wl,-no_pie'") \
+ $($(PKG)_CONFIGURE_OPTS)
endef
define $(PKG)_BUILD_mingw-w64