All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] amdgpu/dc/dml: Consolidate redundant CFLAGS
@ 2018-02-08  1:51 ` Matthias Kaehlcke
  0 siblings, 0 replies; 8+ messages in thread
From: Matthias Kaehlcke @ 2018-02-08  1:51 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Zhou, David Airlie,
	Harry Wentland, Felix Kuehling, Dmytro Laktyushkin
  Cc: amd-gfx, dri-devel, linux-kernel, Guenter Roeck, Justin TerAvest,
	Craig Bergstrom, Matthias Kaehlcke

Use subdir-ccflags instead of specifying the same flags for every source
file.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
---
Changes in v2:
- added 'Reviewed-by: Guenter Roeck <groeck@chromium.org>' tag

 drivers/gpu/drm/amd/display/dc/dml/Makefile | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
index 3488af2b5786..b8cadf833e71 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
@@ -24,15 +24,7 @@
 # It provides the general basic services required by other DAL
 # subcomponents.
 
-CFLAGS_display_mode_vba.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_mode_lib.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_pipe_clocks.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_dml1_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_rq_dlg_helpers.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_soc_bounding_box.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_dml_common_defs.o := -mhard-float -msse -mpreferred-stack-boundary=4
-
+subdir-ccflags-y += -mhard-float -msse -mpreferred-stack-boundary=4
 
 DML = display_mode_lib.o display_rq_dlg_calc.o \
 	  display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
-- 
2.16.0.rc1.238.g530d649a79-goog

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 1/2] amdgpu/dc/dml: Consolidate redundant CFLAGS
@ 2018-02-08  1:51 ` Matthias Kaehlcke
  0 siblings, 0 replies; 8+ messages in thread
From: Matthias Kaehlcke @ 2018-02-08  1:51 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Zhou, David Airlie,
	Harry Wentland, Felix Kuehling, Dmytro Laktyushkin
  Cc: Craig Bergstrom, linux-kernel, dri-devel, Justin TerAvest,
	Matthias Kaehlcke, amd-gfx, Guenter Roeck

Use subdir-ccflags instead of specifying the same flags for every source
file.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
---
Changes in v2:
- added 'Reviewed-by: Guenter Roeck <groeck@chromium.org>' tag

 drivers/gpu/drm/amd/display/dc/dml/Makefile | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
index 3488af2b5786..b8cadf833e71 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
@@ -24,15 +24,7 @@
 # It provides the general basic services required by other DAL
 # subcomponents.
 
-CFLAGS_display_mode_vba.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_mode_lib.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_pipe_clocks.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_dml1_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_display_rq_dlg_helpers.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_soc_bounding_box.o := -mhard-float -msse -mpreferred-stack-boundary=4
-CFLAGS_dml_common_defs.o := -mhard-float -msse -mpreferred-stack-boundary=4
-
+subdir-ccflags-y += -mhard-float -msse -mpreferred-stack-boundary=4
 
 DML = display_mode_lib.o display_rq_dlg_calc.o \
 	  display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
-- 
2.16.0.rc1.238.g530d649a79-goog

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] amdgpu/dc/dml: Support clang option for stack alignment
  2018-02-08  1:51 ` Matthias Kaehlcke
@ 2018-02-08  1:51   ` Matthias Kaehlcke
  -1 siblings, 0 replies; 8+ messages in thread
From: Matthias Kaehlcke @ 2018-02-08  1:51 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Zhou, David Airlie,
	Harry Wentland, Felix Kuehling, Dmytro Laktyushkin
  Cc: amd-gfx, dri-devel, linux-kernel, Guenter Roeck, Justin TerAvest,
	Craig Bergstrom, Matthias Kaehlcke

DML uses the compiler option -mpreferred-stack-boundary=4 to configure
a stack alignment of 16 bytes. Clang uses the option -mstack-alignment
instead, which expects as parameter the alignment in bytes, and not a
power of two like -mpreferred-stack-boundary.

Probe for both compiler options and use the correct one, similar to
what is done in arch/x86/Makefile.

Reported-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
Changes in v2:
- use consistent syntax and formatting for assignment of cc_stack_align

 drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
index b8cadf833e71..a92189eddab0 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
@@ -24,7 +24,13 @@
 # It provides the general basic services required by other DAL
 # subcomponents.
 
-subdir-ccflags-y += -mhard-float -msse -mpreferred-stack-boundary=4
+ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
+	cc_stack_align := -mpreferred-stack-boundary=4
+else ifneq ($(call cc-option, -mstack-alignment=16),)
+	cc_stack_align := -mstack-alignment=16
+endif
+
+subdir-ccflags-y += -mhard-float -msse $(cc_stack_align)
 
 DML = display_mode_lib.o display_rq_dlg_calc.o \
 	  display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
-- 
2.16.0.rc1.238.g530d649a79-goog

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] amdgpu/dc/dml: Support clang option for stack alignment
@ 2018-02-08  1:51   ` Matthias Kaehlcke
  0 siblings, 0 replies; 8+ messages in thread
From: Matthias Kaehlcke @ 2018-02-08  1:51 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Zhou, David Airlie,
	Harry Wentland, Felix Kuehling, Dmytro Laktyushkin
  Cc: Craig Bergstrom, linux-kernel, dri-devel, Justin TerAvest,
	Matthias Kaehlcke, amd-gfx, Guenter Roeck

DML uses the compiler option -mpreferred-stack-boundary=4 to configure
a stack alignment of 16 bytes. Clang uses the option -mstack-alignment
instead, which expects as parameter the alignment in bytes, and not a
power of two like -mpreferred-stack-boundary.

Probe for both compiler options and use the correct one, similar to
what is done in arch/x86/Makefile.

Reported-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
Changes in v2:
- use consistent syntax and formatting for assignment of cc_stack_align

 drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
index b8cadf833e71..a92189eddab0 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
@@ -24,7 +24,13 @@
 # It provides the general basic services required by other DAL
 # subcomponents.
 
-subdir-ccflags-y += -mhard-float -msse -mpreferred-stack-boundary=4
+ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
+	cc_stack_align := -mpreferred-stack-boundary=4
+else ifneq ($(call cc-option, -mstack-alignment=16),)
+	cc_stack_align := -mstack-alignment=16
+endif
+
+subdir-ccflags-y += -mhard-float -msse $(cc_stack_align)
 
 DML = display_mode_lib.o display_rq_dlg_calc.o \
 	  display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
-- 
2.16.0.rc1.238.g530d649a79-goog

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] amdgpu/dc/dml: Support clang option for stack alignment
  2018-02-08  1:51   ` Matthias Kaehlcke
  (?)
@ 2018-02-08  2:04   ` Guenter Roeck
  -1 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2018-02-08  2:04 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: Alex Deucher, Christian König, David Zhou, David Airlie,
	Harry Wentland, Felix Kuehling, Dmytro Laktyushkin, amd-gfx list,
	Maling list - DRI developers, linux-kernel, Guenter Roeck,
	Justin TerAvest, Craig Bergstrom

On Wed, Feb 7, 2018 at 5:51 PM, Matthias Kaehlcke <mka@chromium.org> wrote:
> DML uses the compiler option -mpreferred-stack-boundary=4 to configure
> a stack alignment of 16 bytes. Clang uses the option -mstack-alignment
> instead, which expects as parameter the alignment in bytes, and not a
> power of two like -mpreferred-stack-boundary.
>
> Probe for both compiler options and use the correct one, similar to
> what is done in arch/x86/Makefile.
>
> Reported-by: Guenter Roeck <groeck@chromium.org>
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>

Reviewed-by: Guenter Roeck <groeck@chromium.org>

Guenter

> ---
> Changes in v2:
> - use consistent syntax and formatting for assignment of cc_stack_align
>
>  drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> index b8cadf833e71..a92189eddab0 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> @@ -24,7 +24,13 @@
>  # It provides the general basic services required by other DAL
>  # subcomponents.
>
> -subdir-ccflags-y += -mhard-float -msse -mpreferred-stack-boundary=4
> +ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
> +       cc_stack_align := -mpreferred-stack-boundary=4
> +else ifneq ($(call cc-option, -mstack-alignment=16),)
> +       cc_stack_align := -mstack-alignment=16
> +endif
> +
> +subdir-ccflags-y += -mhard-float -msse $(cc_stack_align)
>
>  DML = display_mode_lib.o display_rq_dlg_calc.o \
>           display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
> --
> 2.16.0.rc1.238.g530d649a79-goog
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] amdgpu/dc/dml: Consolidate redundant CFLAGS
@ 2018-02-08 14:33   ` Harry Wentland
  0 siblings, 0 replies; 8+ messages in thread
From: Harry Wentland @ 2018-02-08 14:33 UTC (permalink / raw)
  To: Matthias Kaehlcke, Alex Deucher, Christian König,
	David Zhou, David Airlie, Felix Kuehling, Dmytro Laktyushkin
  Cc: amd-gfx, dri-devel, linux-kernel, Guenter Roeck, Justin TerAvest,
	Craig Bergstrom

On 2018-02-07 08:51 PM, Matthias Kaehlcke wrote:
> Use subdir-ccflags instead of specifying the same flags for every source
> file.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> Reviewed-by: Guenter Roeck <groeck@chromium.org>
> ---
> Changes in v2:
> - added 'Reviewed-by: Guenter Roeck <groeck@chromium.org>' tag
> 
>  drivers/gpu/drm/amd/display/dc/dml/Makefile | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> index 3488af2b5786..b8cadf833e71 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> @@ -24,15 +24,7 @@
>  # It provides the general basic services required by other DAL
>  # subcomponents.
>  
> -CFLAGS_display_mode_vba.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_mode_lib.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_pipe_clocks.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_dml1_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_rq_dlg_helpers.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_soc_bounding_box.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_dml_common_defs.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -
> +subdir-ccflags-y += -mhard-float -msse -mpreferred-stack-boundary=4

Are you sure this will only apply to dc/dml?

The way the amdgpu build is setup I've seen this flag apply to all of amdgpu, even if specified in a subdirectories build file. The reason being that amdgpu/Makefile recursively includes all other Makefiles in the module.

According to kbuild/makefiles.txt this will have effect for the kbuild file where it's present and all subdirectories:

https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt:
>     subdir-ccflags-y, subdir-asflags-y
> 	The two flags listed above are similar to ccflags-y and asflags-y.
> 	The difference is that the subdir- variants have effect for the kbuild
> 	file where they are present and all subdirectories.
> 	Options specified using subdir-* are added to the commandline before
> 	the options specified using the non-subdir variants.
> 
> 	Example:
> 		subdir-ccflags-y := -Werror

For your 2nd patch you probably want to make a dml_cflags variable that's set different for clang and gcc, and then still set it for all files in DML individually.

You'll probably also have to do the same for dc/calcs/Makefile.

Thanks for finding a good solution for supporting clang. It's been on my list but I haven't had time to find the right flag yet.

Harry

>  
>  DML = display_mode_lib.o display_rq_dlg_calc.o \
>  	  display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] amdgpu/dc/dml: Consolidate redundant CFLAGS
@ 2018-02-08 14:33   ` Harry Wentland
  0 siblings, 0 replies; 8+ messages in thread
From: Harry Wentland @ 2018-02-08 14:33 UTC (permalink / raw)
  To: Matthias Kaehlcke, Alex Deucher, Christian König,
	David Zhou, David Airlie, Felix Kuehling, Dmytro Laktyushkin
  Cc: Craig Bergstrom, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Justin TerAvest,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Guenter Roeck

On 2018-02-07 08:51 PM, Matthias Kaehlcke wrote:
> Use subdir-ccflags instead of specifying the same flags for every source
> file.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> Reviewed-by: Guenter Roeck <groeck@chromium.org>
> ---
> Changes in v2:
> - added 'Reviewed-by: Guenter Roeck <groeck@chromium.org>' tag
> 
>  drivers/gpu/drm/amd/display/dc/dml/Makefile | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> index 3488af2b5786..b8cadf833e71 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> @@ -24,15 +24,7 @@
>  # It provides the general basic services required by other DAL
>  # subcomponents.
>  
> -CFLAGS_display_mode_vba.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_mode_lib.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_pipe_clocks.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_dml1_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_display_rq_dlg_helpers.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_soc_bounding_box.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -CFLAGS_dml_common_defs.o := -mhard-float -msse -mpreferred-stack-boundary=4
> -
> +subdir-ccflags-y += -mhard-float -msse -mpreferred-stack-boundary=4

Are you sure this will only apply to dc/dml?

The way the amdgpu build is setup I've seen this flag apply to all of amdgpu, even if specified in a subdirectories build file. The reason being that amdgpu/Makefile recursively includes all other Makefiles in the module.

According to kbuild/makefiles.txt this will have effect for the kbuild file where it's present and all subdirectories:

https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt:
>     subdir-ccflags-y, subdir-asflags-y
> 	The two flags listed above are similar to ccflags-y and asflags-y.
> 	The difference is that the subdir- variants have effect for the kbuild
> 	file where they are present and all subdirectories.
> 	Options specified using subdir-* are added to the commandline before
> 	the options specified using the non-subdir variants.
> 
> 	Example:
> 		subdir-ccflags-y := -Werror

For your 2nd patch you probably want to make a dml_cflags variable that's set different for clang and gcc, and then still set it for all files in DML individually.

You'll probably also have to do the same for dc/calcs/Makefile.

Thanks for finding a good solution for supporting clang. It's been on my list but I haven't had time to find the right flag yet.

Harry

>  
>  DML = display_mode_lib.o display_rq_dlg_calc.o \
>  	  display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] amdgpu/dc/dml: Consolidate redundant CFLAGS
  2018-02-08 14:33   ` Harry Wentland
  (?)
@ 2018-02-08 18:48   ` Matthias Kaehlcke
  -1 siblings, 0 replies; 8+ messages in thread
From: Matthias Kaehlcke @ 2018-02-08 18:48 UTC (permalink / raw)
  To: Harry Wentland
  Cc: Alex Deucher, Christian König, David Zhou, David Airlie,
	Felix Kuehling, Dmytro Laktyushkin, amd-gfx, dri-devel,
	linux-kernel, Guenter Roeck, Justin TerAvest, Craig Bergstrom

El Thu, Feb 08, 2018 at 09:33:53AM -0500 Harry Wentland ha dit:

> On 2018-02-07 08:51 PM, Matthias Kaehlcke wrote:
> > Use subdir-ccflags instead of specifying the same flags for every source
> > file.
> > 
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > Reviewed-by: Guenter Roeck <groeck@chromium.org>
> > ---
> > Changes in v2:
> > - added 'Reviewed-by: Guenter Roeck <groeck@chromium.org>' tag
> > 
> >  drivers/gpu/drm/amd/display/dc/dml/Makefile | 10 +---------
> >  1 file changed, 1 insertion(+), 9 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> > index 3488af2b5786..b8cadf833e71 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
> > +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
> > @@ -24,15 +24,7 @@
> >  # It provides the general basic services required by other DAL
> >  # subcomponents.
> >  
> > -CFLAGS_display_mode_vba.o := -mhard-float -msse -mpreferred-stack-boundary=4
> > -CFLAGS_display_mode_lib.o := -mhard-float -msse -mpreferred-stack-boundary=4
> > -CFLAGS_display_pipe_clocks.o := -mhard-float -msse -mpreferred-stack-boundary=4
> > -CFLAGS_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
> > -CFLAGS_dml1_display_rq_dlg_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4
> > -CFLAGS_display_rq_dlg_helpers.o := -mhard-float -msse -mpreferred-stack-boundary=4
> > -CFLAGS_soc_bounding_box.o := -mhard-float -msse -mpreferred-stack-boundary=4
> > -CFLAGS_dml_common_defs.o := -mhard-float -msse -mpreferred-stack-boundary=4
> > -
> > +subdir-ccflags-y += -mhard-float -msse -mpreferred-stack-boundary=4
> 
> Are you sure this will only apply to dc/dml?
> 
> The way the amdgpu build is setup I've seen this flag apply to all of amdgpu, even if specified in a subdirectories build file. The reason being that amdgpu/Makefile recursively includes all other Makefiles in the module.
> 
> According to kbuild/makefiles.txt this will have effect for the kbuild file where it's present and all subdirectories:
> 
> https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt:
> >     subdir-ccflags-y, subdir-asflags-y
> > 	The two flags listed above are similar to ccflags-y and asflags-y.
> > 	The difference is that the subdir- variants have effect for the kbuild
> > 	file where they are present and all subdirectories.
> > 	Options specified using subdir-* are added to the commandline before
> > 	the options specified using the non-subdir variants.
> > 
> > 	Example:
> > 		subdir-ccflags-y := -Werror

Thanks, I didn't realize the recursive inclusion from amdgpu/Makefile,
in this case using subdir-ccflags-y indeed isn't a good idea.

> For your 2nd patch you probably want to make a dml_cflags variable
> that's set different for clang and gcc, and then still set it for
> all files in DML individually.

Yep, that was my first impulse and then I remembered
subdir-ccflags-y. Will go back to that.

> You'll probably also have to do the same for dc/calcs/Makefile.

Thanks for the heads up!

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-02-08 18:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08  1:51 [PATCH v2 1/2] amdgpu/dc/dml: Consolidate redundant CFLAGS Matthias Kaehlcke
2018-02-08  1:51 ` Matthias Kaehlcke
2018-02-08  1:51 ` [PATCH v2 2/2] amdgpu/dc/dml: Support clang option for stack alignment Matthias Kaehlcke
2018-02-08  1:51   ` Matthias Kaehlcke
2018-02-08  2:04   ` Guenter Roeck
2018-02-08 14:33 ` [PATCH v2 1/2] amdgpu/dc/dml: Consolidate redundant CFLAGS Harry Wentland
2018-02-08 14:33   ` Harry Wentland
2018-02-08 18:48   ` Matthias Kaehlcke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.