Provide a mechanism for adjusting RSCompilerDriver after construction.

We add a simple callback to the reference implementation of libRSDriver.so,
such that additional BCC flags can be toggled/adjusted before doing any
actual CPU compilation.

(Cherry-picked from commit b1e577be646159113e1302d6d37a13751f78d2c5.)

Change-Id: If8e7e6cfc4ad4810890ca9e82969c695f39ca60b
Implement MemChunk::registerAllocFreeCallbacks().

This function allows a driver implementation to register its own handler
for allocating/freeing MemChunk objects. MemChunk is primarily used by
the ELF loader for various code/data segments.

(Cherry-picked from commit 37c0c8c44c1cc0ca9e79f28563fb062598faafe5.)

Change-Id: I94fedfb9fde0c2e686b9ddae31eb45a1fea37801
Add Sampler custom alloc/delete

(Cherry-picked from commit 8725468a009ca71e65d518cfa948ea75437db0de.)

Change-Id: I9085ee083a3ab0045b9aeb49ed525da4b8532b86
rs: Fix aliasing violations

Fix aliasing violations so frameworks/rs can be compiled
without -fno-strict-aliasing

Change-Id: I39dee4712eca722c641741074fa1dbd49414b8cd
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
rs: Use -Wno-error - gcc 4.7 adds new warnings rs can't deal with

Change-Id: I38fe66629552d6f11be1bb69d5a93a05251614df
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Clang: Silence warnings

With GCC >=4.7 Clang generates a lot of noise with various compiler flags,
and can even break the builds when using Flags like Graphite.  This can be
reproduced by doing the following:

Setting TARGET_EXTRA_CFLAGS with Graphite flags such as these
TARGET_EXTRA_CFLAGS +=  -fgraphite-identity \
                        -floop-block \
                        -floop-strip-mine \
                        -ftree-loop-distribution \
                        -ftree-loop-linear

Causes the following errors to occure and the builds to fail:

clang: error: argument unused during compilation: '-fgraphite-identity'
                                                  '-floop-block'
                                                  '-floop-strip-mine'
                                                  '-ftree-loop-distribution'
                                                  '-ftree-loop-linear'

Silence the errors by passing the -Qunused-arguments for CFLAGS

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
rs: Fix build with ISO C++ 11 compilers

ISO C++ 11 no longer allows implicit narrowing during initialization

Change-Id: Ie359c075b6687962eeaa94d909b6cb92df65213f
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
rs: Fix RS_VERSION define

Commit 51dc7a27a8749d4ad43169bf39d4378529e132cd broke the RS_VERSION
define by setting LOCAL_CFLAGS := something after the addition of
LOCAL_CFLAGS += -DRS_VERSION=...

Make sure the := definition occurs before the += amendment.

Change-Id: I320ae9215f3ef2982c707a6ecaf5a14880ffa036
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
rs: Use -Wno-error - gcc 4.7 adds new warnings rs can't deal with

Change-Id: Ic90c85dc70ef0517c35e13392c159ee2f4d38dc3
Suppressed unknown warning option

Change-Id: I0e34099f1cb47767cbddc26c87762d15472ed011