[PATCH libevdev] build: check for link-flags harder

Peter Hutterer peter.hutterer at who-t.net
Sun Sep 15 23:37:03 PDT 2013


On Fri, Sep 13, 2013 at 11:28:00AM +0200, David Herrmann wrote:
> Don't use AC_COMPILE_IFELSE but AC_LINK_IFELSE for compiler/linker flags.
> Otherwise, flags like -fstack-protector may compile just fine but the
> linker can lack support for ssp.
> 
> Reported-by: Giovanni Campagna <gcampagn at redhat.com>
> Signed-off-by: David Herrmann <dh.herrmann at gmail.com>
> ---
>  m4/attributes.m4 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/m4/attributes.m4 b/m4/attributes.m4
> index 7e080da..aa53ef2 100644
> --- a/m4/attributes.m4
> +++ b/m4/attributes.m4
> @@ -42,9 +42,9 @@ AC_DEFUN([CC_CHECK_FLAG_APPEND], [
>                   AS_TR_SH([cc_cv_$2_$3]),
>            [eval "AS_TR_SH([cc_save_$2])='${$2}'"
>             eval "AS_TR_SH([$2])='-Werror $3'"
> -           AC_COMPILE_IFELSE([AC_LANG_SOURCE([int a = 0; int main(void) { return a; } ])],
> -                                    [eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
> -                                    [eval "AS_TR_SH([cc_cv_$2_$3])='no'"])
> +           AC_LINK_IFELSE([AC_LANG_SOURCE([int a = 0; int main(void) { return a; } ])],
> +                          [eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
> +                          [eval "AS_TR_SH([cc_cv_$2_$3])='no'"])
>             eval "AS_TR_SH([$2])='$cc_save_$2'"])
>  
>    AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes],
> -- 
> 1.8.4
> 

looks good. Giovanni: did this patch detect your errors?

Cheers,
   Peter


More information about the Input-tools mailing list