From 196f62e18ca16a1d6408d8e80989870e4ea93ef9 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Thu, 6 Jan 2022 13:10:07 -0800 Subject: [PATCH] Upgrade script for uClibc retirement Run samples through upgrade and fix accumulated breakages: *-centos6-*: After 2.12.2 retirement, the samples selected most recent glibc (2.34) which also forced kernels 3.2+. Revert to 2.12.1 and 2.6.32.71, respectively. Interestingly, 2.12.1 was marked as being used in CentOS6, but the samples selected 2.12.2. Anyway, CentOS6 is EOL now and glibc 2.12 is going to be marked obsolete, and retired soon. arc-*: Make TARGET_VENDOR match the sample's name; otherwise `ct-ng saveconfig` places the config file into a different location. Fix 'savedefconfig' which was not saving the configuration file version (CT_VCHECK was set to 'load' after CT_LoadConfig call). Signed-off-by: Alexey Neyman --- ct-ng.in | 2 +- samples/arc-arc700-linux-uclibc/crosstool.config | 6 +++--- samples/arc-archs-linux-gnu/crosstool.config | 4 ++-- samples/arc-multilib-elf32/crosstool.config | 2 +- samples/arc-multilib-linux-gnu/crosstool.config | 2 +- samples/arc-multilib-linux-uclibc/crosstool.config | 4 ++-- samples/i686-centos6-linux-gnu/crosstool.config | 2 -- samples/samples.mk | 2 +- samples/x86_64-centos6-linux-gnu/crosstool.config | 6 ++++-- scripts/saveSample.sh | 4 ++++ scripts/upgrade/v3 | 12 ++++++++++++ 11 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 scripts/upgrade/v3 diff --git a/ct-ng.in b/ct-ng.in index 0be52ad1..05ca29d3 100644 --- a/ct-ng.in +++ b/ct-ng.in @@ -41,7 +41,7 @@ export CT_VCHECK= # need to pass it to the upgrade script - which may receive an input that # was not preprocessed by kconfig, and hence have no string for "up-to-date" # version. -export CT_CONFIG_VERSION_CURRENT=3 +export CT_CONFIG_VERSION_CURRENT=4 # Download agents used by scripts.mk CT_WGET := @wget@ diff --git a/samples/arc-arc700-linux-uclibc/crosstool.config b/samples/arc-arc700-linux-uclibc/crosstool.config index caa0cf19..93305e53 100644 --- a/samples/arc-arc700-linux-uclibc/crosstool.config +++ b/samples/arc-arc700-linux-uclibc/crosstool.config @@ -1,8 +1,8 @@ -CT_CONFIG_VERSION="3" +CT_CONFIG_VERSION="4" CT_ARCH_ARC=y CT_ARCH_CPU="arc700" CT_TARGET_CFLAGS="-mno-atomic" -CT_TARGET_VENDOR="snps" +CT_TARGET_VENDOR="arc700" CT_TARGET_ALIAS="arc-linux" CT_KERNEL_LINUX=y -CT_LIBC_UCLIBC=y +CT_LIBC_UCLIBC_NG=y diff --git a/samples/arc-archs-linux-gnu/crosstool.config b/samples/arc-archs-linux-gnu/crosstool.config index ad39f70a..dfeb1ed9 100644 --- a/samples/arc-archs-linux-gnu/crosstool.config +++ b/samples/arc-archs-linux-gnu/crosstool.config @@ -1,6 +1,6 @@ -CT_CONFIG_VERSION="3" +CT_CONFIG_VERSION="4" CT_ARCH_ARC=y CT_ARCH_CPU="archs" -CT_TARGET_VENDOR="snps" +CT_TARGET_VENDOR="archs" CT_TARGET_ALIAS="arc-linux" CT_KERNEL_LINUX=y diff --git a/samples/arc-multilib-elf32/crosstool.config b/samples/arc-multilib-elf32/crosstool.config index 0cc3cdd3..e2bce980 100644 --- a/samples/arc-multilib-elf32/crosstool.config +++ b/samples/arc-multilib-elf32/crosstool.config @@ -1,4 +1,4 @@ -CT_CONFIG_VERSION="3" +CT_CONFIG_VERSION="4" CT_ARCH_ARC=y CT_MULTILIB=y CT_TARGET_VENDOR="multilib" diff --git a/samples/arc-multilib-linux-gnu/crosstool.config b/samples/arc-multilib-linux-gnu/crosstool.config index 3dc78027..b32c92ef 100644 --- a/samples/arc-multilib-linux-gnu/crosstool.config +++ b/samples/arc-multilib-linux-gnu/crosstool.config @@ -1,4 +1,4 @@ -CT_CONFIG_VERSION="3" +CT_CONFIG_VERSION="4" CT_ARCH_ARC=y CT_MULTILIB=y CT_TARGET_CFLAGS="-matomic" diff --git a/samples/arc-multilib-linux-uclibc/crosstool.config b/samples/arc-multilib-linux-uclibc/crosstool.config index b1862a5b..16b75696 100644 --- a/samples/arc-multilib-linux-uclibc/crosstool.config +++ b/samples/arc-multilib-linux-uclibc/crosstool.config @@ -1,8 +1,8 @@ -CT_CONFIG_VERSION="3" +CT_CONFIG_VERSION="4" CT_ARCH_ARC=y CT_MULTILIB=y CT_TARGET_CFLAGS="-matomic" CT_TARGET_VENDOR="multilib" CT_TARGET_ALIAS="arc-linux" CT_KERNEL_LINUX=y -CT_LIBC_UCLIBC=y +CT_LIBC_UCLIBC_NG=y diff --git a/samples/i686-centos6-linux-gnu/crosstool.config b/samples/i686-centos6-linux-gnu/crosstool.config index cb7f7132..ffdb9059 100644 --- a/samples/i686-centos6-linux-gnu/crosstool.config +++ b/samples/i686-centos6-linux-gnu/crosstool.config @@ -4,7 +4,5 @@ CT_ARCH_X86=y CT_ARCH_ARCH="i686" CT_TARGET_VENDOR="centos6" CT_KERNEL_LINUX=y -CT_LINUX_V_2_6_32=y # CT_KERNEL_LINUX_INSTALL_CHECK is not set -CT_GLIBC_V_2_12_2=y CT_CC_LANG_CXX=y diff --git a/samples/samples.mk b/samples/samples.mk index 48bbbb98..51e96199 100644 --- a/samples/samples.mk +++ b/samples/samples.mk @@ -128,7 +128,7 @@ samples: # Save a sample saveconfig: .config samples - $(SILENT)CT_VCHECK=save CONF=$(CONF) $(bash) $(CT_LIB_DIR)/scripts/saveSample.sh + $(SILENT)CONF=$(CONF) $(bash) $(CT_LIB_DIR)/scripts/saveSample.sh # The 'sample_dir' function prints the directory in which the sample is, # searching first in local samples, then in global samples diff --git a/samples/x86_64-centos6-linux-gnu/crosstool.config b/samples/x86_64-centos6-linux-gnu/crosstool.config index 24e8a11f..e9747cdc 100644 --- a/samples/x86_64-centos6-linux-gnu/crosstool.config +++ b/samples/x86_64-centos6-linux-gnu/crosstool.config @@ -1,4 +1,4 @@ -CT_CONFIG_VERSION="3" +CT_CONFIG_VERSION="4" CT_OBSOLETE=y CT_ARCH_X86=y CT_ARCH_64=y @@ -6,5 +6,7 @@ CT_TARGET_VENDOR="centos6" CT_KERNEL_LINUX=y CT_LINUX_V_2_6_32=y # CT_KERNEL_LINUX_INSTALL_CHECK is not set -CT_GLIBC_V_2_12_2=y +CT_GLIBC_V_2_12_1=y +CT_GLIBC_EXTRA_CFLAGS="" +# CT_GLIBC_ENABLE_COMMON_FLAG is not set CT_CC_LANG_CXX=y diff --git a/scripts/saveSample.sh b/scripts/saveSample.sh index 2f4a10b1..e367e6e5 100644 --- a/scripts/saveSample.sh +++ b/scripts/saveSample.sh @@ -11,6 +11,10 @@ CT_LoadConfig +# Override CT_VCHECK: we're going to be saving it so need to force saving of +# the config version. +export CT_VCHECK=save + # We can not reliably save a sample which either uses local patches # and/or custom Linux kernel headers. Warn the user about this issue # and continue if he/she confirms sving the sample. diff --git a/scripts/upgrade/v3 b/scripts/upgrade/v3 new file mode 100644 index 00000000..1b8fce83 --- /dev/null +++ b/scripts/upgrade/v3 @@ -0,0 +1,12 @@ +# vim: set filetype=sh : + +# Upgrade v3 -> v4: +# - uClibc retired, leaving only uClibc-ng +upgrade() +{ + case "${opt}" in + CT_LIBC_UCLIBC) + replace CT_LIBC_UCLIBC_NG + ;; + esac +}