[Mesa-dev] [PATCH 1/2] automake: Remove ARCH_FLAGS.

Matt Turner mattst88 at gmail.com
Thu Jul 26 10:11:46 PDT 2012


On Thu, Jul 26, 2012 at 9:52 AM, Eric Anholt <eric at anholt.net> wrote:
> In all current uses, it was appended to CFLAGS, which already had -m32.  If
> you want to do some other flag supplied to compiler invocations, there's
> CFLAGS/CXXFLAGS.
> ---
>  configs/current.in                   |    5 ++---
>  configure.ac                         |    8 ++------
>  src/gallium/drivers/r300/Makefile.am |    1 -
>  src/gallium/drivers/r600/Makefile.am |    1 -
>  4 files changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/configs/current.in b/configs/current.in
> index 9785a5a..1840632 100644
> --- a/configs/current.in
> +++ b/configs/current.in
> @@ -10,15 +10,14 @@ CONFIG_NAME = autoconf
>  CC = @CC@
>  CXX = @CXX@
>  OPT_FLAGS = @OPT_FLAGS@
> -ARCH_FLAGS = @ARCH_FLAGS@
>  PIC_FLAGS = @PIC_FLAGS@
>  DEFINES = @DEFINES@
>  API_DEFINES = @API_DEFINES@
>  SHARED_GLAPI = @SHARED_GLAPI@
>  CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
> -       $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
> +       $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES)
>  CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
> -       $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
> +       $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES)
>  CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
>  CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@
>  LDFLAGS = @LDFLAGS@
> diff --git a/configure.ac b/configure.ac
> index d9fc29c..c81d18b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -249,10 +249,7 @@ AC_SUBST([VISIBILITY_CXXFLAGS])
>  dnl These should be unnecessary, but let the user set them if they want
>  AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
>      Default is to use CFLAGS.])
> -AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
> -    compiler. Default is to use CFLAGS.])
>  AC_SUBST([OPT_FLAGS])
> -AC_SUBST([ARCH_FLAGS])
>
>  dnl
>  dnl Hacks to enable 32 or 64 bit build
> @@ -266,7 +263,6 @@ AC_ARG_ENABLE([32-bit],
>  if test "x$enable_32bit" = xyes; then
>      if test "x$GCC" = xyes; then
>          CFLAGS="$CFLAGS -m32"
> -        ARCH_FLAGS="$ARCH_FLAGS -m32"
>          CCASFLAGS="$CCASFLAGS -m32"
>      fi
>      if test "x$GXX" = xyes; then
> @@ -2305,9 +2301,9 @@ echo "        Static libs:     $enable_static"
>
>  dnl Compiler options
>  # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
> -cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
> +cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS | \
>      $SED 's/^ *//;s/  */ /;s/ *$//'`
> -cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
> +cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS | \
>      $SED 's/^ *//;s/  */ /;s/ *$//'`
>  defines=`echo $DEFINES | $SED 's/^ *//;s/  */ /;s/ *$//'`
>  echo ""
> diff --git a/src/gallium/drivers/r300/Makefile.am b/src/gallium/drivers/r300/Makefile.am
> index 3d08611..ca2b6c0 100644
> --- a/src/gallium/drivers/r300/Makefile.am
> +++ b/src/gallium/drivers/r300/Makefile.am
> @@ -16,7 +16,6 @@ AM_CFLAGS = \
>         $(LLVM_CFLAGS) \
>         $(RADEON_CFLAGS) \
>         $(DEFINES) \
> -       $(ARCH_FLAGS) \
>         $(OPT_FLAGS) \
>         $(PIC_FLAGS)
>
> diff --git a/src/gallium/drivers/r600/Makefile.am b/src/gallium/drivers/r600/Makefile.am
> index ed89d2a..65d0dff 100644
> --- a/src/gallium/drivers/r600/Makefile.am
> +++ b/src/gallium/drivers/r600/Makefile.am
> @@ -9,7 +9,6 @@ AM_CFLAGS = \
>         -I$(top_srcdir)/include \
>         $(RADEON_CFLAGS) \
>         $(DEFINES) \
> -       $(ARCH_FLAGS) \
>         $(OPT_FLAGS) \
>         $(PIC_FLAGS) \
>         $(VISIBILITY_CFLAGS)
> --
> 1.7.10.4

Reviewed-by: Matt Turner <mattst88 at gmail.com>

I'd like to see USER_CFLAGS/USER_CXXFLAGS go too (see ff2efdf5997),
although I see that they have /some/ use: to override CFLAGS set by
configure.ac like -fno-strict-aliasing. I'm not sure we should expose
that functionality to builders. If you're interested in compiling with
-fstrict-aliasing, you'll probably also have to fix some bugs and you
should be capable of patching configure.ac.


More information about the mesa-dev mailing list