[Mesa-dev] [PATCH] fixup! i965: Move the back-end compiler to src/intel/compiler

Emil Velikov emil.l.velikov at gmail.com
Fri Mar 3 14:20:16 UTC 2017


On 3 March 2017 at 11:50, Tapani Pälli <tapani.palli at intel.com> wrote:
>
>
> On 03/03/2017 01:30 PM, Tapani Pälli wrote:
>>
>>
>>
>> On 03/03/2017 01:21 PM, Tapani Pälli wrote:
>>>
>>>
>>>
>>> On 03/02/2017 03:41 PM, Emil Velikov wrote:
>>>>
>>>> Cc: Mauro Rossi <issor.oruam at gmail.com>
>>>> Cc: Tapani Pälli <tapani.palli at intel.com>
>>>> Cc: Jason Ekstrand <jason.ekstrand at intel.com>
>>>> ---
>>>> All, here is a 5min attempt to fix the Android build. Tapani, Mauro do
>>>> give it a test since I've done an educated guess here.
>>>>
>>>> Pull Jason's branch and apply on top.
>>>> https://cgit.freedesktop.org/~jekstrand/mesa/log/?h=wip/move-compiler
>>>
>>>
>>> when compiling blorp and isl it says:
>>>
>>> fatal error: 'brw_compiler.h' file not found
>>>
>>> this can be fixed by putting 'src/intel/compiler' include path for blorp
>>> and isl libraries:
>>>
>>>
>>> https://github.com/tpalli/external-mesa/commit/4ffef80a45bd93731b2d2af0cb532687f11ae8d3
>>>
>>>
>>>
>>> but when linking i965_dri library then there is quite a big explosion of
>>> missing symbols, I can take a look at this but a bit later.
>>
>>
>> doh sorry, it looks like I did not apply your patch after all in that
>> tree ... ignore the noise, will try again
>
>
> ok .. now I got some fixes for this here:
>
> https://github.com/tpalli/external-mesa/commits/move_compiler
>
> but yeah .. more work required :/ I don't understand why adding
> MESA_GEN_GLSL_H to LOCAL_GENERATED_SOURCES does not help.
>
Thanks for the fixup, but I think my earlier suggestion is coming to bite us.

We really want to stop the stop the copy/pasta of the existing rules -
just move them to a common place add use them.
See below for an explicit example. One at a time of course.

To resolve the dependency tracking one can use a) libmesa_genxml
approach or b) have a short parser in the top-level Android.mk that
goes through the BUILT_SOURCES and runs the generation rule(s).

-Emil


With the risk of sounding like a knob I'll repeat the plan, one more time.

 - move the Makefile.am rule, [as-is] to separate file
 - where applicable/needed add $srcdir and define that for Android
 - avoid adding path prefix for the generated files -
 - above might lead to files being generated in a non !$intermediates
path, if so
cd/update instructions to ensure they don't end all over the place.
 - update CleanSpec.mk if needed
 - throw the includes into Makefile.sources/other file
 - ...
 - profit


Here is roughly how things might look - do use better better names as
you see fit.

$ cat src/util/Android.mk

LOCAL_PATH := $(call my-dir)

# We'll need to use srcdir/top_srcdir/others in the next file
# If doing that in MESA_COMMON_MK does not work, because it's too late
- use another file and include it here.

PYTHON_GEN = $(hide)$(MESA_PYTHON2)

include $(LOCAL_PATH)/Makefile.gen // has generation rule(s)
include $(LOCAL_PATH)/Makefile.sources // has sources list(s) and C/CPP/CXXFLAGS

include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(MESA_UTIL_FILES)

LOCAL_CFLAGS := $(MESA_CPP_FLAGS)

LOCAL_MODULE := libmesa_util

LOCAL_MODULE_CLASS := STATIC_LIBRARIES

# Generated sources
# Files are implicitly added the to LOCAL_SRC_FILES by the Android build system
# Generation rules are in Makefile.gen

LOCAL_GENERATED_SOURCES := $(MESA_UTIL_GENERATED_FILES)

include $(MESA_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)

$ cat src/util/Makefile.am

PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)

include Makefile.gen
include Makefile.sources

noinst_LTLIBRARIES = libmesautil.la

libmesautil_la_CPPFLAGS =  $(MESA_CPP_FLAGS)

libmesautil_la_SOURCES = \
       $(MESA_UTIL_FILES) \
       $(MESA_UTIL_GENERATED_FILES)

# test/automake specific bits
...

$ cat src/util/Makefile.sources

MESA_CPP_FLAGS := \
       $(DEFINES) \
       -I$(top_srcdir)/include \
       -I$(top_srcdir)/src \
       -I$(top_srcdir)/src/mapi \
       -I$(top_srcdir)/src/mesa \
       -I$(top_srcdir)/src/gallium/include \
       -I$(top_srcdir)/src/gallium/auxiliary \
       $(VISIBILITY_CFLAGS) \
       $(MSVC2013_COMPAT_CFLAGS)

# existing SOURCES lists
...

$cat src/util/Makefile.gen

format_srgb.c: $(srcdir)/format_srgb.py
       $(PYTHON_GEN) $(srcdir)/format_srgb.py > $@


More information about the mesa-dev mailing list