[Mesa-dev] [PATCH 2/2] android: fix spirv_info generation

2017-07-19 Thread Tapani Pälli
Depending on build order, LOCAL_PATH maybe set or not (and can't
be trusted to have assumed path), change modifies all occurences
of LOCAL_PATH as locally defined COMPILER_PATH instead.

Signed-off-by: Tapani Pälli 
---
 src/compiler/Android.nir.gen.mk | 38 --
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/src/compiler/Android.nir.gen.mk b/src/compiler/Android.nir.gen.mk
index 4507ac4..81511de 100644
--- a/src/compiler/Android.nir.gen.mk
+++ b/src/compiler/Android.nir.gen.mk
@@ -27,6 +27,8 @@ ifeq ($(LOCAL_MODULE_CLASS),)
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 endif
 
+COMPILER_PATH := $(MESA_TOP)/src/compiler
+
 intermediates := $(call local-generated-sources-dir)
 
 LOCAL_SRC_FILES := $(LOCAL_SRC_FILES)
@@ -48,48 +50,48 @@ MESA_GEN_NIR_H := $(addprefix $(call 
local-generated-sources-dir)/, \
nir/nir_opcodes.h \
nir/nir_builder_opcodes.h)
 
-nir_builder_opcodes_gen := $(LOCAL_PATH)/nir/nir_builder_opcodes_h.py
+nir_builder_opcodes_gen := $(COMPILER_PATH)/nir/nir_builder_opcodes_h.py
 nir_builder_opcodes_deps := \
-   $(LOCAL_PATH)/nir/nir_opcodes.py \
-   $(LOCAL_PATH)/nir/nir_builder_opcodes_h.py
+   $(COMPILER_PATH)/nir/nir_opcodes.py \
+   $(COMPILER_PATH)/nir/nir_builder_opcodes_h.py
 
 $(intermediates)/nir/nir_builder_opcodes.h: $(nir_builder_opcodes_deps)
@mkdir -p $(dir $@)
$(hide) $(MESA_PYTHON2) $(nir_builder_opcodes_gen) $< > $@
 
-nir_constant_expressions_gen := $(LOCAL_PATH)/nir/nir_constant_expressions.py
+nir_constant_expressions_gen := 
$(COMPILER_PATH)/nir/nir_constant_expressions.py
 nir_constant_expressions_deps := \
-   $(LOCAL_PATH)/nir/nir_opcodes.py \
-   $(LOCAL_PATH)/nir/nir_constant_expressions.py
+   $(COMPILER_PATH)/nir/nir_opcodes.py \
+   $(COMPILER_PATH)/nir/nir_constant_expressions.py
 
 $(intermediates)/nir/nir_constant_expressions.c: 
$(nir_constant_expressions_deps)
@mkdir -p $(dir $@)
$(hide) $(MESA_PYTHON2) $(nir_constant_expressions_gen) $< > $@
 
-nir_opcodes_h_gen := $(LOCAL_PATH)/nir/nir_opcodes_h.py
+nir_opcodes_h_gen := $(COMPILER_PATH)/nir/nir_opcodes_h.py
 nir_opcodes_h_deps := \
-   $(LOCAL_PATH)/nir/nir_opcodes.py \
-   $(LOCAL_PATH)/nir/nir_opcodes_h.py
+   $(COMPILER_PATH)/nir/nir_opcodes.py \
+   $(COMPILER_PATH)/nir/nir_opcodes_h.py
 
 $(intermediates)/nir/nir_opcodes.h: $(nir_opcodes_h_deps)
@mkdir -p $(dir $@)
$(hide) $(MESA_PYTHON2) $(nir_opcodes_h_gen) $< > $@
 
-$(LOCAL_PATH)/nir/nir.h: $(intermediates)/nir/nir_opcodes.h
+$(COMPILER_PATH)/nir/nir.h: $(intermediates)/nir/nir_opcodes.h
 
-nir_opcodes_c_gen := $(LOCAL_PATH)/nir/nir_opcodes_c.py
+nir_opcodes_c_gen := $(COMPILER_PATH)/nir/nir_opcodes_c.py
 nir_opcodes_c_deps := \
-   $(LOCAL_PATH)/nir/nir_opcodes.py \
-   $(LOCAL_PATH)/nir/nir_opcodes_c.py
+   $(COMPILER_PATH)/nir/nir_opcodes.py \
+   $(COMPILER_PATH)/nir/nir_opcodes_c.py
 
 $(intermediates)/nir/nir_opcodes.c: $(nir_opcodes_c_deps)
@mkdir -p $(dir $@)
$(hide) $(MESA_PYTHON2) $(nir_opcodes_c_gen) $< > $@
 
-nir_opt_algebraic_gen := $(LOCAL_PATH)/nir/nir_opt_algebraic.py
+nir_opt_algebraic_gen := $(COMPILER_PATH)/nir/nir_opt_algebraic.py
 nir_opt_algebraic_deps := \
-   $(LOCAL_PATH)/nir/nir_opt_algebraic.py \
-   $(LOCAL_PATH)/nir/nir_algebraic.py
+   $(COMPILER_PATH)/nir/nir_opt_algebraic.py \
+   $(COMPILER_PATH)/nir/nir_algebraic.py
 
 $(intermediates)/nir/nir_opt_algebraic.c: $(nir_opt_algebraic_deps)
@mkdir -p $(dir $@)
@@ -98,6 +100,6 @@ $(intermediates)/nir/nir_opt_algebraic.c: 
$(nir_opt_algebraic_deps)
 LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
$(SPIRV_GENERATED_FILES))
 
-$(intermediates)/spirv/spirv_info.c: $(LOCAL_PATH)/spirv/spirv_info_c.py 
$(LOCAL_PATH)/spirv/spirv.core.grammar.json
+$(intermediates)/spirv/spirv_info.c: $(COMPILER_PATH)/spirv/spirv_info_c.py 
$(COMPILER_PATH)/spirv/spirv.core.grammar.json
@mkdir -p $(dir $@)
-   $(hide) $(MESA_PYTHON2) $(LOCAL_PATH)/spirv/spirv_info_c.py 
$(LOCAL_PATH)/spirv/spirv.core.grammar.json $@ || ($(RM) $@; false)
+   $(hide) $(MESA_PYTHON2) $(COMPILER_PATH)/spirv/spirv_info_c.py 
$(COMPILER_PATH)/spirv/spirv.core.grammar.json $@ || ($(RM) $@; false)
-- 
2.9.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] android: fix spirv_info generation

2017-07-19 Thread Emil Velikov
On 19 July 2017 at 08:12, Tapani Pälli  wrote:
> Depending on build order, LOCAL_PATH maybe set or not (and can't
> be trusted to have assumed path), change modifies all occurences
> of LOCAL_PATH as locally defined COMPILER_PATH instead.
>
Sounds like a bug somewhere or a fundamental breakage in the Android world.

$cat src/compiler/Android.mk
...
LOCAL_PATH := $(call my-dir)

include $(LOCAL_PATH)/Android.glsl.mk
include $(LOCAL_PATH)/Android.nir.mk
...

$cat src/compiler/Android.nir.mk
...
LOCAL_PATH := $(call my-dir)
...
include $(CLEAR_VARS) // is this one one causing problems?
...
include $(LOCAL_PATH)/Android.nir.gen.mk
...

Hence LOCAL_PATH should be set, and should point to the correct place.


> Signed-off-by: Tapani Pälli 
> ---
>  src/compiler/Android.nir.gen.mk | 38 --
>  1 file changed, 20 insertions(+), 18 deletions(-)
>
> diff --git a/src/compiler/Android.nir.gen.mk b/src/compiler/Android.nir.gen.mk
> index 4507ac4..81511de 100644
> --- a/src/compiler/Android.nir.gen.mk
> +++ b/src/compiler/Android.nir.gen.mk
> @@ -27,6 +27,8 @@ ifeq ($(LOCAL_MODULE_CLASS),)
>  LOCAL_MODULE_CLASS := STATIC_LIBRARIES
>  endif
>
> +COMPILER_PATH := $(MESA_TOP)/src/compiler
> +
A define LOCAL_PATH at the top of the file should also work, right?

Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] android: fix spirv_info generation

2017-07-19 Thread Tapani Pälli

On 07/19/2017 03:29 PM, Emil Velikov wrote:

On 19 July 2017 at 08:12, Tapani Pälli  wrote:

Depending on build order, LOCAL_PATH maybe set or not (and can't
be trusted to have assumed path), change modifies all occurences
of LOCAL_PATH as locally defined COMPILER_PATH instead.


Sounds like a bug somewhere or a fundamental breakage in the Android world.

$cat src/compiler/Android.mk
...
LOCAL_PATH := $(call my-dir)

include $(LOCAL_PATH)/Android.glsl.mk
include $(LOCAL_PATH)/Android.nir.mk
...

$cat src/compiler/Android.nir.mk
...
LOCAL_PATH := $(call my-dir)
...
include $(CLEAR_VARS) // is this one one causing problems?
...
include $(LOCAL_PATH)/Android.nir.gen.mk
...

Hence LOCAL_PATH should be set, and should point to the correct place.



Signed-off-by: Tapani Pälli 
---
  src/compiler/Android.nir.gen.mk | 38 --
  1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/src/compiler/Android.nir.gen.mk b/src/compiler/Android.nir.gen.mk
index 4507ac4..81511de 100644
--- a/src/compiler/Android.nir.gen.mk
+++ b/src/compiler/Android.nir.gen.mk
@@ -27,6 +27,8 @@ ifeq ($(LOCAL_MODULE_CLASS),)
  LOCAL_MODULE_CLASS := STATIC_LIBRARIES
  endif

+COMPILER_PATH := $(MESA_TOP)/src/compiler
+

A define LOCAL_PATH at the top of the file should also work, right?


Right but this would override what LOCAL_PATH was before so did not want 
to do that. I can try alternative approach. Maybe it is CLEAR_VARS that 
causes this as in my case LOCAL_PATH had something like 'build/core' or 
'core/build' and that did not work.



Thanks
Emil



// Tapani


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] android: fix spirv_info generation

2017-07-19 Thread Emil Velikov
On 19 July 2017 at 14:14, Tapani Pälli  wrote:
> On 07/19/2017 03:29 PM, Emil Velikov wrote:
>>
>> On 19 July 2017 at 08:12, Tapani Pälli  wrote:
>>>
>>> Depending on build order, LOCAL_PATH maybe set or not (and can't
>>> be trusted to have assumed path), change modifies all occurences
>>> of LOCAL_PATH as locally defined COMPILER_PATH instead.
>>>
>> Sounds like a bug somewhere or a fundamental breakage in the Android
>> world.
>>
>> $cat src/compiler/Android.mk
>> ...
>> LOCAL_PATH := $(call my-dir)
>>
>> include $(LOCAL_PATH)/Android.glsl.mk
>> include $(LOCAL_PATH)/Android.nir.mk
>> ...
>>
>> $cat src/compiler/Android.nir.mk
>> ...
>> LOCAL_PATH := $(call my-dir)
>> ...
>> include $(CLEAR_VARS) // is this one one causing problems?
>> ...
>> include $(LOCAL_PATH)/Android.nir.gen.mk
>> ...
>>
>> Hence LOCAL_PATH should be set, and should point to the correct place.
>>
>>
>>> Signed-off-by: Tapani Pälli 
>>> ---
>>>   src/compiler/Android.nir.gen.mk | 38
>>> --
>>>   1 file changed, 20 insertions(+), 18 deletions(-)
>>>
>>> diff --git a/src/compiler/Android.nir.gen.mk
>>> b/src/compiler/Android.nir.gen.mk
>>> index 4507ac4..81511de 100644
>>> --- a/src/compiler/Android.nir.gen.mk
>>> +++ b/src/compiler/Android.nir.gen.mk
>>> @@ -27,6 +27,8 @@ ifeq ($(LOCAL_MODULE_CLASS),)
>>>   LOCAL_MODULE_CLASS := STATIC_LIBRARIES
>>>   endif
>>>
>>> +COMPILER_PATH := $(MESA_TOP)/src/compiler
>>> +
>>
>> A define LOCAL_PATH at the top of the file should also work, right?
>
>
> Right but this would override what LOCAL_PATH was before so did not want to
> do that. I can try alternative approach. Maybe it is CLEAR_VARS that causes
> this as in my case LOCAL_PATH had something like 'build/core' or
> 'core/build' and that did not work.
>
Not sure what causes the fallout here, but if LOCAL_PATH is off then
we should be fine with correcting it.

Quick grep through my very limited checkout shows the following odd
bits. Seemingly unrelated, yet wrong.

system/core/liblog/Android.mk:LOCAL_PATH := $(my-dir)
system/core/Android.mk:LOCAL_PATH := $(my-dir)

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] android: fix spirv_info generation

2017-07-19 Thread Rob Herring
On Wed, Jul 19, 2017 at 8:56 AM, Emil Velikov  wrote:
> On 19 July 2017 at 14:14, Tapani Pälli  wrote:
>> On 07/19/2017 03:29 PM, Emil Velikov wrote:
>>>
>>> On 19 July 2017 at 08:12, Tapani Pälli  wrote:

 Depending on build order, LOCAL_PATH maybe set or not (and can't
 be trusted to have assumed path), change modifies all occurences
 of LOCAL_PATH as locally defined COMPILER_PATH instead.

>>> Sounds like a bug somewhere or a fundamental breakage in the Android
>>> world.
>>>
>>> $cat src/compiler/Android.mk
>>> ...
>>> LOCAL_PATH := $(call my-dir)
>>>
>>> include $(LOCAL_PATH)/Android.glsl.mk
>>> include $(LOCAL_PATH)/Android.nir.mk
>>> ...
>>>
>>> $cat src/compiler/Android.nir.mk
>>> ...
>>> LOCAL_PATH := $(call my-dir)
>>> ...
>>> include $(CLEAR_VARS) // is this one one causing problems?
>>> ...
>>> include $(LOCAL_PATH)/Android.nir.gen.mk
>>> ...
>>>
>>> Hence LOCAL_PATH should be set, and should point to the correct place.
>>>
>>>
 Signed-off-by: Tapani Pälli 
 ---
   src/compiler/Android.nir.gen.mk | 38
 --
   1 file changed, 20 insertions(+), 18 deletions(-)

 diff --git a/src/compiler/Android.nir.gen.mk
 b/src/compiler/Android.nir.gen.mk
 index 4507ac4..81511de 100644
 --- a/src/compiler/Android.nir.gen.mk
 +++ b/src/compiler/Android.nir.gen.mk
 @@ -27,6 +27,8 @@ ifeq ($(LOCAL_MODULE_CLASS),)
   LOCAL_MODULE_CLASS := STATIC_LIBRARIES
   endif

 +COMPILER_PATH := $(MESA_TOP)/src/compiler
 +
>>>
>>> A define LOCAL_PATH at the top of the file should also work, right?
>>
>>
>> Right but this would override what LOCAL_PATH was before so did not want to
>> do that. I can try alternative approach. Maybe it is CLEAR_VARS that causes
>> this as in my case LOCAL_PATH had something like 'build/core' or
>> 'core/build' and that did not work.
>>
> Not sure what causes the fallout here, but if LOCAL_PATH is off then
> we should be fine with correcting it.

Agreed.

> Quick grep through my very limited checkout shows the following odd
> bits. Seemingly unrelated, yet wrong.
>
> system/core/liblog/Android.mk:LOCAL_PATH := $(my-dir)
> system/core/Android.mk:LOCAL_PATH := $(my-dir)

"call" is not required when there are no parameters.

Rob
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] android: fix spirv_info generation

2017-07-19 Thread Tapani Pälli



On 07/19/2017 05:01 PM, Rob Herring wrote:

On Wed, Jul 19, 2017 at 8:56 AM, Emil Velikov  wrote:

On 19 July 2017 at 14:14, Tapani Pälli  wrote:

On 07/19/2017 03:29 PM, Emil Velikov wrote:


On 19 July 2017 at 08:12, Tapani Pälli  wrote:


Depending on build order, LOCAL_PATH maybe set or not (and can't
be trusted to have assumed path), change modifies all occurences
of LOCAL_PATH as locally defined COMPILER_PATH instead.


Sounds like a bug somewhere or a fundamental breakage in the Android
world.

$cat src/compiler/Android.mk
...
LOCAL_PATH := $(call my-dir)

include $(LOCAL_PATH)/Android.glsl.mk
include $(LOCAL_PATH)/Android.nir.mk
...

$cat src/compiler/Android.nir.mk
...
LOCAL_PATH := $(call my-dir)
...
include $(CLEAR_VARS) // is this one one causing problems?
...
include $(LOCAL_PATH)/Android.nir.gen.mk
...

Hence LOCAL_PATH should be set, and should point to the correct place.



Signed-off-by: Tapani Pälli 
---
   src/compiler/Android.nir.gen.mk | 38
--
   1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/src/compiler/Android.nir.gen.mk
b/src/compiler/Android.nir.gen.mk
index 4507ac4..81511de 100644
--- a/src/compiler/Android.nir.gen.mk
+++ b/src/compiler/Android.nir.gen.mk
@@ -27,6 +27,8 @@ ifeq ($(LOCAL_MODULE_CLASS),)
   LOCAL_MODULE_CLASS := STATIC_LIBRARIES
   endif

+COMPILER_PATH := $(MESA_TOP)/src/compiler
+


A define LOCAL_PATH at the top of the file should also work, right?



Right but this would override what LOCAL_PATH was before so did not want to
do that. I can try alternative approach. Maybe it is CLEAR_VARS that causes
this as in my case LOCAL_PATH had something like 'build/core' or
'core/build' and that did not work.


Not sure what causes the fallout here, but if LOCAL_PATH is off then
we should be fine with correcting it.


Agreed.


I've tried this and it does not work. Setting LOCAL_PATH in the file 
results in following (same as before) error:


--- 8< ---
FAILED: /bin/bash -c "python build/core/spirv/spirv_info_c.py 
build/core/spirv/spirv.core.grammar.json 
out/target/product/androidia_64/gen/STATIC_LIBRARIES/libmesa_nir_intermediates/spirv/spirv_info.c 
|| ( 
out/target/product/androidia_64/gen/STATIC_LIBRARIES/libmesa_nir_intermediates/spirv/spirv_info.c; 
false)"
python: can't open file 'build/core/spirv/spirv_info_c.py': [Errno 2] No 
such file or directory

--- 8< ---

Only using something else than LOCAL_PATH, like MY_LOCAL_PATH works.


Quick grep through my very limited checkout shows the following odd
bits. Seemingly unrelated, yet wrong.

system/core/liblog/Android.mk:LOCAL_PATH := $(my-dir)
system/core/Android.mk:LOCAL_PATH := $(my-dir)


"call" is not required when there are no parameters.

Rob


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] android: fix spirv_info generation

2017-07-20 Thread Chih-Wei Huang
2017-07-19 15:12 GMT+08:00 Tapani Pälli :
> Depending on build order, LOCAL_PATH maybe set or not (and can't
> be trusted to have assumed path), change modifies all occurences
> of LOCAL_PATH as locally defined COMPILER_PATH instead.
>
> Signed-off-by: Tapani Pälli 
> ---
>  src/compiler/Android.nir.gen.mk | 38 --
>  1 file changed, 20 insertions(+), 18 deletions(-)
>
> diff --git a/src/compiler/Android.nir.gen.mk b/src/compiler/Android.nir.gen.mk
> index 4507ac4..81511de 100644
> --- a/src/compiler/Android.nir.gen.mk
> +++ b/src/compiler/Android.nir.gen.mk
> @@ -27,6 +27,8 @@ ifeq ($(LOCAL_MODULE_CLASS),)
>  LOCAL_MODULE_CLASS := STATIC_LIBRARIES
>  endif
>
> +COMPILER_PATH := $(MESA_TOP)/src/compiler
> +
>  intermediates := $(call local-generated-sources-dir)
>
>  LOCAL_SRC_FILES := $(LOCAL_SRC_FILES)
> @@ -48,48 +50,48 @@ MESA_GEN_NIR_H := $(addprefix $(call 
> local-generated-sources-dir)/, \
> nir/nir_opcodes.h \
> nir/nir_builder_opcodes.h)
>
> -nir_builder_opcodes_gen := $(LOCAL_PATH)/nir/nir_builder_opcodes_h.py
> +nir_builder_opcodes_gen := $(COMPILER_PATH)/nir/nir_builder_opcodes_h.py
>  nir_builder_opcodes_deps := \
> -   $(LOCAL_PATH)/nir/nir_opcodes.py \
> -   $(LOCAL_PATH)/nir/nir_builder_opcodes_h.py
> +   $(COMPILER_PATH)/nir/nir_opcodes.py \
> +   $(COMPILER_PATH)/nir/nir_builder_opcodes_h.py
>
>  $(intermediates)/nir/nir_builder_opcodes.h: $(nir_builder_opcodes_deps)
> @mkdir -p $(dir $@)
> $(hide) $(MESA_PYTHON2) $(nir_builder_opcodes_gen) $< > $@
>
> -nir_constant_expressions_gen := $(LOCAL_PATH)/nir/nir_constant_expressions.py
> +nir_constant_expressions_gen := 
> $(COMPILER_PATH)/nir/nir_constant_expressions.py
>  nir_constant_expressions_deps := \
> -   $(LOCAL_PATH)/nir/nir_opcodes.py \
> -   $(LOCAL_PATH)/nir/nir_constant_expressions.py
> +   $(COMPILER_PATH)/nir/nir_opcodes.py \
> +   $(COMPILER_PATH)/nir/nir_constant_expressions.py
>
>  $(intermediates)/nir/nir_constant_expressions.c: 
> $(nir_constant_expressions_deps)
> @mkdir -p $(dir $@)
> $(hide) $(MESA_PYTHON2) $(nir_constant_expressions_gen) $< > $@
>
> -nir_opcodes_h_gen := $(LOCAL_PATH)/nir/nir_opcodes_h.py
> +nir_opcodes_h_gen := $(COMPILER_PATH)/nir/nir_opcodes_h.py
>  nir_opcodes_h_deps := \
> -   $(LOCAL_PATH)/nir/nir_opcodes.py \
> -   $(LOCAL_PATH)/nir/nir_opcodes_h.py
> +   $(COMPILER_PATH)/nir/nir_opcodes.py \
> +   $(COMPILER_PATH)/nir/nir_opcodes_h.py
>
>  $(intermediates)/nir/nir_opcodes.h: $(nir_opcodes_h_deps)
> @mkdir -p $(dir $@)
> $(hide) $(MESA_PYTHON2) $(nir_opcodes_h_gen) $< > $@
>
> -$(LOCAL_PATH)/nir/nir.h: $(intermediates)/nir/nir_opcodes.h
> +$(COMPILER_PATH)/nir/nir.h: $(intermediates)/nir/nir_opcodes.h
>
> -nir_opcodes_c_gen := $(LOCAL_PATH)/nir/nir_opcodes_c.py
> +nir_opcodes_c_gen := $(COMPILER_PATH)/nir/nir_opcodes_c.py
>  nir_opcodes_c_deps := \
> -   $(LOCAL_PATH)/nir/nir_opcodes.py \
> -   $(LOCAL_PATH)/nir/nir_opcodes_c.py
> +   $(COMPILER_PATH)/nir/nir_opcodes.py \
> +   $(COMPILER_PATH)/nir/nir_opcodes_c.py
>
>  $(intermediates)/nir/nir_opcodes.c: $(nir_opcodes_c_deps)
> @mkdir -p $(dir $@)
> $(hide) $(MESA_PYTHON2) $(nir_opcodes_c_gen) $< > $@
>
> -nir_opt_algebraic_gen := $(LOCAL_PATH)/nir/nir_opt_algebraic.py
> +nir_opt_algebraic_gen := $(COMPILER_PATH)/nir/nir_opt_algebraic.py
>  nir_opt_algebraic_deps := \
> -   $(LOCAL_PATH)/nir/nir_opt_algebraic.py \
> -   $(LOCAL_PATH)/nir/nir_algebraic.py
> +   $(COMPILER_PATH)/nir/nir_opt_algebraic.py \
> +   $(COMPILER_PATH)/nir/nir_algebraic.py
>
>  $(intermediates)/nir/nir_opt_algebraic.c: $(nir_opt_algebraic_deps)
> @mkdir -p $(dir $@)
> @@ -98,6 +100,6 @@ $(intermediates)/nir/nir_opt_algebraic.c: 
> $(nir_opt_algebraic_deps)
>  LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
> $(SPIRV_GENERATED_FILES))
>
> -$(intermediates)/spirv/spirv_info.c: $(LOCAL_PATH)/spirv/spirv_info_c.py 
> $(LOCAL_PATH)/spirv/spirv.core.grammar.json
> +$(intermediates)/spirv/spirv_info.c: $(COMPILER_PATH)/spirv/spirv_info_c.py 
> $(COMPILER_PATH)/spirv/spirv.core.grammar.json
> @mkdir -p $(dir $@)
> -   $(hide) $(MESA_PYTHON2) $(LOCAL_PATH)/spirv/spirv_info_c.py 
> $(LOCAL_PATH)/spirv/spirv.core.grammar.json $@ || ($(RM) $@; false)
> +   $(hide) $(MESA_PYTHON2) $(COMPILER_PATH)/spirv/spirv_info_c.py 
> $(COMPILER_PATH)/spirv/spirv.core.grammar.json $@ || ($(RM) $@; false)

OK. I see the real problem.
The rules to build spirv_info.c are incorrectly
to use $(LOCAL_PATH).
Basically speaking, $(LOCAL_PATH) can't be used
in the recipes[1] since it is always changing.
When the recipe rules are executed its value
is not you expected.
(using it in targets and prerequisites is OK)

The typical way to handle it is to use private variable:

$(intermediates)/spirv/spirv_info.c: PRIVATE_LOCAL_PATH := $(LOCAL_PATH)

Then use PRIVATE_LOCAL_PAT

Re: [Mesa-dev] [PATCH 2/2] android: fix spirv_info generation

2017-07-20 Thread Chih-Wei Huang
2017-07-20 18:02 GMT+08:00 Chih-Wei Huang :
>
> OK. I see the real problem.
> The rules to build spirv_info.c are incorrectly
> to use $(LOCAL_PATH).
> Basically speaking, $(LOCAL_PATH) can't be used
> in the recipes[1] since it is always changing.
> When the recipe rules are executed its value
> is not you expected.
> (using it in targets and prerequisites is OK)
>
> The typical way to handle it is to use private variable:
>
> $(intermediates)/spirv/spirv_info.c: PRIVATE_LOCAL_PATH := $(LOCAL_PATH)
>
> Then use PRIVATE_LOCAL_PATH in the recpies.
>
> But in this case, seems it can just be simplified to $^
> (which means all the prerequisites)
>
> $(intermediates)/spirv/spirv_info.c:
> $(COMPILER_PATH)/spirv/spirv_info_c.py
> $(COMPILER_PATH)/spirv/spirv.core.grammar.json

Sorry. I meant $(LOCAL_PATH) instead of $(COMPILER_PATH).
(copied wrong lines)

I've submitted a real patch for it.

>  @mkdir -p $(dir $@)
>  $(hide) $(MESA_PYTHON2) $^ $@ || ($(RM) $@; false)



-- 
Chih-Wei
Android-x86 project
http://www.android-x86.org
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] android: fix spirv_info generation

2017-07-20 Thread Emil Velikov
On 20 July 2017 at 11:02, Chih-Wei Huang  wrote:
> 2017-07-19 15:12 GMT+08:00 Tapani Pälli :
>> Depending on build order, LOCAL_PATH maybe set or not (and can't
>> be trusted to have assumed path), change modifies all occurences
>> of LOCAL_PATH as locally defined COMPILER_PATH instead.
>>
>> Signed-off-by: Tapani Pälli 
>> ---
>>  src/compiler/Android.nir.gen.mk | 38 --
>>  1 file changed, 20 insertions(+), 18 deletions(-)
>>
>> diff --git a/src/compiler/Android.nir.gen.mk 
>> b/src/compiler/Android.nir.gen.mk
>> index 4507ac4..81511de 100644
>> --- a/src/compiler/Android.nir.gen.mk
>> +++ b/src/compiler/Android.nir.gen.mk
>> @@ -27,6 +27,8 @@ ifeq ($(LOCAL_MODULE_CLASS),)
>>  LOCAL_MODULE_CLASS := STATIC_LIBRARIES
>>  endif
>>
>> +COMPILER_PATH := $(MESA_TOP)/src/compiler
>> +
>>  intermediates := $(call local-generated-sources-dir)
>>
>>  LOCAL_SRC_FILES := $(LOCAL_SRC_FILES)
>> @@ -48,48 +50,48 @@ MESA_GEN_NIR_H := $(addprefix $(call 
>> local-generated-sources-dir)/, \
>> nir/nir_opcodes.h \
>> nir/nir_builder_opcodes.h)
>>
>> -nir_builder_opcodes_gen := $(LOCAL_PATH)/nir/nir_builder_opcodes_h.py
>> +nir_builder_opcodes_gen := $(COMPILER_PATH)/nir/nir_builder_opcodes_h.py
>>  nir_builder_opcodes_deps := \
>> -   $(LOCAL_PATH)/nir/nir_opcodes.py \
>> -   $(LOCAL_PATH)/nir/nir_builder_opcodes_h.py
>> +   $(COMPILER_PATH)/nir/nir_opcodes.py \
>> +   $(COMPILER_PATH)/nir/nir_builder_opcodes_h.py
>>
>>  $(intermediates)/nir/nir_builder_opcodes.h: $(nir_builder_opcodes_deps)
>> @mkdir -p $(dir $@)
>> $(hide) $(MESA_PYTHON2) $(nir_builder_opcodes_gen) $< > $@
>>
>> -nir_constant_expressions_gen := 
>> $(LOCAL_PATH)/nir/nir_constant_expressions.py
>> +nir_constant_expressions_gen := 
>> $(COMPILER_PATH)/nir/nir_constant_expressions.py
>>  nir_constant_expressions_deps := \
>> -   $(LOCAL_PATH)/nir/nir_opcodes.py \
>> -   $(LOCAL_PATH)/nir/nir_constant_expressions.py
>> +   $(COMPILER_PATH)/nir/nir_opcodes.py \
>> +   $(COMPILER_PATH)/nir/nir_constant_expressions.py
>>
>>  $(intermediates)/nir/nir_constant_expressions.c: 
>> $(nir_constant_expressions_deps)
>> @mkdir -p $(dir $@)
>> $(hide) $(MESA_PYTHON2) $(nir_constant_expressions_gen) $< > $@
>>
>> -nir_opcodes_h_gen := $(LOCAL_PATH)/nir/nir_opcodes_h.py
>> +nir_opcodes_h_gen := $(COMPILER_PATH)/nir/nir_opcodes_h.py
>>  nir_opcodes_h_deps := \
>> -   $(LOCAL_PATH)/nir/nir_opcodes.py \
>> -   $(LOCAL_PATH)/nir/nir_opcodes_h.py
>> +   $(COMPILER_PATH)/nir/nir_opcodes.py \
>> +   $(COMPILER_PATH)/nir/nir_opcodes_h.py
>>
>>  $(intermediates)/nir/nir_opcodes.h: $(nir_opcodes_h_deps)
>> @mkdir -p $(dir $@)
>> $(hide) $(MESA_PYTHON2) $(nir_opcodes_h_gen) $< > $@
>>
>> -$(LOCAL_PATH)/nir/nir.h: $(intermediates)/nir/nir_opcodes.h
>> +$(COMPILER_PATH)/nir/nir.h: $(intermediates)/nir/nir_opcodes.h
>>
>> -nir_opcodes_c_gen := $(LOCAL_PATH)/nir/nir_opcodes_c.py
>> +nir_opcodes_c_gen := $(COMPILER_PATH)/nir/nir_opcodes_c.py
>>  nir_opcodes_c_deps := \
>> -   $(LOCAL_PATH)/nir/nir_opcodes.py \
>> -   $(LOCAL_PATH)/nir/nir_opcodes_c.py
>> +   $(COMPILER_PATH)/nir/nir_opcodes.py \
>> +   $(COMPILER_PATH)/nir/nir_opcodes_c.py
>>
>>  $(intermediates)/nir/nir_opcodes.c: $(nir_opcodes_c_deps)
>> @mkdir -p $(dir $@)
>> $(hide) $(MESA_PYTHON2) $(nir_opcodes_c_gen) $< > $@
>>
>> -nir_opt_algebraic_gen := $(LOCAL_PATH)/nir/nir_opt_algebraic.py
>> +nir_opt_algebraic_gen := $(COMPILER_PATH)/nir/nir_opt_algebraic.py
>>  nir_opt_algebraic_deps := \
>> -   $(LOCAL_PATH)/nir/nir_opt_algebraic.py \
>> -   $(LOCAL_PATH)/nir/nir_algebraic.py
>> +   $(COMPILER_PATH)/nir/nir_opt_algebraic.py \
>> +   $(COMPILER_PATH)/nir/nir_algebraic.py
>>
>>  $(intermediates)/nir/nir_opt_algebraic.c: $(nir_opt_algebraic_deps)
>> @mkdir -p $(dir $@)
>> @@ -98,6 +100,6 @@ $(intermediates)/nir/nir_opt_algebraic.c: 
>> $(nir_opt_algebraic_deps)
>>  LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
>> $(SPIRV_GENERATED_FILES))
>>
>> -$(intermediates)/spirv/spirv_info.c: $(LOCAL_PATH)/spirv/spirv_info_c.py 
>> $(LOCAL_PATH)/spirv/spirv.core.grammar.json
>> +$(intermediates)/spirv/spirv_info.c: $(COMPILER_PATH)/spirv/spirv_info_c.py 
>> $(COMPILER_PATH)/spirv/spirv.core.grammar.json
>> @mkdir -p $(dir $@)
>> -   $(hide) $(MESA_PYTHON2) $(LOCAL_PATH)/spirv/spirv_info_c.py 
>> $(LOCAL_PATH)/spirv/spirv.core.grammar.json $@ || ($(RM) $@; false)
>> +   $(hide) $(MESA_PYTHON2) $(COMPILER_PATH)/spirv/spirv_info_c.py 
>> $(COMPILER_PATH)/spirv/spirv.core.grammar.json $@ || ($(RM) $@; false)
>
> OK. I see the real problem.
> The rules to build spirv_info.c are incorrectly
> to use $(LOCAL_PATH).
> Basically speaking, $(LOCAL_PATH) can't be used
> in the recipes[1] since it is always changing.
> When the recipe rules are executed its value
> is not you expected.
> (using it in targets and