cc/gcc: make sjlj config option a tristate
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Jul 28 23:53:09 2010 +0200 (2010-07-28)
changeset 2042d1f70bef45ba
parent 2041 db17513ee7bf
child 2043 efb1058baa31
cc/gcc: make sjlj config option a tristate

A tristate fits better here than a choice.
config/cc/gcc.in.2
scripts/build/cc/gcc.sh
     1.1 --- a/config/cc/gcc.in.2	Wed Jul 28 21:28:54 2010 +0200
     1.2 +++ b/config/cc/gcc.in.2	Wed Jul 28 23:53:09 2010 +0200
     1.3 @@ -30,40 +30,24 @@
     1.4        need to be disabled. Please see:
     1.5          http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40974
     1.6  
     1.7 -choice
     1.8 -    bool
     1.9 +config CC_GCC_SJLJ_EXCEPTIONS
    1.10 +    tristate
    1.11      prompt "Use sjlj for exceptions"
    1.12 -    default CC_SJLJ_EXCEPTIONS_CONFIGURE
    1.13 -    depends on ! BARE_METAL
    1.14 -
    1.15 -# This config option is used nowhere in the code on purpose.
    1.16 -# It only serves as a choice entry to force neither using nor not using sjlj
    1.17 -config CC_SJLJ_EXCEPTIONS_CONFIGURE
    1.18 -    bool
    1.19 -    prompt "Let configure decide"
    1.20 +    default m
    1.21      help
    1.22 -      Let configure decide if setjmp/longjmp should be used to handle
    1.23 -      exceptions.
    1.24 +      'sjlj' is short for setjmp/longjmp.
    1.25        
    1.26 -      Choose that if you trust configure to detect the correct settings.
    1.27 -      This is the default choice.
    1.28 -
    1.29 -config CC_SJLJ_EXCEPTIONS_USE
    1.30 -    bool
    1.31 -    prompt "Force using sjlj"
    1.32 -    help
    1.33 -      Do use setjmp/longjmp for exceptions.
    1.34 -      This is gcc's --enable-sjlj-exceptions configure switch.
    1.35 +      On some architectures, stack unwinding during exception handling
    1.36 +      works perfectly well without using sjlj, while on some others,
    1.37 +      use of sjlj is required for proper stack unwinding.
    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 +       Option  | sjlj use           | Associated ./configure switch
    1.48 +      ---------+--------------------+--------------------------------
    1.49 +         Y     | forcibly used      | --enable-sjlj-exceptions
    1.50 +         M     | auto               | (none, ./configure decides)
    1.51 +         N     | forcibly not used  | --disable-sjlj-exceptions
    1.52        
    1.53 -      Choose that if you want to not use setjmp/longjmp to handle exceptions.
    1.54 -
    1.55 -endchoice
    1.56 +      It should be safe to say 'M' or 'N'.
    1.57 +      
    1.58 +      It can happen that ./configure is wrong in some cases. Known
    1.59 +      case is for ARM big endian, where you should say 'N'.
     2.1 --- a/scripts/build/cc/gcc.sh	Wed Jul 28 21:28:54 2010 +0200
     2.2 +++ b/scripts/build/cc/gcc.sh	Wed Jul 28 23:53:09 2010 +0200
     2.3 @@ -327,8 +327,11 @@
     2.4      [ "${CT_SHARED_LIBS}" = "y" ]                   || extra_config+=("--disable-shared")
     2.5      [ -n "${CT_CC_PKGVERSION}" ]                    && extra_config+=("--with-pkgversion=${CT_CC_PKGVERSION}")
     2.6      [ -n "${CT_CC_BUGURL}" ]                        && extra_config+=("--with-bugurl=${CT_CC_BUGURL}")
     2.7 -    [ "${CT_CC_SJLJ_EXCEPTIONS_USE}" = "y" ]        && extra_config+=("--enable-sjlj-exceptions")
     2.8 -    [ "${CT_CC_SJLJ_EXCEPTIONS_DONT_USE}" = "y" ]   && extra_config+=("--disable-sjlj-exceptions")
     2.9 +    case "${CT_CC_GCC_SJLJ_EXCEPTIONS}" in
    2.10 +        y)  extra_config+=("--enable-sjlj-exceptions");;
    2.11 +        m)  ;;
    2.12 +        "") extra_config+=("--disable-sjlj-exceptions");;
    2.13 +    esac
    2.14      if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then
    2.15          extra_config+=("--enable-__cxa_atexit")
    2.16      else