Skip to contentSkip to conversation

Pull request for branch program-invocation-and-coreutils

GIT PULL New Thomas Petazzoni 2 participants 10 messages Jul 31, 2009

lore
Share & tools
lore
#0 lore raw

The following changes since commit d4a8eebf597da6e992e663c73f152c49724f7236:
Peter Korsgaard (1):

        kernel-headers: bump 2.6.27 / 2.6.30 stable versions

are available in the git repository at:

git://git.busybox.net/~tpetazzoni/git/buildroot program-invocation-and-coreutils

Thomas Petazzoni (3):
Fix PROGRAM_INVOCATION handling with external toolchains
coreutils: bump version
coreutils: add TODO note about stripping the installed binaries

 TODO                                               |   10 ++++++++
 package/coreutils/Config.in                        |    4 +-
 .../coreutils/coreutils-7.4-rename-m4-fix.patch    |   25 ++++++++++++++++++++
 package/coreutils/coreutils.mk                     |    7 +++--
 package/tar/Config.in                              |    4 +-
 target/generic/Config.in                           |    4 +-
 toolchain/Config.in.2                              |   10 ++++++++
 toolchain/external-toolchain/ext-tool.mk           |    4 ++-
 toolchain/uClibc/Config.in                         |    8 ------
 toolchain/uClibc/uclibc.mk                         |    2 +-
 10 files changed, 59 insertions(+), 19 deletions(-)
 create mode 100644 package/coreutils/coreutils-7.4-rename-m4-fix.patch

Thanks,

Signature · 1 line
Thomas Petazzoni
#1 lore raw

PATCH 1/3 Fix PROGRAM_INVOCATION handling with external toolchains

BR2_UCLIBC_PROGRAM_INVOCATION is a toolchain configuration option, like BR2_INET_IPV6, BR2_INET_RPC, on which some packages depend. Therefore, it should be handled like BR2_INET_IPV6 and BR2_INET_RPC in order to work properly with external toolchains.

Since we move it out of toolchain/uClibc/Config.in into toolchain/Config.in.2, we rename the option to BR2_PROGRAM_INVOCATION (since BR2_INET_RPC and others don't have UCLIBC in their name).

---
 package/coreutils/Config.in              |    4 ++--
 package/tar/Config.in                    |    4 ++--
 target/generic/Config.in                 |    4 ++--
 toolchain/Config.in.2                    |   10 ++++++++++
 toolchain/external-toolchain/ext-tool.mk |    4 +++-
 toolchain/uClibc/Config.in               |    8 --------
 toolchain/uClibc/uclibc.mk               |    2 +-
 7 files changed, 20 insertions(+), 16 deletions(-)
package/coreutils/Config.in +2 -2
index 5dfe43c..a7159cf 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_COREUTILS
 	bool "coreutils"
-	depends on BR2_USE_WCHAR && BR2_UCLIBC_PROGRAM_INVOCATION
+	depends on BR2_USE_WCHAR && BR2_PROGRAM_INVOCATION
 	help
 	  All of the basic file/text/shell utilities.  These are the
 	  core utilities which are expected to exist on every system.
@@ -14,4 +14,4 @@ config BR2_PACKAGE_COREUTILS
 	  http://www.gnu.org/software/coreutils/
 
 comment "coreutils requires a toolchain with WCHAR and PROGRAM_INVOCATION support"
-	depends on !(BR2_USE_WCHAR && BR2_UCLIBC_PROGRAM_INVOCATION)
+	depends on !(BR2_USE_WCHAR && BR2_PROGRAM_INVOCATION)
package/tar/Config.in +2 -2
index a257949..20529e3 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_TAR
 	bool "tar"
-	depends on BR2_USE_WCHAR && BR2_UCLIBC_PROGRAM_INVOCATION
+	depends on BR2_USE_WCHAR && BR2_PROGRAM_INVOCATION
 	help
 	  A program that saves many files together into a single tape or disk
 	  archive, and can restore individual files from the archive.
@@ -8,4 +8,4 @@ config BR2_PACKAGE_TAR
 	  http://www.gnu.org/software/tar/
 
 comment "tar requires a toolchain with WCHAR and PROGRAM_INVOCATION support"
-	depends on !(BR2_USE_WCHAR && BR2_UCLIBC_PROGRAM_INVOCATION)
+	depends on !(BR2_USE_WCHAR && BR2_PROGRAM_INVOCATION)
target/generic/Config.in +2 -2
index 5f5110c..5de5811 100644
@@ -18,7 +18,7 @@ config BR2_TARGET_GENERIC_FIREWALL
 
 config BR2_TARGET_GENERIC_DEV_SYSTEM
 	bool "Generic development system"
-	depends on BR2_USE_WCHAR && BR2_UCLIBC_PROGRAM_INVOCATION
+	depends on BR2_USE_WCHAR && BR2_PROGRAM_INVOCATION
 	select BR2_CCACHE
 	select BR2_PACKAGE_GDB
 	select BR2_PACKAGE_GDB_SERVER
@@ -59,7 +59,7 @@ config BR2_TARGET_GENERIC_DEV_SYSTEM
 	  Board support for a generic development system.
 
 comment "Generic development system requires a toolchain with WCHAR and PROGRAM_INVOCATION support"
-	depends on !(BR2_USE_WCHAR && BR2_UCLIBC_PROGRAM_INVOCATION)
+	depends on !(BR2_USE_WCHAR && BR2_PROGRAM_INVOCATION)
 
 menuconfig BR2_TARGET_GENERIC_GETTY
 	bool "Generic serial port config"
toolchain/Config.in.2 +10 -0
index 5df04e0..2a9ce24 100644
@@ -119,6 +119,16 @@ choice
 		bool "Native POSIX Threading (NPTL)"
 endchoice
 
+config BR2_PROGRAM_INVOCATION
+	bool "Enable 'program invocation name'"
+	help
+	  Support for the GNU-specific program_invocation_name and
+	  program_invocation_short_name strings.  Some GNU packages
+	  (like tar and coreutils) utilize these for extra useful
+	  output, but in general are not required.
+	  If you have an external binary toolchain that has been built
+	  with program invocation support then enable this option.
+
 config BR2_GCC_CROSS_CXX
 	bool
 	help
toolchain/external-toolchain/ext-tool.mk +3 -1
index d441a92..568ac3a 100644
@@ -115,7 +115,8 @@ check_glibc = \
 	$(call check_glibc_feature,BR2_INET_IPV6,IPv6 support) ;\
 	$(call check_glibc_feature,BR2_INET_RPC,RPC support) ;\
 	$(call check_glibc_feature,BR2_ENABLE_LOCALE,Locale support) ;\
-	$(call check_glibc_feature,BR2_USE_WCHAR,Wide char support)
+	$(call check_glibc_feature,BR2_USE_WCHAR,Wide char support) ;\
+	$(call check_glibc_feature,BR2_PROGRAM_INVOCATION,Program invocation support)
 
 #
 # Check the conformity of Buildroot configuration with regard to the
@@ -160,6 +161,7 @@ check_uclibc = \
 	$(call check_uclibc_feature,__UCLIBC_HAS_RPC__,BR2_INET_RPC,$${UCLIBC_CONFIG_FILE},RPC support) ;\
 	$(call check_uclibc_feature,__UCLIBC_HAS_LOCALE__,BR2_ENABLE_LOCALE,$${UCLIBC_CONFIG_FILE},Locale support) ;\
 	$(call check_uclibc_feature,__UCLIBC_HAS_WCHAR__,BR2_USE_WCHAR,$${UCLIBC_CONFIG_FILE},Wide char support) ;\
+	$(call check_uclibc_feature,__UCLIBC_HAS_PROGRAM_INVOCATION_NAME__,BR2_PROGRAM_INVOCATION,$${UCLIBC_CONFIG_FILE},Program invocation support) ;\
 
 #
 # Check that the Buildroot configuration of the ABI matches the
toolchain/uClibc/Config.in +0 -8
index b7678a3..d0486ab 100644
@@ -68,14 +68,6 @@ config BR2_PTHREAD_DEBUG
 	help
 	  Build the thread library with debugging enabled.
 
-config BR2_UCLIBC_PROGRAM_INVOCATION
-	bool "Enable 'program invocation name'"
-	help
-	  Support for the GNU-specific program_invocation_name and
-	  program_invocation_short_name strings.  Some GNU packages
-	  (like tar and coreutils) utilize these for extra useful
-	  output, but in general are not required.
-
 config BR2_UCLIBC_INSTALL_TEST_SUITE
 	bool "Compile and install uClibc tests"
 	select BR2_PACKAGE_MAKE
toolchain/uClibc/uclibc.mk +1 -1
index 80d7d98..de8e1d5 100644
@@ -353,7 +353,7 @@ ifeq ($(BR2_USE_WCHAR),y)
 else
 	$(SED) 's,^.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=n,g' $(UCLIBC_DIR)/.oldconfig
 endif
-ifeq ($(BR2_UCLIBC_PROGRAM_INVOCATION),y)
+ifeq ($(BR2_PROGRAM_INVOCATION),y)
 	$(SED) 's,^.*UCLIBC_HAS_PROGRAM_INVOCATION_NAME.*,UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y,g' $(UCLIBC_DIR)/.oldconfig
 else
 	$(SED) 's,^.*UCLIBC_HAS_PROGRAM_INVOCATION_NAME.*,UCLIBC_HAS_PROGRAM_INVOCATION_NAME=n,g' $(UCLIBC_DIR)/.oldconfig
Signature · 1 line
1.6.0.4
#2 lore raw

PATCH 1/3 Fix PROGRAM_INVOCATION handling with external toolchains

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

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

Thomas> BR2_UCLIBC_PROGRAM_INVOCATION is a toolchain configuration option, Thomas> like BR2_INET_IPV6, BR2_INET_RPC, on which some packages Thomas> depend. Therefore, it should be handled like BR2_INET_IPV6 and Thomas> BR2_INET_RPC in order to work properly with external toolchains.

Thomas> Since we move it out of toolchain/uClibc/Config.in into Thomas> toolchain/Config.in.2, we rename the option to BR2_PROGRAM_INVOCATION Thomas> (since BR2_INET_RPC and others don't have UCLIBC in their name).

Thanks. We should probably also update the defconfigs that sets this - I'll do that.

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

PATCH 1/3 Fix PROGRAM_INVOCATION handling with external toolchains

Le Fri, 31 Jul 2009 15:30:30 +0200,
Peter Korsgaard <[email protected]> a ?crit :

Quoted 2 lines

Thanks. We should probably also update the defconfigs that sets this - I'll do that.

Yes, I've seen them with 'git grep', but I don't know what's the procedure to update them. Just a quick sed pass ?

Thanks,

Thomas

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

PATCH 1/3 Fix PROGRAM_INVOCATION handling with external toolchains

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

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

Thomas> Le Fri, 31 Jul 2009 15:30:30 +0200, Thomas> Peter Korsgaard <[email protected]> a ?crit :

Quoted 2 lines
Quoted 2 lines

Thanks. We should probably also update the defconfigs that sets this - I'll do that.

Thomas> Yes, I've seen them with 'git grep', but I don't know what's the Thomas> procedure to update them. Just a quick sed pass ?

Yes, that's what I just did.

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

PATCH 2/3 coreutils: bump version

In reply to Thomas Petazzoni

Coreutils 6.9 was broken with glibc >= 2.6, due to a coreutils internal function being named like a glibc function. This has been fixed in more recent coreutils version, by
http://lists.pld-linux.org/mailman/pipermail/pld-cvs-commit/Week-of-Mon-20070514/155466.html.

Therefore, we upgrade coreutils to its latest version, 7.4, which raised two problems:

* Recent coreutils releases are not anymore available as .bz2 archives, only .xz archives. Since this archive format is not supported by Buildroot yet, and the corresponding tools are not widely available yet, we fallback to the bigger .gz format for the coreutils package.

* The rename bug detection script m4/rename.m4 was broken, leading coreutils to try to include windows.h and compile some Windows-specific code. We introduce a patch to fix this, patch which has been taken from gnulib. We also make sure that this workaround is nevery compiled in by passing gl_cv_func_rename_dest_exists_bug=no to the configure script.

---
 .../coreutils/coreutils-7.4-rename-m4-fix.patch    |   25 ++++++++++++++++++++
 package/coreutils/coreutils.mk                     |    7 +++--
 2 files changed, 29 insertions(+), 3 deletions(-)
 create mode 100644 package/coreutils/coreutils-7.4-rename-m4-fix.patch
package/coreutils/coreutils-7.4-rename-m4-fix.patch new file +25 -0
new file mode 100644
index 0000000..f869f43
@@ -0,0 +1,25 @@
+Commit 7fcb389fb4cd5ba26e330fef991ffdc05392f289 from gnulib, to fix
+the rename bugs detection macros.
+---
+ m4/rename.m4 |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: coreutils-7.4/m4/rename.m4
+===================================================================
+--- coreutils-7.4.orig/m4/rename.m4
++++ coreutils-7.4/m4/rename.m4
+@@ -51,12 +51,12 @@
+     AC_LIBOBJ([rename])
+     AC_DEFINE([rename], [rpl_rename],
+       [Define to rpl_rename if the replacement function should be used.])
+-    if test $gl_cv_func_rename_trailing_slash_bug; then
++    if test $gl_cv_func_rename_trailing_slash_bug = yes; then
+       AC_DEFINE([RENAME_TRAILING_SLASH_BUG], [1],
+ 	[Define if rename does not work for source file names with a trailing
+ 	 slash, like the one from SunOS 4.1.1_U1.])
+     fi
+-    if test $gl_cv_func_rename_dest_exists_bug; then
++    if test $gl_cv_func_rename_dest_exists_bug = yes; then
+       AC_DEFINE([RENAME_DEST_EXISTS_BUG], [1],
+ 	[Define if rename does not work when the destination file exists,
+ 	 as on Windows.])
package/coreutils/coreutils.mk +4 -3
index 31de2d5..2c9c0d3 100644
@@ -3,11 +3,11 @@
 # coreutils
 #
 #############################################################
-COREUTILS_VERSION:=6.9
-COREUTILS_SOURCE:=coreutils-$(COREUTILS_VERSION).tar.bz2
+COREUTILS_VERSION:=7.4
+COREUTILS_SOURCE:=coreutils-$(COREUTILS_VERSION).tar.gz
 #COREUTILS_SITE:=ftp://alpha.gnu.org/gnu/coreutils/
 COREUTILS_SITE:=$(BR2_GNU_MIRROR)/coreutils
-COREUTILS_CAT:=$(BZCAT)
+COREUTILS_CAT:=$(ZCAT)
 COREUTILS_DIR:=$(BUILD_DIR)/coreutils-$(COREUTILS_VERSION)
 COREUTILS_BINARY:=src/vdir
 COREUTILS_TARGET_BINARY:=bin/vdir
@@ -59,6 +59,7 @@ $(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked
 		ac_cv_func_mkstemp=yes \
 		utils_cv_func_mkstemp_limitations=no \
 		utils_cv_func_mkdir_trailing_slash_bug=no \
+		gl_cv_func_rename_dest_exists_bug=no \
 		ac_cv_func_memcmp_working=yes \
 		ac_cv_have_decl_malloc=yes \
 		gl_cv_func_malloc_0_nonnull=yes \
Signature · 1 line
1.6.0.4
#6 lore raw

PATCH 3/3 coreutils: add TODO note about stripping the installed binaries

In reply to Thomas Petazzoni
---
 TODO |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
TODO +10 -0
index 4de15ab..bf98fea 100644
@@ -5,3 +5,13 @@ Buildroot2 TODOs
 - convert all packages that use autoconf to use the infrastructure of
   packages/Makefile.autotools.in
 - fix setting of flags for packages
+
+- coreutils: use make install-strip to install the packages. For now,
+  it fails beause even if we pass STRIP="/path/to/$(ARCH)-strip", the
+  coreutils build system uses the host strip to strip target
+  binaries. The ./configure execution done by Buildroot properly
+  detects the cross-strip, but when running make, build-aux/missing
+  gets run, complains about aclocal-1.10c and atuomake-1.10c not being
+  present, and rerun the configuration... with the wrong environment
+  variables (STRIP= is missing). An autoreconf on this package is
+  probably necessary.
Signature · 1 line
1.6.0.4
#7 lore raw

PATCH 3/3 coreutils: add TODO note about stripping the installed binaries

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

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

Hi,

Thomas> +- coreutils: use make install-strip to install the Thomas> +packages. For now, it fails beause even if we pass Thomas> +STRIP="/path/to/$(ARCH)-strip", the coreutils build system Thomas> +uses the host strip to strip target binaries. The Thomas> +./configure execution done by Buildroot properly detects the Thomas> +cross-strip, but when running make, build-aux/missing gets Thomas> +run, complains about aclocal-1.10c and atuomake-1.10c not Thomas> +being present, and rerun the configuration... with the wrong Thomas> +environment variables (STRIP= is missing). An autoreconf on Thomas> +this package is probably necessary.

We should actually rework the strip stuff as it doesn't make much sense to both do strip at package install time and just before generating the file systems.

We would probably simplify stuff a bit to always use install / install-exec and only strip at the end if wanted.

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

PATCH 3/3 coreutils: add TODO note about stripping the installed binaries

Le Fri, 31 Jul 2009 15:32:40 +0200,
Peter Korsgaard <[email protected]> a ?crit :

Quoted 6 lines

We should actually rework the strip stuff as it doesn't make much sense to both do strip at package install time and just before generating the file systems.

We would probably simplify stuff a bit to always use install / install-exec and only strip at the end if wanted.

Same thing for the installation of headers or documentation. We have different cases :

* Some packages do make install into the staging dir, and then carefully copy only what's needed to the target dir (excluding documentation and headers) ;

* Some packages do make install into the target dir, then cleanup what's not needed, sometimes looking at BR2_HAVE_DEVFILS and BR2_HAVE_DOCUMENTATION, sometimes not ;

* Some packages do make install into the target dir, and don't cleanup anything, waiting for the final global cleanup of the root filesystem done by target-finalize in the main Makefile.

I don't have a particularly strong opinion on this and the strip case. Intuitively, I would say I find the solution of letting each package handle its stripping and its installation properly to be the cleanest solution (i.e no global final cleanup).

I know at least of one corner case that would defeat the global stripping approach: binaries developed in OCaml. See
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900. Admittedly, that's a corner case and I don't think we really care about it, but that's a known drawback of the global approach: it's not possible to make fine-grained exceptions (but is it a problem ? not sure).

Another advantage of the per-package approach is that simply doing "make install" to the target space is sometimes too heavy for some packages, that install some utility/test/config/sample applications that we don't want on the target. Using a per-package approach would probably encourage people to be more careful about what they install in the target space.

To conclude: I think I have a preference for the per-package approach, but I wouldn't complain too much if the global approach only is the one we go with :-)

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#9 lore raw
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:

Thomas> The following changes since commit d4a8eebf597da6e992e663c73f152c49724f7236:
Thomas> Peter Korsgaard (1):
Thomas> kernel-headers: bump 2.6.27 / 2.6.30 stable versions

Thomas> are available in the git repository at:

Thomas> git://git.busybox.net/~tpetazzoni/git/buildroot program-invocation-and-coreutils

Thomas> Thomas Petazzoni (3):

 Thomas>       Fix PROGRAM_INVOCATION handling with external toolchains
 Thomas>       coreutils: bump version
 Thomas>       coreutils: add TODO note about stripping the installed binaries

Thanks, pulled and pushed.

Signature · 1 line
Bye, Peter Korsgaard