All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] linux26: do not set CFLAGS_KERNEL to TARGET_CFLAGS
@ 2009-07-22 20:43 Peter Korsgaard
  2009-07-22 21:24 ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2009-07-22 20:43 UTC (permalink / raw)
  To: buildroot


commit: http://git.buildroot.net/buildroot/commit/?id=7bb5ce002cd9ecd697ed4defd912d3f0de02319b
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Using TARGET_CFLAGS breaks the kernel build for the arm platform. The
result is a kernel that can not be booted. So simply do not fiddle with
the CFLAGS on a kernel build and the kernel build system will do the
right thing (TM).

[Peter: do the same thing for the standard kernel build]

Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 target/linux/Makefile.in          |    3 ---
 target/linux/Makefile.in.advanced |    3 +--
 2 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/target/linux/Makefile.in b/target/linux/Makefile.in
index ff0b88e..3e8bc7b 100644
--- a/target/linux/Makefile.in
+++ b/target/linux/Makefile.in
@@ -89,11 +89,8 @@ LINUX26_PATCH_DIR:=$(BOARD_PATH)/kernel-patches/
 #"))
 endif
 endif
-__LINUX26_NO_PIC=-fPIC -fpic -DPIC -fwrapv -ftrapv
-__LINUX26_ZERO_OPTIMIZATION=-O0
 LINUX26_MAKE_FLAGS = HOSTCC="$(HOSTCC)" HOSTCFLAGS="$(HOSTCFLAGS)" \
 	ARCH=$(KERNEL_ARCH) \
-	CFLAGS_KERNEL="$(filter-out $(__LINUX26_NO_PIC) $(__LINUX26_ZERO_OPTIMIZATION),$(TARGET_CFLAGS))" \
 	INSTALL_MOD_PATH=$(TARGET_DIR) \
 	CROSS_COMPILE=$(KERNEL_CROSS) \
 	LDFLAGS="$(TARGET_LDFLAGS)" \
diff --git a/target/linux/Makefile.in.advanced b/target/linux/Makefile.in.advanced
index 9d878f2..47a1f4e 100644
--- a/target/linux/Makefile.in.advanced
+++ b/target/linux/Makefile.in.advanced
@@ -190,10 +190,8 @@ LINUX_KERNEL:=$(LINUX26_KERNEL)
 # -----------------------------------------------------------------------------
 LINUX26_BZCAT:=$(BZCAT)
 
-__LINUX26_NO_PIC=-fPIC -fpic -DPIC -fwrapv -ftrapv
 LINUX26_MAKE_FLAGS = HOSTCC="$(HOSTCC)" HOSTCFLAGS="$(HOSTCFLAGS)" \
 	ARCH=$(KERNEL_ARCH) \
-	CFLAGS_KERNEL="$(filter-out $(__LINUX26_NO_PIC),$(TARGET_CFLAGS))" \
 	INSTALL_MOD_PATH=$(TARGET_DIR) \
 	CROSS_COMPILE=$(KERNEL_CROSS) \
 	LDFLAGS="$(TARGET_LDFLAGS)" \
@@ -549,6 +547,7 @@ linux-status:
 	@echo LINUX26_SOURCE=$(LINUX26_SOURCE)
 	@echo LINUX26_TARGETS=$(LINUX26_TARGETS)
 	@echo LINUX26_VERSION=$(LINUX26_VERSION)
+	@echo LINUX26_MAKE_FLAGS=$(LINUX26_MAKE_FLAGS)
 	@echo PROJECT_BUILD_DIR=$(PROJECT_BUILD_DIR)
 	@echo TARGETS=$(TARGETS)
 
-- 
1.6.3.3

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

* [Buildroot] [git commit] linux26: do not set CFLAGS_KERNEL to TARGET_CFLAGS
  2009-07-22 20:43 [Buildroot] [git commit] linux26: do not set CFLAGS_KERNEL to TARGET_CFLAGS Peter Korsgaard
@ 2009-07-22 21:24 ` Thomas Petazzoni
  2009-07-22 21:47   ` H Hartley Sweeten
  2009-07-23  5:43   ` Peter Korsgaard
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2009-07-22 21:24 UTC (permalink / raw)
  To: buildroot

Le Wed, 22 Jul 2009 22:43:51 +0200,
Peter Korsgaard <jacmet@sunsite.dk> a ?crit :

> Using TARGET_CFLAGS breaks the kernel build for the arm platform. The
> result is a kernel that can not be booted. So simply do not fiddle
> with the CFLAGS on a kernel build and the kernel build system will do
> the right thing (TM).

I'm not using Buildroot to build kernels, so I'm not sure, but I think
that this commit might break the kernel build with external toolchain.
With external toolchain, the --sysroot option must be passed to allow
gcc to find the headers and libraries. And the --sysroot option is
precisely inside $(TARGET_CFLAGS).

But:
 1. I'm not sure it actually breaks the build, it's a pure supposition
    that will have to be verified ;
 2. We can add the necessary code in the kernel specific Makefile to
    handle that particular situation.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [git commit] linux26: do not set CFLAGS_KERNEL to TARGET_CFLAGS
  2009-07-22 21:24 ` Thomas Petazzoni
@ 2009-07-22 21:47   ` H Hartley Sweeten
  2009-07-23  5:43   ` Peter Korsgaard
  1 sibling, 0 replies; 4+ messages in thread
From: H Hartley Sweeten @ 2009-07-22 21:47 UTC (permalink / raw)
  To: buildroot

On Wednesday, July 22, 2009 2:24 PM, Thomas Petazzoni wrote:
> Le Wed, 22 Jul 2009 22:43:51 +0200,
> Peter Korsgaard <jacmet@sunsite.dk> a ?crit :
> 
>> Using TARGET_CFLAGS breaks the kernel build for the arm platform. The
>> result is a kernel that can not be booted. So simply do not fiddle
>> with the CFLAGS on a kernel build and the kernel build system will do
>> the right thing (TM).
> 
> I'm not using Buildroot to build kernels, so I'm not sure, but I think
> that this commit might break the kernel build with external toolchain.
> With external toolchain, the --sysroot option must be passed to allow
> gcc to find the headers and libraries. And the --sysroot option is
> precisely inside $(TARGET_CFLAGS).

I do use Buildroot to build my kernels with an external toolchain.  The
current implementation works fine for me on an arm ep93xx platform.

> But:
>  1. I'm not sure it actually breaks the build, it's a pure supposition
>     that will have to be verified ;
>  2. We can add the necessary code in the kernel specific Makefile to
>     handle that particular situation.

I'm not sure if not passing the --sysroot option will break the build
of the kernel.  Isn't the kernel self contained and doesn't use any
external headers or libraries?

I will try to make some time to test the patch and see what happens.

Regards,
Hartley

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

* [Buildroot] [git commit] linux26: do not set CFLAGS_KERNEL to TARGET_CFLAGS
  2009-07-22 21:24 ` Thomas Petazzoni
  2009-07-22 21:47   ` H Hartley Sweeten
@ 2009-07-23  5:43   ` Peter Korsgaard
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2009-07-23  5:43 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> I'm not using Buildroot to build kernels, so I'm not sure,
 Thomas> but I think that this commit might break the kernel build
 Thomas> with external toolchain.  With external toolchain, the
 Thomas> --sysroot option must be passed to allow gcc to find the
 Thomas> headers and libraries. And the --sysroot option is precisely
 Thomas> inside $(TARGET_CFLAGS).

But the kernel doesn't use any userspace headers/libraries, so that
afaik shouldn't be a problem.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2009-07-23  5:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-22 20:43 [Buildroot] [git commit] linux26: do not set CFLAGS_KERNEL to TARGET_CFLAGS Peter Korsgaard
2009-07-22 21:24 ` Thomas Petazzoni
2009-07-22 21:47   ` H Hartley Sweeten
2009-07-23  5:43   ` Peter Korsgaard

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.