From a0249703fd628fc0a74f6a7505b2be8acd9084ca Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Tue, 19 Feb 2019 17:38:21 -0800 Subject: Duh! do not override ${cflags} ... in the backend function with ${CFLAGS_FOR_HOST}. The caller either supplies them already, or (in case of pass-1/2 of the canadian cross) passes ${CFLAGS_FOR_BUILD} there. Signed-off-by: Alexey Neyman diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 9ba5982..ce7fea4 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -542,9 +542,10 @@ do_gcc_core_backend() { CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'" - # We may need to modify host/build CFLAGS separately below + # We may need to modify host/build/target CFLAGS separately below. Note + # that ${cflags} may refer either to build or host CFLAGS; they are provided + # by the caller. cflags_for_build="${CT_CFLAGS_FOR_BUILD}" - cflags="${CT_CFLAGS_FOR_HOST}" cflags_for_target="${CT_TARGET_CFLAGS}" # Clang's default bracket-depth is 256, and building GCC -- cgit v0.10.2-6-g49f6 From 865171abc7bc468a577987725303ac9b8c580e52 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Tue, 19 Feb 2019 23:39:14 -0800 Subject: Stash the uClibc config after our mods ... before running `make olddefconfig`. This helps in debugging. Signed-off-by: Alexey Neyman diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh index 5ea5c58..d80de57 100644 --- a/scripts/build/libc/uClibc.sh +++ b/scripts/build/libc/uClibc.sh @@ -404,6 +404,10 @@ manage_uClibc_config() # Now allow architecture to tweak as it wants CT_DoArchUClibcConfig "${dst}" CT_DoArchUClibcCflags "${dst}" "${flags}" + + # Preserve the config we created (before uclibc's `make olddefconfig` + # overrides anything). + CT_DoExecLog ALL cp "${dst}" "${dst}.created-by-ct-ng" } uClibc_post_cc() -- cgit v0.10.2-6-g49f6 From 16efa9d3e7d2fcbfd0971062d7b17bd5709d41fd Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Tue, 19 Feb 2019 23:45:44 -0800 Subject: Add debug output to Kconfig manipulation functions Signed-off-by: Alexey Neyman diff --git a/scripts/functions b/scripts/functions index e577b9d..fecdad2 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1419,6 +1419,7 @@ CT_KconfigSetOption() { local value="$2" local file="$3" + CT_DoLog DEBUG "${file}: set ${option}=${value}" ${grep} -E -q "^${option}=.*" "${file}" && \ ${sed} -i -r -e "s;^${option}=.*$;${option}=${value};" "${file}" || \ ${grep} -E -q "^# ${option} is not set$" "${file}" && \ @@ -1441,6 +1442,7 @@ CT_KconfigDisableOption() { local option="${1}" local file="${2}" + CT_DoLog DEBUG "${file}: disable ${option}" ${grep} -E -q "^# ${option} is not set$" "${file}" || \ ${grep} -E -q "^${option}=.*$" "${file}" && \ ${sed} -i -r -e "s;^${option}=.*$;# ${option} is not set;" "${file}" || \ @@ -1454,6 +1456,7 @@ CT_KconfigDeleteOption() { local option="${1}" local file="${2}" + CT_DoLog DEBUG "${file}: delete ${option}" ${grep} -E -q "^# ${option} is not set$" "${file}" && \ ${sed} -i -r -e "/^# ${option} is not set$/d" "${file}" || \ ${grep} -E -q "^${option}=.*$" "${file}" && \ -- cgit v0.10.2-6-g49f6 From 8088c6ef4733d0b9fff9cd538c7f2c745434f149 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 20 Feb 2019 00:43:39 -0800 Subject: Select flat/FDPIC in accordance with ct-ng setting uClibc-ng 1.0.31 enabled FDPIC as an option for ARM/no-MMU configurations and defaults to that option if not set explicitly. Signed-off-by: Alexey Neyman diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh index d80de57..fbee4aa 100644 --- a/scripts/build/libc/uClibc.sh +++ b/scripts/build/libc/uClibc.sh @@ -237,6 +237,15 @@ manage_uClibc_config() CT_KconfigEnableOption "ARCH_USE_MMU" "${dst}" else CT_KconfigDisableOption "ARCH_USE_MMU" "${dst}" + CT_KconfigDisableOption "UCLIBC_FORMAT_FDPIC" "${dst}" + CT_KconfigDisableOption "UCLIBC_FORMAT_FLAT" "${dst}" + CT_KconfigDisableOption "UCLIBC_FORMAT_SHARED_FLAT" "${dst}" + case "${CT_ARCH_BINFMT_FLAT},${CT_ARCH_BINFMT_FDPIC},${CT_SHARED_LIBS}" in + y,,y) CT_KconfigEnableOption "UCLIBC_FORMAT_SHARED_FLAT" "${dst}";; + y,,) CT_KconfigEnableOption "UCLIBC_FORMAT_FLAT" "${dst}";; + ,y,*) CT_KconfigEnableOption "UCLIBC_FORMAT_FDPIC" "${dst}";; + *) CT_Abort "Unsupported binary format";; + esac fi if [ "${CT_SHARED_LIBS}" = "y" ]; then -- cgit v0.10.2-6-g49f6