Add a new config knob for gcc: usage of SJLJ to handle exceptions.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Aug 07 13:55:30 2008 +0000 (2008-08-07)
changeset 765f89ccf3ea5d6
parent 764 ff368787f62b
child 766 717efd8b78b4
Add a new config knob for gcc: usage of SJLJ to handle exceptions.
This is needed for some architectures to compile the Java frontend (eg. ARM with uClibc).

/trunk/config/cc/gcc.in | 41 39 2 0 +++++++++++++++++++++++++++++++++++++++--
/trunk/scripts/build/cc_gcc.sh | 8 5 3 0 +++++---
2 files changed, 44 insertions(+), 5 deletions(-)
config/cc/gcc.in
scripts/build/cc_gcc.sh
     1.1 --- a/config/cc/gcc.in	Thu Aug 07 13:35:11 2008 +0000
     1.2 +++ b/config/cc/gcc.in	Thu Aug 07 13:55:30 2008 +0000
     1.3 @@ -129,12 +129,49 @@
     1.4  
     1.5  config CC_CXA_ATEXIT
     1.6      bool
     1.7 -    prompt "__cxa_atexit"
     1.8 -    default "y"
     1.9 +    prompt "Use __cxa_atexit"
    1.10 +    default y
    1.11      help
    1.12        If you get the missing symbol "__cxa_atexit" when building C++ programs,
    1.13        you might want to try disabling this option.
    1.14  
    1.15 +choice
    1.16 +    bool
    1.17 +    prompt "Use sjlj for exceptions"
    1.18 +    default CC_SJLJ_EXCEPTIONS_CONFIGURE
    1.19 +
    1.20 +# This config option is used nowhere in the code on purpose.
    1.21 +# It only serves as a choice entry to force neither using nor not using sjlj
    1.22 +config CC_SJLJ_EXCEPTIONS_CONFIGURE
    1.23 +    bool
    1.24 +    prompt "Let configure decide"
    1.25 +    help
    1.26 +      Let configure decide if setjmp/longjmp should be used to handle
    1.27 +      exceptions.
    1.28 +      
    1.29 +      Choose that if you trust configure to detect the correct settings.
    1.30 +      This is the default choice.
    1.31 +
    1.32 +config CC_SJLJ_EXCEPTIONS_USE
    1.33 +    bool
    1.34 +    prompt "Force using sjlj"
    1.35 +    help
    1.36 +      Do use setjmp/longjmp for exceptions.
    1.37 +      This is gcc's --enable-sjlj-exceptions configure switch.
    1.38 +      
    1.39 +      Choose that if you want to use setjmp/longjmp to handle exceptions.
    1.40 +
    1.41 +config CC_SJLJ_EXCEPTIONS_DONT_USE
    1.42 +    bool
    1.43 +    prompt "Force not using sjlj"
    1.44 +    help
    1.45 +      Do not use setjmp/longjmp for exceptions.
    1.46 +      This is gcc's --disable-sjlj-exceptions configure switch.
    1.47 +      
    1.48 +      Choose that if you want to not use setjmp/longjmp to handle exceptions.
    1.49 +
    1.50 +endchoice
    1.51 +
    1.52  config CC_CORE_EXTRA_CONFIG
    1.53      string
    1.54      prompt "Core gcc extra config"
     2.1 --- a/scripts/build/cc_gcc.sh	Thu Aug 07 13:35:11 2008 +0000
     2.2 +++ b/scripts/build/cc_gcc.sh	Thu Aug 07 13:55:30 2008 +0000
     2.3 @@ -285,9 +285,11 @@
     2.4      extra_config="${extra_config} --disable-multilib"
     2.5      extra_config="${extra_config} ${CT_ARCH_WITH_ARCH} ${CT_ARCH_WITH_ABI} ${CT_ARCH_WITH_CPU} ${CT_ARCH_WITH_TUNE} ${CT_ARCH_WITH_FPU} ${CT_ARCH_WITH_FLOAT}"
     2.6      [ "${CT_SHARED_LIBS}" = "y" ]     || extra_config="${extra_config} --disable-shared"
     2.7 -    [ "${CT_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
     2.8 -    [ -n "${CT_CC_PKGVERSION}" ]      && extra_config="${extra_config} --with-pkgversion=${CT_CC_PKGVERSION}"
     2.9 -    [ -n "${CT_CC_BUGURL}" ]          && extra_config="${extra_config} --with-bugurl=${CT_CC_BUGURL}"
    2.10 +    [ "${CT_GMP_MPFR}" = "y" ]                      && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
    2.11 +    [ -n "${CT_CC_PKGVERSION}" ]                    && extra_config="${extra_config} --with-pkgversion=${CT_CC_PKGVERSION}"
    2.12 +    [ -n "${CT_CC_BUGURL}" ]                        && extra_config="${extra_config} --with-bugurl=${CT_CC_BUGURL}"
    2.13 +    [ "${CT_CC_SJLJ_EXCEPTIONS_USE}" = "y" ]        && extra_config="${extra_config} --enable-sjlj-exceptions"
    2.14 +    [ "${CT_CC_SJLJ_EXCEPTIONS_DONT_USE}" = "y" ]   && extra_config="${extra_config} --disable-sjlj-exceptions"
    2.15      if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then
    2.16          extra_config="${extra_config} --enable-__cxa_atexit"
    2.17      else