Re: [PATCH] Makefile: Add EXTRA_CFLAGS variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Mon, Jul 22, 2019 at 12:32:44PM +0930, Joel Stanley wrote:
> Distributions packaging dtc may need to set extra flags. Currently when
> they do that it overrides the ones set by the makefile. This is
> particularly problematic when compiling without yaml, as the yaml
> detection is ignored.
> 
>  ld: dtc.o: in function `main':
>  dtc.c:(.text.startup+0x718): undefined reference to `dt_to_yaml'
> 
> This patch provides a EXTRA_CFLAGS variable that is added to the list of
> CFLAGS, and can be set on the command line when packaging.
> 
> Signed-off-by: Joel Stanley <joel@xxxxxxxxx>
> ---
> I was updating the version shipped by buildroot and hit this issue. If
> you have other suggestions for how to resolve the issue then I am open
> to them.

LGTM, applied.

> 
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index e6b32cf1cbf5..6807669569b3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -18,7 +18,7 @@ CONFIG_LOCALVERSION =
>  CPPFLAGS = -I libfdt -I .
>  WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
>  	-Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow
> -CFLAGS = -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS)
> +CFLAGS = -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS) $(EXTRA_CFLAGS)
>  
>  BISON = bison
>  LEX = flex

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux