* [RFC PATCH 0/2] Make host compiler and linker flags modifyable
@ 2014-06-20 18:31 Markus Mayer
2014-06-20 18:31 ` [RFC PATCH 1/2] Makefile: Make HOSTCFLAGS and HOSTCXXFLAGS user modifyable Markus Mayer
2014-06-20 18:31 ` [RFC PATCH 2/2] Makefile: Introduce HOSTLDFLAGS environment variable Markus Mayer
0 siblings, 2 replies; 5+ messages in thread
From: Markus Mayer @ 2014-06-20 18:31 UTC (permalink / raw)
To: Michal Marek; +Cc: Linux Build List, Linux Kernel Mailing List
Being able to pass in extra compiler or linker flags for the host
compiler can be quite helpful. This proposed series would allow a user
to do just that.
Please let me know if you would consider this kind of change for
inclusion or if there is an alternate approach to achieve the same
goal.
Markus Mayer (2):
Makefile: Make HOSTCFLAGS and HOSTCXXFLAGS user modifyable
Makefile: Introduce HOSTLDFLAGS environment variable
Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH 1/2] Makefile: Make HOSTCFLAGS and HOSTCXXFLAGS user modifyable
2014-06-20 18:31 [RFC PATCH 0/2] Make host compiler and linker flags modifyable Markus Mayer
@ 2014-06-20 18:31 ` Markus Mayer
2014-06-20 18:44 ` Sam Ravnborg
2014-06-20 18:31 ` [RFC PATCH 2/2] Makefile: Introduce HOSTLDFLAGS environment variable Markus Mayer
1 sibling, 1 reply; 5+ messages in thread
From: Markus Mayer @ 2014-06-20 18:31 UTC (permalink / raw)
To: Michal Marek; +Cc: Linux Build List, Linux Kernel Mailing List
In order to allow the user to pass extra arguments to the host
compiler, we no longer overwrite the host compiler flags in the
makefile, but append them to what was passed in.
Signed-off-by: Markus Mayer <markus.mayer@linaro.org>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 97b2861..5795eea 100644
--- a/Makefile
+++ b/Makefile
@@ -251,8 +251,8 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
HOSTCC = gcc
HOSTCXX = g++
-HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
-HOSTCXXFLAGS = -O2
+HOSTCFLAGS += -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCXXFLAGS += -O2
ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [RFC PATCH 2/2] Makefile: Introduce HOSTLDFLAGS environment variable
2014-06-20 18:31 [RFC PATCH 0/2] Make host compiler and linker flags modifyable Markus Mayer
2014-06-20 18:31 ` [RFC PATCH 1/2] Makefile: Make HOSTCFLAGS and HOSTCXXFLAGS user modifyable Markus Mayer
@ 2014-06-20 18:31 ` Markus Mayer
1 sibling, 0 replies; 5+ messages in thread
From: Markus Mayer @ 2014-06-20 18:31 UTC (permalink / raw)
To: Michal Marek; +Cc: Linux Build List, Linux Kernel Mailing List
By default we don't need HOSTLDFLAGS. However, providing it gives the
user the ability to pass extra flags to the host linker should they be
required.
The variables AS LD CC are moved to the next line to keep line length
in check.
Signed-off-by: Markus Mayer <markus.mayer@linaro.org>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 5795eea..f6e2f53 100644
--- a/Makefile
+++ b/Makefile
@@ -414,8 +414,8 @@ KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
-export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
-export CPP AR NM STRIP OBJCOPY OBJDUMP
+export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE
+export AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP
export MAKE AWK GENKSYMS INSTALLKERNEL PERL UTS_MACHINE
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RFC PATCH 1/2] Makefile: Make HOSTCFLAGS and HOSTCXXFLAGS user modifyable
2014-06-20 18:31 ` [RFC PATCH 1/2] Makefile: Make HOSTCFLAGS and HOSTCXXFLAGS user modifyable Markus Mayer
@ 2014-06-20 18:44 ` Sam Ravnborg
2014-06-20 19:35 ` Markus Mayer
0 siblings, 1 reply; 5+ messages in thread
From: Sam Ravnborg @ 2014-06-20 18:44 UTC (permalink / raw)
To: Markus Mayer; +Cc: Michal Marek, Linux Build List, Linux Kernel Mailing List
On Fri, Jun 20, 2014 at 11:31:28AM -0700, Markus Mayer wrote:
> In order to allow the user to pass extra arguments to the host
> compiler, we no longer overwrite the host compiler flags in the
> makefile, but append them to what was passed in.
>
> Signed-off-by: Markus Mayer <markus.mayer@linaro.org>
> ---
> Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 97b2861..5795eea 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -251,8 +251,8 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
>
> HOSTCC = gcc
> HOSTCXX = g++
> -HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
> -HOSTCXXFLAGS = -O2
> +HOSTCFLAGS += -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
> +HOSTCXXFLAGS += -O2
>
> ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
> HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \
With this patch you can only override HOSTCFLAGS.
In many cases appending to the falgs is actually what you want.
Please take a look at how we have implemented it for the kernel with KCFLAGS.
And notice that this is also described in Documentation/kbuild
Sam
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH 1/2] Makefile: Make HOSTCFLAGS and HOSTCXXFLAGS user modifyable
2014-06-20 18:44 ` Sam Ravnborg
@ 2014-06-20 19:35 ` Markus Mayer
0 siblings, 0 replies; 5+ messages in thread
From: Markus Mayer @ 2014-06-20 19:35 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Michal Marek, Linux Build List, Linux Kernel Mailing List
On 20 June 2014 11:44, Sam Ravnborg <sam@ravnborg.org> wrote:
> On Fri, Jun 20, 2014 at 11:31:28AM -0700, Markus Mayer wrote:
>> In order to allow the user to pass extra arguments to the host
>> compiler, we no longer overwrite the host compiler flags in the
>> makefile, but append them to what was passed in.
>>
>> Signed-off-by: Markus Mayer <markus.mayer@linaro.org>
>> ---
>> Makefile | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 97b2861..5795eea 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -251,8 +251,8 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
>>
>> HOSTCC = gcc
>> HOSTCXX = g++
>> -HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
>> -HOSTCXXFLAGS = -O2
>> +HOSTCFLAGS += -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
>> +HOSTCXXFLAGS += -O2
>>
>> ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
>> HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \
>
> With this patch you can only override HOSTCFLAGS.
> In many cases appending to the falgs is actually what you want.
>
> Please take a look at how we have implemented it for the kernel with KCFLAGS.
> And notice that this is also described in Documentation/kbuild
Thanks. I am able to do what I need using HOST_EXTRACFLAGS and HOST_LOADLIBES.
-Markus
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-06-20 19:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-20 18:31 [RFC PATCH 0/2] Make host compiler and linker flags modifyable Markus Mayer
2014-06-20 18:31 ` [RFC PATCH 1/2] Makefile: Make HOSTCFLAGS and HOSTCXXFLAGS user modifyable Markus Mayer
2014-06-20 18:44 ` Sam Ravnborg
2014-06-20 19:35 ` Markus Mayer
2014-06-20 18:31 ` [RFC PATCH 2/2] Makefile: Introduce HOSTLDFLAGS environment variable Markus Mayer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox