[Mesa-dev] [PATCH v2 2/4] Android: Fix building secondary arch in mixed 32/64-bit builds

Chih-Wei Huang cwhuang at android-x86.org
Mon Feb 15 15:01:45 UTC 2016


2016-02-03 4:45 GMT+08:00 Rob Herring <robh at kernel.org>:
> TARGET_CC is not defined for the secondary arch on combined 32/64-bit
> builds. The build system uses 2ND_TARGET_CC instead and it is not meant
> to be used in module makefiles. LOCAL_CC was used to provide C only
> flags as -std=c99 is not valid for C++ files. Since Android 4.4,
> LOCAL_CONLYFLAGS was added to set compiler flags on C files only, so it
> can be used now instead of LOCAL_CC.
>
> This will break on pre-4.4 versions of Android, but it unlikely anyone
> is using current Mesa with such an old version of Android.
>
> Cc: Emil Velikov <emil.l.velikov at gmail.com>
> Cc: Chih-Wei Huang <cwhuang at android-x86.org>
> Signed-off-by: Rob Herring <robh at kernel.org>
> ---
> v2:
> - move c99 comment
> - Reword the commit msg to better describe the problem and about pre-4.4
>   breakage
>
>  Android.common.mk | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/Android.common.mk b/Android.common.mk
> index 948561c..72fa5d9 100644
> --- a/Android.common.mk
> +++ b/Android.common.mk
> @@ -21,13 +21,8 @@
>  # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>  # DEALINGS IN THE SOFTWARE.
>
> -# use c99 compiler by default
> -ifeq ($(LOCAL_CC),)
>  ifeq ($(LOCAL_IS_HOST_MODULE),true)
> -LOCAL_CC := $(HOST_CC) -std=c99 -D_GNU_SOURCE
> -else
> -LOCAL_CC := $(TARGET_CC) -std=c99
> -endif
> +LOCAL_CFLAGS += -D_GNU_SOURCE
>  endif
>
>  LOCAL_C_INCLUDES += \
> @@ -60,6 +55,10 @@ LOCAL_CFLAGS += \
>         -fvisibility=hidden \
>         -Wno-sign-compare
>
> +# mesa requires at least c99 compiler
> +LOCAL_CONLYFLAGS += \
> +       -std=c99
> +
>  ifeq ($(strip $(MESA_ENABLE_ASM)),true)
>  ifeq ($(TARGET_ARCH),x86)
>  LOCAL_CFLAGS += \
> --

Looks good to me.


-- 
Chih-Wei
Android-x86 project
http://www.android-x86.org


More information about the mesa-dev mailing list