complibs/ppl: fix build with newer gcc
author"Yann E. MORIN" <yann.morin.1998@free.fr>
Mon Dec 10 00:25:48 2012 +0100 (2012-12-10)
changeset 31353829050af02a
parent 3134 863723936e24
child 3136 927ca2e79394
complibs/ppl: fix build with newer gcc

ppl-0.10.x does not build with gcc-4.6+, as it uses constructs that were
warnings with gcc-4.5 and before, but are now errors with gcc-4.6 and
above.

Fix that by passing -fpermissive in CFLAGS for ppl 0.10.

Reported-by: Jeremy Rosen <jeremy.rosen@openwide.fr>
Reported-by: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
config/companion_libs/ppl.in
scripts/build/companion_libs/120-ppl.sh
     1.1 --- a/config/companion_libs/ppl.in	Wed Dec 05 20:31:43 2012 +0100
     1.2 +++ b/config/companion_libs/ppl.in	Mon Dec 10 00:25:48 2012 +0100
     1.3 @@ -24,6 +24,7 @@
     1.4  config PPL_V_0_10_2
     1.5      bool
     1.6      prompt "0.10.2"
     1.7 +    select PPL_NEEDS_FPERMISSIVE
     1.8  
     1.9  endchoice
    1.10  
    1.11 @@ -36,6 +37,11 @@
    1.12      default "0.11" if PPL_V_0_11
    1.13      default "0.10.2" if PPL_V_0_10_2
    1.14  
    1.15 +# For PPL 0.10, we need -fpermissive to build on gcc 4.7+
    1.16 +# (even gcc-4.6+ ?)
    1.17 +config PPL_NEEDS_FPERMISSIVE
    1.18 +    bool
    1.19 +
    1.20  # For PPL 0.11, we need to pull libpwl if configured static
    1.21  config PPL_0_11
    1.22      bool
     2.1 --- a/scripts/build/companion_libs/120-ppl.sh	Wed Dec 05 20:31:43 2012 +0100
     2.2 +++ b/scripts/build/companion_libs/120-ppl.sh	Mon Dec 10 00:25:48 2012 +0100
     2.3 @@ -30,6 +30,7 @@
     2.4  # - install in build-tools prefix
     2.5  do_ppl_for_build() {
     2.6      local -a ppl_opts
     2.7 +    local ppl_cflags
     2.8  
     2.9      case "${CT_TOOLCHAIN_TYPE}" in
    2.10          native|cross)   return 0;;
    2.11 @@ -38,9 +39,14 @@
    2.12      CT_DoStep INFO "Installing PPL for build"
    2.13      CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-build-${CT_BUILD}"
    2.14  
    2.15 +    ppl_cflags="${CT_CFLAGS_FOR_BUILD}"
    2.16 +    if [ "${CT_PPL_NEEDS_FPERMISSIVE}" = "y" ]; then
    2.17 +        ppl_cflags+=" -fpermissive"
    2.18 +    fi
    2.19 +
    2.20      ppl_opts+=( "host=${CT_BUILD}" )
    2.21      ppl_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
    2.22 -    ppl_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
    2.23 +    ppl_opts+=( "cflags=${ppl_cflags}" )
    2.24      ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
    2.25      do_ppl_backend "${ppl_opts[@]}"
    2.26  
    2.27 @@ -51,13 +57,19 @@
    2.28  # Build PPL for running on host
    2.29  do_ppl_for_host() {
    2.30      local -a ppl_opts
    2.31 +    local ppl_cflags
    2.32  
    2.33      CT_DoStep INFO "Installing PPL for host"
    2.34      CT_mkdir_pushd "${CT_BUILD_DIR}/build-ppl-host-${CT_HOST}"
    2.35  
    2.36 +    ppl_cflags="${CT_CFLAGS_FOR_HOST}"
    2.37 +    if [ "${CT_PPL_NEEDS_FPERMISSIVE}" = "y" ]; then
    2.38 +        ppl_cflags+=" -fpermissive"
    2.39 +    fi
    2.40 +
    2.41      ppl_opts+=( "host=${CT_HOST}" )
    2.42      ppl_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
    2.43 -    ppl_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
    2.44 +    ppl_opts+=( "cflags=${ppl_cflags}" )
    2.45      ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
    2.46      do_ppl_backend "${ppl_opts[@]}"
    2.47