Re: [lng-odp] [PATCH v2] build: fix native Clang build on ARMv8
> -Original Message- > From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of > Dmitry Eremin-Solenikov > Sent: Thursday, April 13, 2017 1:13 AM > To: Brian Brooks ; lng-odp@lists.linaro.org > Subject: Re: [lng-odp] [PATCH v2] build: fix native Clang build on ARMv8 > > On 12.04.2017 21:30, Brian Brooks wrote: > > The build is broken when using clang on ARM. -mcx16 is being passed to > > clang when building natively on ARM. This combined with -Werror causes > > the breakage. Fix it by skipping anything related to -mcx16 when not > > building for x86-based architectures. See [1] for details. > > > > [1] https://lists.linaro.org/pipermail/lng-odp/2017-April/029684.html > > > > v2 > > - Add more description to commit message (Dmitry) This "v2" information should be under --- below. Otherwise it shows up in git log. Remove is from commit log and edit it there manually after format-patch command. -Petri > > > > Signed-off-by: Brian Brooks > > --- > > configure.ac | 30 -- > > 1 file changed, 16 insertions(+), 14 deletions(-) > > Reviewed-by: Dmitry Eremin-Solenikov
Re: [lng-odp] [PATCH v2] build: fix native Clang build on ARMv8
On 12.04.2017 21:30, Brian Brooks wrote: > The build is broken when using clang on ARM. -mcx16 is being passed to > clang when building natively on ARM. This combined with -Werror causes > the breakage. Fix it by skipping anything related to -mcx16 when not > building for x86-based architectures. See [1] for details. > > [1] https://lists.linaro.org/pipermail/lng-odp/2017-April/029684.html > > v2 > - Add more description to commit message (Dmitry) > > Signed-off-by: Brian Brooks > --- > configure.ac | 30 -- > 1 file changed, 16 insertions(+), 14 deletions(-) Reviewed-by: Dmitry Eremin-Solenikov > > diff --git a/configure.ac b/configure.ac > index 9320f360..d364b8dd 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -303,20 +303,22 @@ ODP_CFLAGS="$ODP_CFLAGS -std=c99" > # Extra flags for example to suppress certain warning types > ODP_CFLAGS="$ODP_CFLAGS $ODP_CFLAGS_EXTRA" > > -# > -# Check if compiler supports cmpxchng16 > -## > -if test "${CC}" != "gcc" -o ${CC_VERSION_MAJOR} -ge 5; then > - my_save_cflags="$CFLAGS" > - > - CFLAGS=-mcx16 > - AC_MSG_CHECKING([whether CC supports -mcx16]) > - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], > - [AC_MSG_RESULT([yes])] > - [ODP_CFLAGS="$ODP_CFLAGS $CFLAGS"], > - [AC_MSG_RESULT([no])] > - ) > - CFLAGS="$my_save_cflags" > +## > +# Check if compiler supports cmpxchng16 on x86-based architectures > +## > +if "${host}" == i?86* -o "${host}" == x86*; then > + if test "${CC}" != "gcc" -o ${CC_VERSION_MAJOR} -ge 5; then > + my_save_cflags="$CFLAGS" > + > + CFLAGS=-mcx16 > + AC_MSG_CHECKING([whether CC supports -mcx16]) > + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], > + [AC_MSG_RESULT([yes])] > + [ODP_CFLAGS="$ODP_CFLAGS $CFLAGS"], > + [AC_MSG_RESULT([no])] > + ) > + CFLAGS="$my_save_cflags" > + fi > fi > > ## > -- With best wishes Dmitry
[lng-odp] [PATCH v2] build: fix native Clang build on ARMv8
The build is broken when using clang on ARM. -mcx16 is being passed to clang when building natively on ARM. This combined with -Werror causes the breakage. Fix it by skipping anything related to -mcx16 when not building for x86-based architectures. See [1] for details. [1] https://lists.linaro.org/pipermail/lng-odp/2017-April/029684.html v2 - Add more description to commit message (Dmitry) Signed-off-by: Brian Brooks --- configure.ac | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 9320f360..d364b8dd 100644 --- a/configure.ac +++ b/configure.ac @@ -303,20 +303,22 @@ ODP_CFLAGS="$ODP_CFLAGS -std=c99" # Extra flags for example to suppress certain warning types ODP_CFLAGS="$ODP_CFLAGS $ODP_CFLAGS_EXTRA" -# -# Check if compiler supports cmpxchng16 -## -if test "${CC}" != "gcc" -o ${CC_VERSION_MAJOR} -ge 5; then - my_save_cflags="$CFLAGS" - - CFLAGS=-mcx16 - AC_MSG_CHECKING([whether CC supports -mcx16]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], - [AC_MSG_RESULT([yes])] - [ODP_CFLAGS="$ODP_CFLAGS $CFLAGS"], - [AC_MSG_RESULT([no])] - ) - CFLAGS="$my_save_cflags" +## +# Check if compiler supports cmpxchng16 on x86-based architectures +## +if "${host}" == i?86* -o "${host}" == x86*; then + if test "${CC}" != "gcc" -o ${CC_VERSION_MAJOR} -ge 5; then + my_save_cflags="$CFLAGS" + + CFLAGS=-mcx16 + AC_MSG_CHECKING([whether CC supports -mcx16]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes])] + [ODP_CFLAGS="$ODP_CFLAGS $CFLAGS"], + [AC_MSG_RESULT([no])] + ) + CFLAGS="$my_save_cflags" + fi fi ## -- 2.12.2