Skip to contentSkip to conversation

svn commit: trunk/buildroot: toolchain toolchain/external-toolchain

Buildroot New jacmet at uclibc.org 3 participants 8 messages Nov 3, 2008 – Nov 4, 2008 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Author: jacmet
Date: 2008-11-03 02:18:39 -0800 (Mon, 03 Nov 2008) New Revision: 23908

Log:
External toolchain support improvements

Improve external toolchain support

* Do not put kernel-headers in the dependencies of BASE_TARGETS in the case where BR2_TOOLCHAIN_SOURCE is not y. The kernel headers are already supposed to be part of the external toolchain, so there's no need to download, extract and install them.

* In the configuration system, don't display the kernel headers version selection list when an external toolchain is selected. This is implemented by moving the source "toolchain/kernel-headers/Config.in" inside the if BR2_TOOLCHAIN_SOURCE in toolchain/Config.in.2.

* Change the description and help message of the BR2_LARGEFILE, BR2_INET_IPV6, BR2_INET_RPC, and BR2_SOFT_FLOAT option in toolchain/external-toolchain/Config.in. In the case of an external toolchain, the semantic of these options is not to enable large file support, IPV6 or RPC (since the toolchain is already compiled, it has been decided previously). Their semantic is to let Buildroot know about the characteristics of the external toolchain being used.

As an improvement, we could guess these values automatically:

- for BR2_LARGEFILE, look at the value of __UCLIBC_HAS_LFS__ in bits/uClibc_config.h in the libc headers directory.

- for BR2_INET_RPC, look at the value of __UCLIBC_HAS_RPC__ in the same file

- for BR2_INET_IPV6, look at the value of __UCLIBC_HAS_IPV6__ in the same file

- for BR2_SOFT_FLOAT, look at the output of $(CC) -v 2>&1 | grep -- "--with-float=soft"

But I'm not sure how this would be possible, since these values are used at configuration-time by other configuration options, not only at build time.

Modified:
trunk/buildroot/Makefile trunk/buildroot/toolchain/Config.in.2 trunk/buildroot/toolchain/external-toolchain/Config.in

Changeset:
Modified: trunk/buildroot/Makefile
===================================================================

buildroot/Makefile +1 -1
@@ -202,7 +202,7 @@
 ifeq ($(BR2_TOOLCHAIN_SOURCE),y)
 BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers
 else
-BASE_TARGETS:=uclibc kernel-headers
+BASE_TARGETS:=uclibc
 endif
 TARGETS:=
 

Modified: trunk/buildroot/toolchain/Config.in.2
===================================================================

buildroot/toolchain/Config.in.2 +1 -2
@@ -1,8 +1,7 @@
 #
 
-source "toolchain/kernel-headers/Config.in"
-
 if BR2_TOOLCHAIN_SOURCE
+source "toolchain/kernel-headers/Config.in"
 source "toolchain/uClibc/Config.in"
 source "toolchain/binutils/Config.in"
 source "toolchain/gcc/Config.in"

Modified: trunk/buildroot/toolchain/external-toolchain/Config.in
===================================================================

buildroot/toolchain/external-toolchain/Config.in +10 -13
@@ -69,33 +69,30 @@
 endchoice
 
 config BR2_LARGEFILE
-	bool "Enable large file (files > 2 GB) support?"
+	bool "Toolchain supports large files (> 2 GB) ?"
 	depends on !BR2_cris
 	default y
 	help
-	  Enable large file (files > 2 GB) support
+	  Set this option if the external toolchain supports large
+	  files (> 2 GB)
 
+
 config BR2_INET_IPV6
-	bool "Enable IPv6"
+	bool "Toolchain supports IPv6 ?"
 	help
-	    Enable IPv6.
+	  Set this option if the external toolchain supports IPv6.
 
 config BR2_INET_RPC
-	bool "Enable RPC"
+	bool "Toolchain supports RPC ?"
 	help
-	    Enable RPC. RPC support is needed for nfs.
+	  Set this option if the external toolchain supports RPC.
 
 config BR2_SOFT_FLOAT
-	bool "Use software floating point by default"
+	bool "Toolchain supports soft float ?"
 	depends on BR2_arm || BR2_armeb || BR2_mips || BR2_mipsel || BR2_powerpc
 	help
-	  If your target CPU does not have a Floating Point Unit (FPU) or a
-	  kernel FPU emulator, but you still wish to support floating point
-	  functions, then everything will need to be compiled with soft
-	  floating point support (-msoft-float).
+	  Set this option if the external toolchain supports soft float.
 
-	  Most people will answer N.
-
 config BR2_TARGET_OPTIMIZATION
 	string "Target Optimizations"
 	default "-Os -pipe"
#1 lore raw

[Buildroot] svn commit: trunk/buildroot: toolchaintoolchain/external-toolchain

Quoted 12 lines · jacmet at uclibc.org

Date: 2008-11-03 02:18:39 -0800 (Mon, 03 Nov 2008) New Revision: 23908

Log:
External toolchain support improvements

Improve external toolchain support

* Do not put kernel-headers in the dependencies of BASE_TARGETS in the case where BR2_TOOLCHAIN_SOURCE is not y. The kernel headers are already supposed to be part of the external toolchain, so there's no need to download, extract and install them.

Quoted 5 lines

* In the configuration system, don't display the kernel headers version selection list when an external toolchain is selected. This is implemented by moving the source "toolchain/kernel-headers/Config.in" inside the if BR2_TOOLCHAIN_SOURCE in toolchain/Config.in.2.

With these two patches I can no longer build kernel 2.6.27.3 using an external 4.1.1-920t toolchain.

I know I should just build a new toolchain with buildroot but I have never been able to successfully get one working. That step I just do not get.....

Removing the following two patches fixes the problem. Any other solution?

Thanks,
Hartley

<snip>

Changeset:
Modified: trunk/buildroot/Makefile
===================================================================

buildroot/Makefile +0 -0
@@ -202,7 +202,7 @@
 ifeq ($(BR2_TOOLCHAIN_SOURCE),y)
 BASE_TARGETS:=uclibc-configured binutils cross_compiler

uclibc-target-utils kernel-headers
else
-BASE_TARGETS:=uclibc kernel-headers
+BASE_TARGETS:=uclibc
endif
TARGETS:=

Modified: trunk/buildroot/toolchain/Config.in.2
===================================================================
--- trunk/buildroot/toolchain/Config.in.2 2008-11-03 06:16:36 UTC
(rev 23907)
+++ trunk/buildroot/toolchain/Config.in.2 2008-11-03 10:18:39 UTC
(rev 23908)
@@ -1,8 +1,7 @@
#

-source "toolchain/kernel-headers/Config.in"
-
if BR2_TOOLCHAIN_SOURCE
+source "toolchain/kernel-headers/Config.in"
source "toolchain/uClibc/Config.in"
source "toolchain/binutils/Config.in"
source "toolchain/gcc/Config.in"

#2 lore raw

[Buildroot] svn commit: trunk/buildroot: toolchaintoolchain/external-toolchain

Le Mon, 3 Nov 2008 16:09:10 -0500, "hartleys" <[email protected]> a ?crit :

Quoted 2 lines

With these two patches I can no longer build kernel 2.6.27.3 using an external 4.1.1-920t toolchain.

Oops. Could you give me your Buildroot .config file ? And the error message you're having ?

To build the kernel, there are two solutions:
* linux (advanced configuration)
* linux (same version as linux headers)

The second solution is probably broken by my change, but the first one seems to work fine here.

I don't use Buildroot to build my kernels, so I missed that problem, sorry.

Quoted 3 lines

I know I should just build a new toolchain with buildroot but I have never been able to successfully get one working. That step I just do not get.....

I also use external toolchain, since I have troubles getting a completely working toolchain with Buildroot.

Quoted 2 lines

Removing the following two patches fixes the problem. Any other solution?

I understand why removing the second chunk fixes something, but not really the first chunk.

Thanks for the feedback !

Thomas

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

[Buildroot] svn commit: trunk/buildroot: toolchaintoolchain/external-toolchain

Hi hartleys,

Please keep the list in Cc, other Buildroot developers can give very valuable insights, very often better than mine.

Le Mon, 3 Nov 2008 19:09:02 -0500, "hartleys" <[email protected]> a ?crit :

Quoted 4 lines
Quoted 1 line

Oops. Could you give me your Buildroot .config file ? And the error

message you're having ?

Attached is the .config

Is this a .config generated with the bare trunk, or with the trunk modified to remove the two chunks that you mentionned previously ?

Since BR2_KERNEL_HEADERS_2_6_27 is set, I'm inclined to think that this is a .config after removal of the two chunks.

Quoted 4 lines
Quoted 4 lines

To build the kernel, there are two solutions:
* linux (advanced configuration)
* linux (same version as linux headers)

Quoted 8 lines
Quoted 2 lines

The second solution is probably broken by my change, but the first one seems to work fine here.

The second is broken with your change.

I tried the first but it's a bit of a pain. Every time there is a new kernel I have to go in an update the values. I guess it's more of a nit...

The second option ? same version as linux headers ? clearly cannot work with my patches: since we're using an external toolchain, there's no version of linux headers defined in Buildroot.

So my proposal is:

1) remove the option "linux (same version as linux headers)" when an

    external toolchain is used ;

2) improve the "advanced" support to suit your needs. What do you mean by ? I have to go in and update the values ? ?

What do you think about this ?

Quoted 5 lines

At this point I'm still in development and a lot of the stuff I am working on is kernel related. I keep sending off patches that are slowly showing up in the newer kernels so I always want the latest stuff. I really wish I could figure out how to use git inside buildroot...

Grant Likely recently sent a patch adding the ability to get the kernel for a Git repository. See
http://buildroot.uclibc.org/lists/buildroot/2008-October/011037.html.
This patch hasn't been integrated to Buildroot, yet.

Quoted 4 lines
Quoted 1 line

I don't use Buildroot to build my kernels, so I missed that problem,

sorry.

Not a problem. How else can you cross compile the kernel?

See slides 136 and following in
http://free-electrons.com/doc/embedded_linux_kernel_and_drivers.pdf.

Sincerly,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH 1/1 Kernel build fix related to external toolchain use

Le Tue, 4 Nov 2008 18:23:14 +0100,
Thomas Petazzoni <[email protected]> a ?crit :

Quoted 2 lines

1) remove the option "linux (same version as linux headers)" when an

    external toolchain is used ;

Kernel build fix related to external toolchain use

This patch prevents the user from select "linux (Same version as linux headers)" as a choice for building the kernel when an external binary toolchain is used, since "same version as linux headers" doesn't make sense when an external toolchain is used.

It fixes the issue encountered by Hartley <[email protected]>

---
 target/Config.in |    7 +++++++
 1 file changed, 7 insertions(+)
target/Config.in +7 -0
Index: buildroot2/target/Config.in
===================================================================
@@ -45,6 +45,11 @@
 	        kernel headers are just that (headers) and not full
 	        kernels. This is a feature.
 
+# The kernel with the same version as linux headers cannot be compiled
+# when using an external toolchain, because the linux headers are not
+# handled by Buildroot in this case.
+if BR2_TOOLCHAIN_SOURCE
+
 config BR2_KERNEL_LINUX
 	bool "linux (Same version as linux headers)"
 	select BR2_PACKAGE_LINUX
@@ -56,6 +61,8 @@
 	        kernel headers are just that (headers) and not full
 	        kernels. This is a feature.
 
+endif
+
 config BR2_KERNEL_HURD
 	bool "hurd"
 	help
Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#6 lore raw

PATCH 1/1 Kernel build fix related to external toolchain use

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Le Tue, 4 Nov 2008 18:23:14 +0100,
Thomas> Thomas Petazzoni <[email protected]> a ?crit :

Quoted 2 lines
Quoted 2 lines

1) remove the option "linux (same version as linux headers)" when an external toolchain is used ;

Thomas> Kernel build fix related to external toolchain use

Thanks! Committed as r23924.

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw

[Buildroot] svn commit: trunk/buildroot: toolchaintoolchain/external-toolchain

In reply to Thomas Petazzoni
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Thomas> The second option ? same version as linux headers ? clearly Thomas> cannot work with my patches: since we're using an external Thomas> toolchain, there's no version of linux headers defined in Thomas> Buildroot.

Thomas> So my proposal is:

Thomas> 1) remove the option "linux (same version as linux headers)" Thomas> when an external toolchain is used ;

Seems logical.

Thomas> Grant Likely recently sent a patch adding the ability to get the kernel Thomas> for a Git repository. See
Thomas> http://buildroot.uclibc.org/lists/buildroot/2008-October/011037.html.
Thomas> This patch hasn't been integrated to Buildroot, yet.

Yeah, it's still on my todo list.

Signature · 1 line
Bye, Peter Korsgaard
#8 lore raw

[Buildroot] svn commit: trunk/buildroot: toolchaintoolchain/external-toolchain

In reply to Thomas Petazzoni
Quoted 2 lines · Thomas Petazzoni

Please keep the list in Cc, other Buildroot developers can give very valuable insights, very often better than mine.

Sorry about that, hit the wrong reply button...

Quoted 10 lines
Quoted 4 lines
Quoted 2 lines

Oops. Could you give me your Buildroot .config file ? And the error message you're having ?

Attached is the .config

Is this a .config generated with the bare trunk, or with the trunk modified to remove the two chunks that you mentionned previously ?

Since BR2_KERNEL_HEADERS_2_6_27 is set, I'm inclined to think that this is a .config after removal of the two chunks.

Correct. The .config is after removing the two patches. That config builds with no problems.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

To build the kernel, there are two solutions:
* linux (advanced configuration)
* linux (same version as linux headers)

The second solution is probably broken by my change, but the first one seems to work fine here.

Quoted 8 lines
Quoted 6 lines

The second is broken with your change.

I tried the first but it's a bit of a pain. Every time there is a new

kernel I have to go in an update the values. I guess it's more of a nit...

The second option < same version as linux headers > clearly cannot

work

Quoted 5 lines

with my patches: since we're using an external toolchain, there's no version of linux headers defined in Buildroot.

So my proposal is:

Quoted 7 lines

1) remove the option "linux (same version as linux headers)" when an external toolchain is used ;

2) improve the "advanced" support to suit your needs. What do you mean by < I have to go in and update the values > ?

What do you think about this ?

I have no problems with your proposal. Maybe I just need a better explanation on how the "advanced" support works.

Right now when Kernel type is set to BR2_KERNEL_LINUX_ADVANCED you get options for the following:

Linux Kernel Version ({string}) --->
Patches --->
Linux Kernel Configuration --->
Kernel binary format ({string}) --->
Destinations for linux kernel binaries --->

There are quite a few Linux Kernel Version choices but the "latest" one is always quite old so I have to select "Linux <custom> version then supply all the information for what kernel I actually want to use.

Like I said, maybe I'm just doing it wrong.

Quoted 10 lines
Quoted 5 lines

At this point I'm still in development and a lot of the stuff I am working on is kernel related. I keep sending off patches that are slowly showing up in the newer kernels so I always want the latest stuff. I really wish I could figure out how to use git inside buildroot...

Grant Likely recently sent a patch adding the ability to get the kernel for a Git repository. See
http://buildroot.uclibc.org/lists/buildroot/2008-October/011037.html.
This patch hasn't been integrated to Buildroot, yet.

I'll look at that.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I don't use Buildroot to build my kernels, so I missed that problem,

sorry.

Not a problem. How else can you cross compile the kernel?

See slides 136 and following in
http://free-electrons.com/doc/embedded_linux_kernel_and_drivers.pdf.

Thanks for the link. I'll take a look at it.

Hartley