Skip to contentSkip to conversation

toolchain: configs: improve toolchain config readability

PATCH Superseded Petri Gynther 2 participants 5 messages Aug 4, 2016 – Aug 5, 2016 Arm/Microchip (AT91) SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 toolchain: configs: improve toolchain config readability

Add (or move) comment lines in toolchain-related Config.in files to improve readability of the toolchain config section.

Source linux-headers/Config.in.host after toolchain-buildroot items.

For toolchain-buildroot case, the config file now looks like this:
*
* Toolchain
*

*
* Toolchain Buildroot Options
*

*
* Kernel Header Options
*

*
* uClibc Options
*

*
* Binutils Options
*

*
* GCC Options
*

*
* Host GDB Options
*

*
* Toolchain Generic Options
*

---
 package/gdb/Config.in.host              | 2 ++
 package/linux-headers/Config.in.host    | 4 ++--
 package/uclibc/Config.in                | 4 ++--
 toolchain/toolchain-buildroot/Config.in | 5 +++--
 toolchain/toolchain-common.in           | 2 ++
 toolchain/toolchain-external/Config.in  | 2 ++
 6 files changed, 13 insertions(+), 6 deletions(-)
package/gdb/Config.in.host +2 -0
index 081073b..a36dc0f 100644
@@ -1,3 +1,5 @@
+comment "Host GDB Options"
+
 config BR2_PACKAGE_HOST_GDB
 	bool "Build cross gdb for the host"
 	# When the external toolchain gdbserver is used, we shouldn't
package/linux-headers/Config.in.host +2 -2
index ae5cc5d..93946ac 100644
@@ -1,8 +1,8 @@
+comment "Kernel Header Options"
+
 config BR2_PACKAGE_HOST_LINUX_HEADERS
 	bool
 
-comment "Kernel Header Options"
-
 choice
 	prompt "Kernel Headers"
 	default BR2_KERNEL_HEADERS_AS_KERNEL if BR2_LINUX_KERNEL
package/uclibc/Config.in +2 -2
index 7c99195..6c16ed4 100644
@@ -1,12 +1,12 @@
 if BR2_TOOLCHAIN_BUILDROOT_UCLIBC
 
+comment "uClibc Options"
+
 config BR2_PACKAGE_UCLIBC
 	bool
 	default y
 	select BR2_PACKAGE_LINUX_HEADERS
 
-comment "uClibc Options"
-
 config BR2_UCLIBC_CONFIG
 	string "uClibc configuration file to use?"
 	default "package/uclibc/uClibc-ng.config"
toolchain/toolchain-buildroot/Config.in +3 -2
index 0b97bbf..e713d74 100644
@@ -2,6 +2,8 @@
 
 if BR2_TOOLCHAIN_BUILDROOT
 
+comment "Toolchain Buildroot Options"
+
 config BR2_TOOLCHAIN_BUILDROOT_VENDOR
 	string "custom toolchain vendor name"
 	default "buildroot"
@@ -18,8 +20,6 @@ config BR2_TOOLCHAIN_BUILDROOT_VENDOR
 
 	  If you're not sure, just leave the default "buildroot" value.
 
-source "package/linux-headers/Config.in.host"
-
 choice
 	prompt "C library"
 	default BR2_TOOLCHAIN_UCLIBC
@@ -90,6 +90,7 @@ config BR2_TOOLCHAIN_BUILDROOT_LIBC
 	default "glibc"  if BR2_TOOLCHAIN_BUILDROOT_GLIBC
 	default "musl"	 if BR2_TOOLCHAIN_BUILDROOT_MUSL
 
+source "package/linux-headers/Config.in.host"
 source "package/linux-headers/Config.in"
 source "package/musl/Config.in"
 source "package/uclibc/Config.in"
toolchain/toolchain-common.in +2 -0
index 03fa880..ccf259a 100644
@@ -5,6 +5,8 @@
 # so put it here instead
 source "package/gdb/Config.in.host"
 
+comment "Toolchain Generic Options"
+
 # https://sourceware.org/bugzilla/show_bug.cgi?id=19405
 config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405
 	bool
toolchain/toolchain-external/Config.in +2 -0
index f54fbee..bb0dde1 100644
@@ -1,5 +1,7 @@
 if BR2_TOOLCHAIN_EXTERNAL
 
+comment "Toolchain External Options"
+
 choice
 	prompt "Toolchain"
 
Signature · 1 line
2.8.0.rc3.226.g39d4020
#1 lore raw

PATCH 2/3 gcc: configs: rename BR2_EXTRA_GCC_CONFIG_OPTIONS

Rename BR2_EXTRA_GCC_CONFIG_OPTIONS to BR2_GCC_EXTRA_CONFIG_OPTIONS to be consistent with BR2_GCC_* and BR2_BINUTILS_EXTRA_CONFIG_OPTIONS.

---
 package/gcc/Config.in.host             | 2 +-
 package/gcc/gcc-final/gcc-final.mk     | 2 +-
 package/gcc/gcc-initial/gcc-initial.mk | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
package/gcc/Config.in.host +1 -1
index 2b54959..a2946bc 100644
@@ -109,7 +109,7 @@ config BR2_GCC_VERSION
 	default "6.1.0" if BR2_GCC_VERSION_6_X
 	default "arc-2016.09-eng007" if BR2_GCC_VERSION_4_8_ARC
 
-config BR2_EXTRA_GCC_CONFIG_OPTIONS
+config BR2_GCC_EXTRA_CONFIG_OPTIONS
 	string "Additional gcc options"
 	default ""
 	help
package/gcc/gcc-final/gcc-final.mk +1 -1
index 284d34c..0c0ab35 100644
@@ -90,7 +90,7 @@ endif
 # End with user-provided options, so that they can override previously
 # defined options.
 HOST_GCC_FINAL_CONF_OPTS += \
-	$(call qstrip,$(BR2_EXTRA_GCC_CONFIG_OPTIONS))
+	$(call qstrip,$(BR2_GCC_EXTRA_CONFIG_OPTIONS))
 
 HOST_GCC_FINAL_CONF_ENV = \
 	$(HOST_GCC_COMMON_CONF_ENV)
package/gcc/gcc-initial/gcc-initial.mk +1 -1
index 1e58d8b..0fba9fb 100644
@@ -47,7 +47,7 @@ HOST_GCC_INITIAL_CONF_OPTS = \
 	--with-newlib \
 	--disable-largefile \
 	--disable-nls \
-	$(call qstrip,$(BR2_EXTRA_GCC_CONFIG_OPTIONS))
+	$(call qstrip,$(BR2_GCC_EXTRA_CONFIG_OPTIONS))
 
 HOST_GCC_INITIAL_CONF_ENV = \
 	$(HOST_GCC_COMMON_CONF_ENV)
Signature · 1 line
2.8.0.rc3.226.g39d4020
#2 lore raw

PATCH 2/3 gcc: configs: rename BR2_EXTRA_GCC_CONFIG_OPTIONS

Hello,

Quoted 4 lines · Petri Gynther

Rename BR2_EXTRA_GCC_CONFIG_OPTIONS to BR2_GCC_EXTRA_CONFIG_OPTIONS to be consistent with BR2_GCC_* and BR2_BINUTILS_EXTRA_CONFIG_OPTIONS.

Thanks for your contributions!

However, for patch 2/3 and 3/3, which merely rename existing config options "for the sake of consistency", it means that they break all existing configurations.

Even though I do like consistency, we generally try to avoid such renames "just for the beauty of it" in order to not break the existing configurations that our users have.

Or at the very least, handling in Config.in.legacy should be added for the previous option name, so that users are notified that there is an issue when they upgrade Buildroot.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/3 gcc: configs: rename BR2_EXTRA_GCC_CONFIG_OPTIONS

Hi Thomas,

Quoted 15 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · Petri Gynther

Rename BR2_EXTRA_GCC_CONFIG_OPTIONS to BR2_GCC_EXTRA_CONFIG_OPTIONS to be consistent with BR2_GCC_* and BR2_BINUTILS_EXTRA_CONFIG_OPTIONS.

Thanks for your contributions!

However, for patch 2/3 and 3/3, which merely rename existing config options "for the sake of consistency", it means that they break all existing configurations.

Quoted 7 lines

Even though I do like consistency, we generally try to avoid such renames "just for the beauty of it" in order to not break the existing configurations that our users have.

Or at the very least, handling in Config.in.legacy should be added for the previous option name, so that users are notified that there is an issue when they upgrade Buildroot.

I added the old options to Config.in.legacy. Sending out patch v2 for 2/3 and 3/3 shortly.

Quoted 6 lines

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

#4 lore raw

PATCH 3/3 uclibc: configs: rename BR2_PTHREAD_DEBUG

In reply to Petri Gynther

Rename BR2_PTHREAD_DEBUG to BR2_PTHREADS_DEBUG to be consistent with BR2_PTHREADS_* config item naming.

---
 configs/atmel_sama5d2_xplained_mmc_dev_defconfig | 2 +-
 configs/atmel_sama5d3_xplained_dev_defconfig     | 2 +-
 configs/atmel_sama5d3_xplained_mmc_dev_defconfig | 2 +-
 configs/atmel_sama5d4_xplained_dev_defconfig     | 2 +-
 configs/atmel_sama5d4_xplained_mmc_dev_defconfig | 2 +-
 package/uclibc/Config.in                         | 2 +-
 package/uclibc/uclibc.mk                         | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
configs/atmel_sama5d2_xplained_mmc_dev_defconfig +1 -1
index d7f4717..aa52bd0 100644
@@ -10,7 +10,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y
 # Needed for some packages
 BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
 # Needed for gdb
-BR2_PTHREAD_DEBUG=y
+BR2_PTHREADS_DEBUG=y
 # Needed for some packages
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 
configs/atmel_sama5d3_xplained_dev_defconfig +1 -1
index d51a141..220c941 100644
@@ -9,7 +9,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y
 # Needed for some packages
 BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
 # Needed for gdb
-BR2_PTHREAD_DEBUG=y
+BR2_PTHREADS_DEBUG=y
 # Needed for some packages
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 
configs/atmel_sama5d3_xplained_mmc_dev_defconfig +1 -1
index c45c2ce..e360cfb 100644
@@ -9,7 +9,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y
 # Needed for some packages
 BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
 # Needed for gdb
-BR2_PTHREAD_DEBUG=y
+BR2_PTHREADS_DEBUG=y
 # Needed for some packages
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 
configs/atmel_sama5d4_xplained_dev_defconfig +1 -1
index 7dadeca..cad4eb1 100644
@@ -10,7 +10,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y
 # Needed for some packages
 BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
 # Needed for gdb
-BR2_PTHREAD_DEBUG=y
+BR2_PTHREADS_DEBUG=y
 # Needed for some packages
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 
configs/atmel_sama5d4_xplained_mmc_dev_defconfig +1 -1
index 9e11efa..1738a9a 100644
@@ -10,7 +10,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y
 # Needed for some packages
 BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
 # Needed for gdb
-BR2_PTHREAD_DEBUG=y
+BR2_PTHREADS_DEBUG=y
 # Needed for some packages
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 
package/uclibc/Config.in +1 -1
index 6c16ed4..e459f44 100644
@@ -69,7 +69,7 @@ choice
 		depends on !BR2_m68k && !BR2_microblaze
 endchoice
 
-config BR2_PTHREAD_DEBUG
+config BR2_PTHREADS_DEBUG
 	bool "Thread library debugging"
 	depends on BR2_PTHREADS || BR2_PTHREADS_NATIVE
 	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
package/uclibc/uclibc.mk +1 -1
index 124bd59..6fd0768 100644
@@ -353,7 +353,7 @@ endif
 # Thread debug
 #
 
-ifeq ($(BR2_PTHREAD_DEBUG),y)
+ifeq ($(BR2_PTHREADS_DEBUG),y)
 UCLIBC_THREAD_DEBUG_CONFIG = $(call KCONFIG_ENABLE_OPT,PTHREADS_DEBUG_SUPPORT,$(@D)/.config)
 else
 UCLIBC_THREAD_DEBUG_CONFIG = $(call KCONFIG_DISABLE_OPT,PTHREADS_DEBUG_SUPPORT,$(@D)/.config)
Signature · 1 line
2.8.0.rc3.226.g39d4020