Rework secondary toolchain for K3R5
cover Rework secondary toolchain for K3R5
From: Denys Dmytriyenko <[email protected]>
The old approach using external toolchain no longer works since meta-arago migrated away and now uses internal toolchain. This patch series adds the secondary k3r5 toolchain into the TISDK bundle using multiconfig, while cleaning up and removing the legacy external toolchain support.
The TISDK bundle for K3 devices now also provides k3r5-devkit.sh toolchain installer along with the main linux-devkit.sh one. Some basic testing has been done installing them separate from each other. Whether they can be installed in the same directory hasn't been tested yet. May need to follow with additional meta-toolchain clean ups later.
PS. The only difference between master and kirkstone sets is due to upstream GCC version specified in toolchain-gcc.inc (13 vs 11)
Denys Dmytriyenko (6):
recipe-data: deprecate
tisdk-core-bundle: simplify toolchain/SDK selection
meta-arago-distro: remove old secondary toolchain support
meta-arago: remove external toolchain support
meta-arago: remove extra plumbing for internal toolchain
tisdk-bundle: package up secondary K3R5 toolchain
meta-arago-distro/classes/recipe-data.bbclass | 100 ------------- .../classes/tisdk-bundle.bbclass | 80 +++++------ meta-arago-distro/conf/distro/arago.conf | 13 -- .../conf/distro/include/toolchain-arm.inc | 118 ---------------- .../distro/include/toolchain-external.inc | 4 - .../conf/distro/include/toolchain-gcc.inc | 41 ------ .../distro/include/toolchain-internal.inc | 4 - .../recipes-core/images/tisdk-core-bundle.inc | 4 +- .../external-arm-secondary-sdk-toolchain.bb | 4 - .../meta/external-arm-toolchain.bbappend | 36 ----- .../packagegroup-cross-canadian.bbappend | 10 -- .../meta/external-arm-bfd-version.inc | 8 -- .../meta/external-arm-sdk-toolchain.bb | 131 ------------------ .../meta/external-arm-toolchain.bbappend | 73 ---------- .../recipes-core/meta/files/SUPPORTED | 1 - .../recipes-core/meta/meta-toolchain-arago.bb | 54 ++------ 16 files changed, 47 insertions(+), 634 deletions(-) delete mode 100644 meta-arago-distro/classes/recipe-data.bbclass delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-arm.inc delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-external.inc delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-gcc.inc delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-internal.inc delete mode 100644 meta-arago-distro/recipes-core/meta/external-arm-secondary-sdk-toolchain.bb delete mode 100644 meta-arago-distro/recipes-core/meta/external-arm-toolchain.bbappend delete mode 100644 meta-arago-distro/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend delete mode 100644 meta-arago-extras/recipes-core/meta/external-arm-bfd-version.inc delete mode 100644 meta-arago-extras/recipes-core/meta/external-arm-sdk-toolchain.bb delete mode 100644 meta-arago-extras/recipes-core/meta/external-arm-toolchain.bbappend delete mode 100644 meta-arago-extras/recipes-core/meta/files/SUPPORTED
Signature · 1 line
2.25.1
PATCH 1/6 recipe-data: deprecate
From: Denys Dmytriyenko <[email protected]>
Deprecate custom recipe-data class. It was added when Bitbake started sanitizing "source" field of generated binary packages due to a CVE security vulnerability that could potentially leak local resource passwords. This class would bypass the sanitizing step by preserving source URLs from recipes to be used in TISDK bundle manifest.
Even with a valid use case, this approach was still questionable and now it complicates latest TISDK bundle changes necessary for adding a proper secondary toolchain support. Plus bundle manifests don't seem to be used that much lately, so deprecate this class.
--- meta-arago-distro/classes/recipe-data.bbclass | 100 ------------------ .../classes/tisdk-bundle.bbclass | 43 +------- meta-arago-distro/conf/distro/arago.conf | 3 - 3 files changed, 1 insertion(+), 145 deletions(-) delete mode 100644 meta-arago-distro/classes/recipe-data.bbclass
meta-arago-distro/classes/recipe-data.bbclass deleted +0 -100
@@ -1,100 +0,0 @@ -# This class will record certain information about dependent recipes to a conf -# file. This way it can be retrieved by other recipes. For example, this can be -# used to obtain the SRC_URI for the SDK's SW manifest. - -# Configuration file to record the recipe data. -RECIPE_DATA_FILE ?= "${TMPDIR}/recipe_data.conf" - -# Variables to record -RECIPE_DATA_VARS ?= "PV SRC_URI FILE" - - -# Helper to load the data from the conf file -def recipe_data_load(d, recipe_data = bb.data.init()): - fn = d.getVar('RECIPE_DATA_FILE', True) - - if not fn: - bb.fatal('"RECIPE_DATA_FILE" is not defined!') - - if os.path.exists(fn): - with bb.utils.fileslocked([fn + '.lock']): - try: - bb.parse.handle(fn, recipe_data) - except Exception as e: - bb.warn('ERROR parsing "%s"' % fn) - bb.fatal(str(e)) - - return recipe_data - - -def recipe_data_get_var(var, pn, d): - if var not in (d.getVar('RECIPE_DATA_VARS', True) or '').split(): - bb.fatal('Variable "%s" was not configured to be recored' % var) - - recipe_data = recipe_data_load(d) - return recipe_data.getVar('%s_pn-%s' % (var,pn), True) - -# Add a shell variety so that it can work in shell tasks -# *** In shell tasks, inline python will be executed during parsing, so shell -# *** variables passed as input. -recipe_data_get_var_sh() { - local pn="$1" - local var="$2" - - sed -ne 's|'$var'_pn-'$pn'[ \t]*=[ \t]*"\(.*\)"[ \t]*$|\1|p' ${RECIPE_DATA_FILE} -} - -# Update the conf file with a new data. -# Variables such as "FILE" and "TOPDIR" are filtered out by default. -def recipe_data_update(fn, update_data, var_blacklist = ['__.*', 'FILE', 'TOPDIR'], expand = False): - import re - - recipe_data = bb.data.init() - - # Create the regex to filter out variables - re_blacklist = re.compile('^' + '$|^'.join(var_blacklist) + '$') - with bb.utils.fileslocked([fn + '.lock']): - try: - bb.parse.handle(fn, recipe_data) - except: - pass - - for var in update_data.keys(): - recipe_data.setVar(var, update_data.getVar(var,expand)) - - # We could use bb.data_smart's built in "emit_var", but that gives - # unnecessary comments. - with open(fn, "w") as f: - for var in recipe_data.keys(): - if not re_blacklist.match(var): - f.write('%s = "%s"\n' % (var, recipe_data.getVar(var,expand))) - - -addtask emit_recipe_data -do_emit_recipe_data[nostamp] = "1" -python do_emit_recipe_data(){ - recipe_vars = (d.getVar('RECIPE_DATA_VARS', True) or '').split() - recipe_data_file = d.getVar('RECIPE_DATA_FILE', True) - - pn = d.getVar('PN', True) or bb.fatal('"PN" is not defined!') - - data = bb.data.init() - - # Set pn-${PN} to the overrides for convenience - data.setVar('OVERRIDES', 'pn-${PN}') - for var in recipe_vars: - val = d.getVar(var, True) or '' - data.setVar('%s_pn-%s' % (var, pn), val) - - recipe_data_update(recipe_data_file, data) -} - -# Add empty task to control dependencies -addtask emit_recipe_data_all after do_emit_recipe_data -do_emit_recipe_data_all[noexec] = "1" -do_emit_recipe_data_all[nostamp] = "1" -do_emit_recipe_data_all[recrdeptask] = "do_emit_recipe_data_all do_emit_recipe_data" -do_emit_recipe_data_all[recideptask] = "do_${BB_DEFAULT_TASK}" -do_emit_recipe_data_all() { - : -}
meta-arago-distro/classes/tisdk-bundle.bbclass +1 -42
61 lines not on this page · raw message
meta-arago-distro/conf/distro/arago.conf +0 -3
@@ -166,9 +166,6 @@ require conf/distro/include/toolchain-${TOOLCHAIN_TYPE}.inc #TARGET_CPPFLAGS += "-fstack-protector -D_FORTIFY_SOURCE=1" #TARGET_CPPFLAGS += "-fstack-protector" -# Inherit "recipe-data" class to populate SRC_URI in manifest -INHERIT += "recipe-data" - # Load default preferences require conf/distro/include/arago-prefs.inc
Signature · 1 line
2.25.1
Re: [EXTERNAL] [meta-arago] [kirkstone][PATCH 1/6] recipe-data: deprecate
Quoted 8 lines · Denys Dmytriyenko
From: Denys Dmytriyenko <[email protected]>
Deprecate custom recipe-data class. It was added when Bitbake started sanitizing "source" field of generated binary packages due to a CVE security vulnerability that could potentially leak local resource passwords. This class would bypass the sanitizing step by preserving source URLs from recipes to be used in TISDK bundle manifest.
Quoted 4 lines
Even with a valid use case, this approach was still questionable and now it complicates latest TISDK bundle changes necessary for adding a proper secondary toolchain support. Plus bundle manifests don't seem to be used that much lately, so deprecate this class.
Hi Denys, Ryan,
I was a little concerned with the last statement here. At SDK level we do use the manifest .txt files that to upload on the release page.
I am not sure yet about how this patch affects the manifest txt file. Does this change the structure at all or just the Source field for each recipe?
If the change really is significant, I will be creating a build with this patch and get back to you if i have concerns.
Quoted 187 lines
Signed-off-by Denys Dmytriyenko <[email protected]>--- meta-arago-distro/classes/recipe-data.bbclass | 100 ------------------ .../classes/tisdk-bundle.bbclass | 43 +------- meta-arago-distro/conf/distro/arago.conf | 3 - 3 files changed, 1 insertion(+), 145 deletions(-)delete mode 100644 meta-arago-distro/classes/recipe-data.bbclass
meta-arago-distro/classes/recipe-data.bbclass deleted +0
-100@@ -1,100 +0,0 @@ -# This class will record certain information about dependent recipes to a conf -# file. This way it can be retrieved by other recipes. For example, this can be -# used to obtain the SRC_URI for the SDK's SW manifest. - -# Configuration file to record the recipe data. -RECIPE_DATA_FILE ?= "${TMPDIR}/recipe_data.conf" - -# Variables to record -RECIPE_DATA_VARS ?= "PV SRC_URI FILE" - - -# Helper to load the data from the conf file -def recipe_data_load(d, recipe_data = bb.data.init()): - fn = d.getVar('RECIPE_DATA_FILE', True) - - if not fn: - bb.fatal('"RECIPE_DATA_FILE" is not defined!') - - if os.path.exists(fn): - with bb.utils.fileslocked([fn + '.lock']): - try: - bb.parse.handle(fn, recipe_data) - except Exception as e: - bb.warn('ERROR parsing "%s"' % fn) - bb.fatal(str(e)) - - return recipe_data - - -def recipe_data_get_var(var, pn, d): - if var not in (d.getVar('RECIPE_DATA_VARS', True) or '').split(): - bb.fatal('Variable "%s" was not configured to be recored' % var) - - recipe_data = recipe_data_load(d) - return recipe_data.getVar('%s_pn-%s' % (var,pn), True) - -# Add a shell variety so that it can work in shell tasks -# *** In shell tasks, inline python will be executed during parsing, so shell -# *** variables passed as input. -recipe_data_get_var_sh() { - local pn="$1" - local var="$2" - - sed -ne 's|'$var'_pn-'$pn'[ \t]*=[ \t]*"\(.*\)"[ \t]*$|\1|p' ${RECIPE_DATA_FILE} -} - -# Update the conf file with a new data. -# Variables such as "FILE" and "TOPDIR" are filtered out by default. -def recipe_data_update(fn, update_data, var_blacklist = ['__.*', 'FILE', 'TOPDIR'], expand = False): - import re - - recipe_data = bb.data.init() - - # Create the regex to filter out variables - re_blacklist = re.compile('^' + '$|^'.join(var_blacklist) + '$') - with bb.utils.fileslocked([fn + '.lock']): - try: - bb.parse.handle(fn, recipe_data) - except: - pass - - for var in update_data.keys(): - recipe_data.setVar(var, update_data.getVar(var,expand)) - - # We could use bb.data_smart's built in "emit_var", but that gives - # unnecessary comments. - with open(fn, "w") as f: - for var in recipe_data.keys(): - if not re_blacklist.match(var): - f.write('%s = "%s"\n' % (var, recipe_data.getVar(var,expand))) - - -addtask emit_recipe_data -do_emit_recipe_data[nostamp] = "1" -python do_emit_recipe_data(){ - recipe_vars = (d.getVar('RECIPE_DATA_VARS', True) or '').split() - recipe_data_file = d.getVar('RECIPE_DATA_FILE', True) - - pn = d.getVar('PN', True) or bb.fatal('"PN" is not defined!') - - data = bb.data.init() - - # Set pn-${PN} to the overrides for convenience - data.setVar('OVERRIDES', 'pn-${PN}') - for var in recipe_vars: - val = d.getVar(var, True) or '' - data.setVar('%s_pn-%s' % (var, pn), val) - - recipe_data_update(recipe_data_file, data) -} - -# Add empty task to control dependencies -addtask emit_recipe_data_all after do_emit_recipe_data -do_emit_recipe_data_all[noexec] = "1" -do_emit_recipe_data_all[nostamp] = "1" -do_emit_recipe_data_all[recrdeptask] = "do_emit_recipe_data_all do_emit_recipe_data" -do_emit_recipe_data_all[recideptask] = "do_${BB_DEFAULT_TASK}" -do_emit_recipe_data_all() { - : -}meta-arago-distro/classes/tisdk-bundle.bbclass +1
-42@@ -444,43 +444,6 @@ sw_manifest_host() { sw_manifest_table_footer } -# Use the recipe-data class to collect SRC_URI for the manifest. -# -# While this will need to be globally INHERIT'd to work properly, inherit -# locally so that parsing does not fail. -inherit recipe-data - -# Instead of re-adding the do_rootfs task, re-add the do_emit_recipe_data_all -# task to run before do_rootfs. -deltask do_emit_recipe_data_all - -# There seems to be something special with the rootfs task and task dependencies -# are not working as expected, so use the install task instead. -addtask emit_recipe_data_all after do_emit_recipe_data before do_install - -get_sources_from_recipe(){ - [ ! -z "$1" ] || return 0 - - # Check if a full URL is given (e.g. ipks from sourceipk class) - if [ $(echo "$1" | grep -c '://') -gt 0 ] - then - echo "$1" - return 0 - fi - - # Now assume that this was created by the package_ipk class - - # Cannot assume that recipe filename is ${PN}_${PV}.bb - # This is easily seen with BBCLASSEXTEND recipes. - for pn in $(sed -ne 's|FILE_pn-\([^ \t=]*\)[ \t]*=[ \t]*".*/'$1'".*|\1|p' "${RECIPE_DATA_FILE}") - do - # Only need a single PN incase there are native, nativesdk, target variants. - break - done - - recipe_data_get_var_sh "$pn" "SRC_URI" -} - # This function expects to be passed the following parameter # - The location to the opkg info directory containing the control files # of the installed packages@@ -491,9 +454,6 @@ generate_sw_manifest_table() { control_dir="$1" gplv3_only="$2" - # Call this here so that the function gets added to the task script - get_sources_from_recipe - if [ ! -d "$control_dir" ] then echo "Could not find the control directory ($control_dir)"@@ -583,8 +543,7 @@ EOF long_version="`cat $i | grep Version: | awk {'print $2'}`" license="`cat $i | grep License: | cut -d: -f2 `" architecture="`cat $i | grep Architecture: | awk {'print $2'}`" - recipe="`cat $i | grep Source: | cut -d ':' -f2-`" - sources="`get_sources_from_recipe $recipe`" + sources="`cat $i | grep Source: | cut -d ':' -f2-`" location="$package""_""$long_version""_""$architecture"".ipk" # Set the highlight color if the license in GPLv3. If this ismeta-arago-distro/conf/distro/arago.conf +0
-0
meta-arago-distro/conf/distro/arago.conf require conf/distro/include/toolchain-${TOOLCHAIN_TYPE}.inc · line 171
Quoted 9 lines
meta-arago-distro/conf/distro/arago.conf +0
-3@@ -166,9 +166,6 @@ require conf/distro/include/toolchain-${TOOLCHAIN_TYPE}.inc #TARGET_CPPFLAGS += "-fstack-protector -D_FORTIFY_SOURCE=1" #TARGET_CPPFLAGS += "-fstack-protector" -# Inherit "recipe-data" class to populate SRC_URI in manifest -INHERIT += "recipe-data" - # Load default preferences require conf/distro/include/arago-prefs.inc
Thanks,
Aniket
Re: [EXTERNAL] [meta-arago] [kirkstone][PATCH 1/6] recipe-data: deprecate
Quoted 17 lines · Aniket Limaye
Quoted 8 lines · Denys Dmytriyenko
From: Denys Dmytriyenko <[email protected]>
Deprecate custom recipe-data class. It was added when Bitbake started sanitizing "source" field of generated binary packages due to a CVE security vulnerability that could potentially leak local resource passwords. This class would bypass the sanitizing step by preserving source URLs from recipes to be used in TISDK bundle manifest.
Quoted 4 lines
Even with a valid use case, this approach was still questionable and now it complicates latest TISDK bundle changes necessary for adding a proper secondary toolchain support. Plus bundle manifests don't seem to be used that much lately, so deprecate this class.
Hi Denys, Ryan,
Quoted 7 lines
I was a little concerned with the last statement here. At SDK level we do use the manifest .txt files that to upload on the release page.
I am not sure yet about how this patch affects the manifest txt file. Does this change the structure at all or just the Source field for each recipe?
Yes, this change only affects the source field of each recipe/package listed in the manifest.
Quoted 2 lines
If the change really is significant, I will be creating a build with this patch and get back to you if i have concerns.
Please let us know if this is a showstopper.
Signature · 1 line
Denys
PATCH 2/6 tisdk-core-bundle: simplify toolchain/SDK selection
In reply to Denys DmytriyenkoFrom: Denys Dmytriyenko <[email protected]>
We used to generate a different toolchain/SDK based on whether the target was graphics-enabled or headless. Now we build the same full toolchain/SDK regardles, so there's no need to check for "opengl" distro feature inside TISDK bundle, as it's enabled in our distro unconditionally anyway.
--- meta-arago-distro/recipes-core/images/tisdk-core-bundle.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta-arago-distro/recipes-core/images/tisdk-core-bundle.inc +2 -2
@@ -31,8 +31,8 @@ DTB_FILTER:j721s2 = "j721s2" # List of target side images to build for the SDK TARGET_IMAGES = "tisdk-base-image tisdk-default-image tisdk-thinlinux-image tisdk-bootstrap-image" -TISDK_TOOLCHAIN = "${@bb.utils.contains('DISTRO_FEATURES','opengl','meta-toolchain-arago-tisdk','meta-toolchain-arago-tisdk-server',d)}" -TOOLCHAIN_SUFFIX = "${@bb.utils.contains('DISTRO_FEATURES','opengl','-tisdk','-tisdk-server',d)}" +TISDK_TOOLCHAIN = "meta-toolchain-arago-tisdk" +TOOLCHAIN_SUFFIX = "-tisdk" IMAGE_INSTALL = "\ packagegroup-arago-tisdk-amsdk-sdk-host \
Signature · 1 line
2.25.1
PATCH 3/6 meta-arago-distro: remove old secondary toolchain support
In reply to Denys DmytriyenkoFrom: Denys Dmytriyenko <[email protected]>
This was a rather hacky way to add a secondary toolchain for K3R5, based on external-arm-toolchain. This doesn't work with the internal toolchain, which is a default now.
--- .../conf/distro/include/toolchain-arm.inc | 6 ------ .../meta/external-arm-secondary-sdk-toolchain.bb | 4 ---- .../packagegroups/packagegroup-cross-canadian.bbappend | 10 ---------- 3 files changed, 20 deletions(-) delete mode 100644 meta-arago-distro/recipes-core/meta/external-arm-secondary-sdk-toolchain.bb delete mode 100644 meta-arago-distro/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend
meta-arago-distro/conf/distro/include/toolchain-arm.inc +0 -6
@@ -9,9 +9,6 @@ EAT_TARGET_SYS:arm = "${EAT_TARGET_SYS_ARMV5}" EAT_TARGET_SYS:armv7a = "${EAT_TARGET_SYS_ARMV7}" EAT_TARGET_SYS:aarch64 = "${EAT_TARGET_SYS_ARMV8}" -SECONDARY_TARGET_ARCH = "invalid" -SECONDARY_TARGET_ARCH:k3 = "armv7a" - TARGET_VENDOR = "" TOOLCHAIN_BASE ?= "/opt"
@@ -34,9 +31,6 @@ PREFERRED_PROVIDER_gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "external-arm PREFERRED_PROVIDER_binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "external-arm-sdk-toolchain-${TRANSLATED_TARGET_ARCH}" #PREFERRED_PROVIDER_gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "external-arm-sdk-toolchain-${TRANSLATED_TARGET_ARCH}" -PREFERRED_PROVIDER_gcc-cross-canadian-${SECONDARY_TARGET_ARCH} ?= "external-arm-secondary-sdk-toolchain-${SECONDARY_TARGET_ARCH}" -PREFERRED_PROVIDER_binutils-cross-canadian-${SECONDARY_TARGET_ARCH} ?= "external-arm-secondary-sdk-toolchain-${SECONDARY_TARGET_ARCH}" - # Special case for gdb to be built as part of canadian-cross-sdk, instead of packaged from external toolchain bindir:pn-gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "${exec_prefix}/bin" PREFERRED_PROVIDER_gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
meta-arago-distro/recipes-core/meta/external-arm-secondary-sdk-toolchain.bb deleted +0 -4
@@ -1,4 +0,0 @@ -TARGET_ARCH := "${SECONDARY_TARGET_ARCH}" -MACHINEOVERRIDES := "${SECONDARY_TARGET_ARCH}" - -require recipes-core/meta/external-arm-sdk-toolchain.bb
meta-arago-distro/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend deleted +0 -10
@@ -1,10 +0,0 @@ -PR:append = ".arago0" - -SECONDARY_TARGET_ARCH ?= "invalid" - -SECONDARY_TOOLCHAIN = "gcc-cross-canadian-${SECONDARY_TARGET_ARCH} \ - binutils-cross-canadian-${SECONDARY_TARGET_ARCH}" - -RDEPENDS:${PN}:append = " \ - ${@oe.utils.conditional('SECONDARY_TARGET_ARCH', 'invalid', '', '${SECONDARY_TOOLCHAIN}', d)} \ -"
Signature · 1 line
2.25.1
PATCH 4/6 meta-arago: remove external toolchain support
In reply to Denys DmytriyenkoFrom: Denys Dmytriyenko <[email protected]>
As meta-arago has moved away from using an external toolchain due to high maintenance burden, among other reasons, let's remove the corresponding support and related customizations.
--- .../conf/distro/include/toolchain-arm.inc | 112 --------------- .../distro/include/toolchain-external.inc | 4 - .../meta/external-arm-toolchain.bbappend | 36 ----- .../meta/external-arm-bfd-version.inc | 8 -- .../meta/external-arm-sdk-toolchain.bb | 131 ------------------ .../meta/external-arm-toolchain.bbappend | 73 ---------- .../recipes-core/meta/files/SUPPORTED | 1 - 7 files changed, 365 deletions(-) delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-arm.inc delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-external.inc delete mode 100644 meta-arago-distro/recipes-core/meta/external-arm-toolchain.bbappend delete mode 100644 meta-arago-extras/recipes-core/meta/external-arm-bfd-version.inc delete mode 100644 meta-arago-extras/recipes-core/meta/external-arm-sdk-toolchain.bb delete mode 100644 meta-arago-extras/recipes-core/meta/external-arm-toolchain.bbappend delete mode 100644 meta-arago-extras/recipes-core/meta/files/SUPPORTED
meta-arago-distro/conf/distro/include/toolchain-arm.inc deleted +0 -112
@@ -1,112 +0,0 @@ -# Select external binary prebuilt Arm toolchain -TCMODE = "external-arm" - -EAT_TARGET_SYS_ARMV5 ?= "arm-none-linux-gnueabi" -EAT_TARGET_SYS_ARMV7 ?= "arm-none-linux-gnueabihf" -EAT_TARGET_SYS_ARMV8 ?= "aarch64-none-linux-gnu" - -EAT_TARGET_SYS:arm = "${EAT_TARGET_SYS_ARMV5}" -EAT_TARGET_SYS:armv7a = "${EAT_TARGET_SYS_ARMV7}" -EAT_TARGET_SYS:aarch64 = "${EAT_TARGET_SYS_ARMV8}" - -TARGET_VENDOR = "" - -TOOLCHAIN_BASE ?= "/opt" -TOOLCHAIN_PATH_ARMV5 ?= "${TOOLCHAIN_BASE}/gcc-arm-9.2-ti2020.01-armv5-x86_64-${EAT_TARGET_SYS_ARMV5}" -TOOLCHAIN_PATH_ARMV7 ?= "${TOOLCHAIN_BASE}/gcc-arm-9.2-2019.12-x86_64-${EAT_TARGET_SYS_ARMV7}" -TOOLCHAIN_PATH_ARMV8 ?= "${TOOLCHAIN_BASE}/gcc-arm-9.2-2019.12-x86_64-${EAT_TARGET_SYS_ARMV8}" - -DEF_TOOLCHAIN_PATH:arm = "${TOOLCHAIN_PATH_ARMV5}" -DEF_TOOLCHAIN_PATH:armv7a = "${TOOLCHAIN_PATH_ARMV7}" -DEF_TOOLCHAIN_PATH:aarch64 = "${TOOLCHAIN_PATH_ARMV8}" - -TOOLCHAIN_PATH ?= "${DEF_TOOLCHAIN_PATH}" - -TOOLCHAIN_SYS := "${EAT_TARGET_SYS}" -TOOLCHAIN_PREFIX := "${TOOLCHAIN_SYS}-" - -PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-intermediate = "external-arm-toolchain" - -PREFERRED_PROVIDER_gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "external-arm-sdk-toolchain-${TRANSLATED_TARGET_ARCH}" -PREFERRED_PROVIDER_binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "external-arm-sdk-toolchain-${TRANSLATED_TARGET_ARCH}" -#PREFERRED_PROVIDER_gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "external-arm-sdk-toolchain-${TRANSLATED_TARGET_ARCH}" - -# Special case for gdb to be built as part of canadian-cross-sdk, instead of packaged from external toolchain -bindir:pn-gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "${exec_prefix}/bin" -PREFERRED_PROVIDER_gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}" - -# Set up runtime preferences -PREFERRED_PROVIDER_libgcc = "external-arm-toolchain" -PREFERRED_PROVIDER_gcc-runtime = "external-arm-toolchain" - -# Set Cross and SDK toolchain preferences -SDKGCCVERSION ?= "arm-9.2%" -SDKGDBVERSION ?= "9.2%" -SDKBINUVERSION ?= "2.35%" -SDKGLIBCVERSION ?= "2.32%" -SDKLINUXLIBCVERSION ?= "5.10%" - -PREFERRED_VERSION_gcc-crosssdk-${SDK_SYS} ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_gcc-crosssdk-initial-${SDK_SYS} ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_gdb-crosssdk-${SDK_SYS} ?= "${SDKGDBVERSION}" -PREFERRED_VERSION_gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "${SDKGDBVERSION}" -PREFERRED_VERSION_binutils-crosssdk-${SDK_SYS} ?= "${SDKBINUVERSION}" - -PREFERRED_VERSION_nativesdk-gcc-runtime ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_nativesdk-libgcc ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_nativesdk-libgcc-initial ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_nativesdk-linux-libc-headers ?= "${SDKLINUXLIBCVERSION}" -PREFERRED_VERSION_nativesdk-glibc ?= "${SDKGLIBCVERSION}" -PREFERRED_VERSION_nativesdk-glibc-locale ?= "${SDKGLIBCVERSION}" -PREFERRED_VERSION_nativesdk-glibc-initial ?= "${SDKGLIBCVERSION}" - -# Set target toolchain preferences to match Cross/SDK by default -# Can be overwritten globally, if needed -GCCVERSION ?= "arm-9.2%" -GDBVERSION ?= "9.2%" -BINUVERSION ?= "2.35%" -GLIBCVERSION ?= "2.32%" - -PREFERRED_VERSION_gcc ?= "${GCCVERSION}" -PREFERRED_VERSION_gdb ?= "${GDBVERSION}" -PREFERRED_VERSION_binutils ?= "${BINUVERSION}" -PREFERRED_VERSION_glibc ?= "${GLIBCVERSION}" -PREFERRED_VERSION_glibc-locale ?= "${GLIBCVERSION}" -PREFERRED_VERSION_glibc-initial ?= "${GLIBCVERSION}" - -# Licenses set for main components of the toolchain: -# (g)libc is always LGPL version 2 (or later) -# gcc has switched from GPL version 2 (or later) to version 3 (or later) after 4.2.1, -# see this announcement - http://gcc.gnu.org/ml/gcc-announce/2007/msg00003.html -# libgcc and libstdc++ always had exceptions to GPL called Runtime Library Exception, but -# it was based on GPL version 2 (or later), until new GPL version 3 (or later) exception -# was introduced on 27 Jan 2009 - http://gcc.gnu.org/ml/gcc-announce/2009/msg00000.html -# and http://www.gnu.org/licenses/gcc-exception.html, which was several days after -# gcc 4.3.3 was released - http://gcc.gnu.org/releases.html -# gdb/gdbserver version 6.6 was the last one under GPL version 2 (or later), according -# to the release schedule - http://www.gnu.org/software/gdb/schedule/ -# binutils version 2.17 was the last one under GPL version 2 (or later), according -# to the published releases - http://ftp.gnu.org/gnu/binutils/ - -python external_arm_toolchain_license_handler () { - if not isinstance(e, bb.event.ConfigParsed): - return - d = e.data - ld = d.createCopy() - ld.finalize() - - lc_libc = "LGPL-2.1" - lc_gcc = ["GPL-3.0", "GPL-2.0"][eat_get_gcc_version(ld) <= "4.2.1"] - lc_rle = ["GPL-3.0-with-GCC-exception", "GPL-2.0-with-GCC-exception"][eat_get_gcc_version(ld) <= "4.3.3"] - lc_gdb = ["GPL-3.0", "GPL-2.0"][eat_get_gdb_version(ld) <= "6.6"] -# lc_bfd = ["GPL-3.0", "GPL-2.0"][eat_get_bfd_version(ld) <= "2.17"] - - d.setVar('EAT_LIC_LIBC', lc_libc) - d.setVar('EAT_LIC_GCC', lc_gcc) - d.setVar('EAT_LIC_RLE', lc_rle) - d.setVar('EAT_LIC_GDB', lc_gdb) -# d.setVar('EAT_LIC_BFD', lc_bfd) - - d.setVar('EAT_LICENSE', "%s&%s&%s&%s" % (lc_libc, lc_gcc, lc_rle, lc_gdb)) -} -addhandler external_arm_toolchain_license_handler
meta-arago-distro/conf/distro/include/toolchain-external.inc deleted +0 -4
@@ -1,4 +0,0 @@ -# Set some default toolchain location variables -TOOLCHAIN_PATH ??= "/usr/local/sdk" -TOOLCHAIN_SYSPATH = "${TOOLCHAIN_PATH}/${TOOLCHAIN_SYS}" -EXTERNAL_TOOLCHAIN = "${TOOLCHAIN_PATH}"
meta-arago-distro/recipes-core/meta/external-arm-toolchain.bbappend deleted +0 -36
@@ -1,36 +0,0 @@ -# This is a rather hacky way to install custom linux-libc-headers -# on top of the external-arm-toolchain, since simply depending -# on linux-libc-headers creates circular dependencies now. Mostly -# duplication of code from corresponding recipe. - -BRANCH = "ti-linux-5.10.y" -SRCREV = "bdfd5b0c1ee5617c9a94bacad0d818920d95b486" - -KERNEL_GIT_URI = "git://git.ti.com/git/ti-linux-kernel/ti-linux-kernel.git" -KERNEL_GIT_PROTOCOL = "https" -SRC_URI += "${KERNEL_GIT_URI};protocol=${KERNEL_GIT_PROTOCOL};branch=${BRANCH}" - -PKGV:linux-libc-headers-dev = "5.10" -PKGV:linux-libc-headers = "5.10" - -inherit kernel-arch pkgconfig multilib_header - -EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCPP="${BUILD_CPP}"" - -DEPENDS += "bison-native rsync-native" - -do_configure:append() { - cd ${WORKDIR}/git - oe_runmake allnoconfig -} - -do_install:append() { - cd ${WORKDIR}/git - oe_runmake headers_install INSTALL_HDR_PATH=${B}${exec_prefix} - - CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" - cp ${CP_ARGS} ${B}${includedir} ${D}${exec_prefix} - - # The ..install.cmd conflicts between various configure runs - find ${D}${exec_prefix} -name ..install.cmd | xargs rm -f -}
meta-arago-extras/recipes-core/meta/external-arm-bfd-version.inc deleted +0 -8
@@ -1,8 +0,0 @@ -TOOLCHAIN_PATH ??= "${STAGING_BINDIR_TOOLCHAIN}" - -def eat_get_bfd_version(d): - import subprocess,os,bb - if os.path.exists(d.getVar('TOOLCHAIN_PATH')+'/bin/'+d.getVar('TARGET_PREFIX')+'as'): - return subprocess.Popen([d.getVar('TOOLCHAIN_PATH')+'/bin/'+d.getVar('TARGET_PREFIX')+'as', '-v', '--version'], stderr=subprocess.STDOUT,stdout=subprocess.PIPE).communicate()[0].splitlines()[0].split()[3] - -EAT_VER_BFD := "${@eat_get_bfd_version(d)}"
meta-arago-extras/recipes-core/meta/external-arm-sdk-toolchain.bb deleted +0 -131
131 lines not on this page · raw message
meta-arago-extras/recipes-core/meta/external-arm-toolchain.bbappend deleted +0 -73
73 lines not on this page · raw message
meta-arago-extras/recipes-core/meta/files/SUPPORTED deleted +0 -1
@@ -1 +0,0 @@ -POSIX
Signature · 1 line
2.25.1
PATCH 5/6 meta-arago: remove extra plumbing for internal toolchain
In reply to Denys DmytriyenkoFrom: Denys Dmytriyenko <[email protected]>
No longer needed w/o external toolchain - use defaults from OE-Core.
Also remove extra code that was trying to unify internal and external toolchains structures in meta-toolchain-arago.
--- meta-arago-distro/conf/distro/arago.conf | 10 ---- .../conf/distro/include/toolchain-gcc.inc | 41 -------------- .../distro/include/toolchain-internal.inc | 4 -- .../recipes-core/meta/meta-toolchain-arago.bb | 54 +++++-------------- 4 files changed, 14 insertions(+), 95 deletions(-) delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-gcc.inc delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-internal.inc
meta-arago-distro/conf/distro/arago.conf +0 -10
@@ -152,16 +152,6 @@ ARAGO_SYSTEST_ENABLE ?= "0" ARAGO_KERNEL_SUFFIX:append = "${@oe.utils.conditional("ARAGO_SYSTEST_ENABLE", "1", "-systest", "", d)}" IMAGE_FSTYPES:remove = "${@['','ubi ubifs'][d.getVar('ARAGO_SYSTEST_ENABLE') == '1']}" -# Toolchain should be selected by setting TOOLCHAIN_BRAND in local.conf -# Set some sane defaults, in case someone forgets to set them in local.conf -TC_SANE_DEFAULT ?= "arm" -TOOLCHAIN_TYPE ?= "internal" -TOOLCHAIN_TYPE:omapl138 = "internal" -TOOLCHAIN_BRAND ?= "${@[d.getVar('TC_SANE_DEFAULT'),'gcc'][d.getVar('TOOLCHAIN_TYPE') == 'internal']}" - -require conf/distro/include/toolchain-${TOOLCHAIN_BRAND}.inc -require conf/distro/include/toolchain-${TOOLCHAIN_TYPE}.inc - # Enable basic stack and buffer overflow protections #TARGET_CPPFLAGS += "-fstack-protector -D_FORTIFY_SOURCE=1" #TARGET_CPPFLAGS += "-fstack-protector"
meta-arago-distro/conf/distro/include/toolchain-gcc.inc deleted +0 -41
41 lines not on this page · raw message
meta-arago-distro/conf/distro/include/toolchain-internal.inc deleted +0 -4
@@ -1,4 +0,0 @@ -# No special handling is required for locating the internal toolchain, just re-use existing vars -TOOLCHAIN_PATH ?= "${STAGING_BINDIR_TOOLCHAIN}" -TOOLCHAIN_SYSPATH ?= "${TOOLCHAIN_PATH}/${TARGET_SYS}" -EXTERNAL_TOOLCHAIN = "${TOOLCHAIN_PATH}"
meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb +14 -40
72 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [EXTERNAL] [meta-arago] [kirkstone][PATCH 5/6] meta-arago: remove extra plumbing for internal toolchain
Hi Denys,
This is probably not about this new patch series for the r5f toolchain. I am facing issues with the internal toolchain for A72
I was trying out u-boot and linux builds with these new internal toolchains and everything works fine EXCEPT for u-boot-a72 build:
I get this error : "aarch64-oe-linux-ld.bfd: cannot find -lgcc: No such file or directory"
I narrowed down the error to incorrect Ldir being parsed in the u-boot Makefile here [1] which expects absolute path for the print-libgcc-file-name.
The build with the external toolchain works coz that prints the absolute path while the yocto internal toolchain is returning just the filename: ./bin/aarch64-none-linux-gnu-gcc -print-libgcc-file-name #Prints full path to libgcc.a file
./linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-gcc -print-libgcc-file-name #Prints just "libgcc.a". The dirname for this returns "."
[1]: https://git.ti.com/cgit/ti-u-boot/ti-u-boot/tree/Makefile?h=ti-u-boot-2023.04#n895
As it stands, I am unable to build u-boot with the internal toolchain. Either something needs to be fixed in the toolchain itself or I am missing some flag / Env variable?
Thanks,
Aniket
Quoted 175 lines · Denys Dmytriyenko
From: Denys Dmytriyenko<[email protected]>
No longer needed w/o external toolchain - use defaults from OE-Core.
Also remove extra code that was trying to unify internal and external toolchains structures in meta-toolchain-arago.
Signed-off-by Denys Dmytriyenko<[email protected]>--- meta-arago-distro/conf/distro/arago.conf | 10 ---- .../conf/distro/include/toolchain-gcc.inc | 41 -------------- .../distro/include/toolchain-internal.inc | 4 -- .../recipes-core/meta/meta-toolchain-arago.bb | 54 +++++-------------- 4 files changed, 14 insertions(+), 95 deletions(-)delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-gcc.inc delete mode 100644 meta-arago-distro/conf/distro/include/toolchain-internal.inc
meta-arago-distro/conf/distro/arago.conf +0
-6@@ -152,16 +152,6 @@ ARAGO_SYSTEST_ENABLE ?= "0" ARAGO_KERNEL_SUFFIX:append ="${@oe.utils.conditional("ARAGO_SYSTEST_ENABLE", "1", "-systest", "", d)}" IMAGE_FSTYPES:remove ="${@['','ubi ubifs'][d.getVar('ARAGO_SYSTEST_ENABLE') == '1']}" -# Toolchain should be selected by setting TOOLCHAIN_BRAND in local.conf -# Set some sane defaults, in case someone forgets to set them in local.conf -TC_SANE_DEFAULT ?= "arm" -TOOLCHAIN_TYPE ?= "internal" -TOOLCHAIN_TYPE:omapl138 = "internal" -TOOLCHAIN_BRAND ?="${@[d.getVar('TC_SANE_DEFAULT'),'gcc'][d.getVar('TOOLCHAIN_TYPE') =='internal']}"
meta-arago-distro/conf/distro/arago.conf +0
-4- -require conf/distro/include/toolchain-${TOOLCHAIN_BRAND}.inc -require conf/distro/include/toolchain-${TOOLCHAIN_TYPE}.inc - # Enable basic stack and buffer overflow protections #TARGET_CPPFLAGS += "-fstack-protector -D_FORTIFY_SOURCE=1" #TARGET_CPPFLAGS += "-fstack-protector"meta-arago-distro/conf/distro/include/toolchain-gcc.inc deleted +0
-41@@ -1,41 +0,0 @@ -# Select internal gcc toolchain to be built from sources -TCMODE = "default" -TCLIBC = "glibc" - -LIBCEXTENSION ="${@['', '-gnu'][(d.getVar('ABIEXTENSION') or '') != '']}" - -# Match some of the external vars -TOOLCHAIN_SYS := "${TARGET_SYS}" -TOOLCHAIN_PREFIX := "${TARGET_PREFIX}" - -PREFERRED_PROVIDER_gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}" -PREFERRED_PROVIDER_binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}" -PREFERRED_PROVIDER_gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}" - -# Set Cross and SDK toolchain preferences -SDKGCCVERSION ?= "11%" -SDKBINUVERSION ?= "2.38%" -SDKGLIBCVERSION ?= "2.35%" - -PREFERRED_VERSION_gcc-crosssdk-${SDK_SYS} ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_gcc-crosssdk-initial-${SDK_SYS} ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_binutils-crosssdk-${SDK_SYS} ?= "${SDKBINUVERSION}" - -PREFERRED_VERSION_nativesdk-gcc-runtime ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_nativesdk-libgcc ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_nativesdk-libgcc-initial ?= "${SDKGCCVERSION}" -PREFERRED_VERSION_nativesdk-glibc ?= "${SDKGLIBCVERSION}" -PREFERRED_VERSION_nativesdk-glibc-locale ?= "${SDKGLIBCVERSION}" -PREFERRED_VERSION_nativesdk-glibc-initial ?= "${SDKGLIBCVERSION}" - -# Set target toolchain preferences to match Cross/SDK by default -# Can be overwritten globally, if needed -GCCVERSION ?= "11%" -BINUVERSION ?= "2.38%" -GLIBCVERSION ?= "2.35%" - -PREFERRED_VERSION_gcc ?= "${GCCVERSION}" -PREFERRED_VERSION_binutils ?= "${BINUVERSION}" -PREFERRED_VERSION_glibc ?= "${GLIBCVERSION}" -PREFERRED_VERSION_glibc-locale ?= "${GLIBCVERSION}" -PREFERRED_VERSION_glibc-initial ?= "${GLIBCVERSION}"meta-arago-distro/conf/distro/include/toolchain-internal.inc deleted +0
-4@@ -1,4 +0,0 @@ -# No special handling is required for locating the internal toolchain, just re-use existing vars -TOOLCHAIN_PATH ?= "${STAGING_BINDIR_TOOLCHAIN}" -TOOLCHAIN_SYSPATH ?= "${TOOLCHAIN_PATH}/${TARGET_SYS}" -EXTERNAL_TOOLCHAIN = "${TOOLCHAIN_PATH}"meta-arago-extras/recipes-core/meta/meta-toolchain-arago.bb +14
-40@@ -33,8 +33,8 @@ toolchain_create_sdk_env_script () { echo 'fi' >> $script echo 'export SDK_SYS=${SDK_SYS}' >> $script echo 'export REAL_MULTIMACH_TARGET_SYS=${REAL_MULTIMACH_TARGET_SYS}' >> $script - echo 'export TOOLCHAIN_SYS=${TOOLCHAIN_SYS}' >> $script - echo 'export TOOLCHAIN_PREFIX=$TOOLCHAIN_SYS-' >> $script + echo 'export TARGET_SYS=${TARGET_SYS}' >> $script + echo 'export TARGET_PREFIX=$TARGET_SYS-' >> $script echo 'export SDK_PATH_NATIVE=$SDK_PATH/sysroots/$SDK_SYS' >> $script echo 'export SDK_PATH_TARGET=$SDK_PATH/sysroots/$REAL_MULTIMACH_TARGET_SYS' >> $script echo 'export PATH=$SDK_PATH_NATIVE${bindir_nativesdk}:$SDK_PATH_NATIVE${bindir_nativesdk}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}:$PATH' >> $script@@ -43,18 +43,18 @@ toolchain_create_sdk_env_script () { echo 'export PKG_CONFIG_PATH=$SDK_PATH_TARGET${libdir}/pkgconfig:$SDK_PATH_TARGET${datadir}/pkgconfig' >> $script echo 'export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1' >> $script echo 'export CONFIG_SITE=$SDK_PATH/site-config-$REAL_MULTIMACH_TARGET_SYS' >> $script - printf 'export CC="\x24{TOOLCHAIN_PREFIX}gcc --sysroot=$SDK_PATH_TARGET"\n' >> $script - printf 'export CXX="\x24{TOOLCHAIN_PREFIX}g++ --sysroot=$SDK_PATH_TARGET"\n' >> $script - printf 'export GDB=\x24{TOOLCHAIN_PREFIX}gdb\n' >> $script - printf 'export CPP="\x24{TOOLCHAIN_PREFIX}gcc -E --sysroot=$SDK_PATH_TARGET"\n' >> $script - printf 'export LD="\x24{TOOLCHAIN_PREFIX}ld --sysroot=$SDK_PATH_TARGET"\n' >> $script - printf 'export NM=\x24{TOOLCHAIN_PREFIX}nm\n' >> $script - printf 'export AS=\x24{TOOLCHAIN_PREFIX}as\n' >> $script - printf 'export AR=\x24{TOOLCHAIN_PREFIX}ar\n' >> $script - printf 'export RANLIB=\x24{TOOLCHAIN_PREFIX}ranlib\n' >> $script - printf 'export OBJCOPY=\x24{TOOLCHAIN_PREFIX}objcopy\n' >> $script - printf 'export OBJDUMP=\x24{TOOLCHAIN_PREFIX}objdump\n' >> $script - printf 'export STRIP=\x24{TOOLCHAIN_PREFIX}strip\n' >> $script + printf 'export CC="\x24{TARGET_PREFIX}gcc --sysroot=$SDK_PATH_TARGET"\n' >> $script + printf 'export CXX="\x24{TARGET_PREFIX}g++ --sysroot=$SDK_PATH_TARGET"\n' >> $script + printf 'export GDB=\x24{TARGET_PREFIX}gdb\n' >> $script + printf 'export CPP="\x24{TARGET_PREFIX}gcc -E --sysroot=$SDK_PATH_TARGET"\n' >> $script + printf 'export LD="\x24{TARGET_PREFIX}ld --sysroot=$SDK_PATH_TARGET"\n' >> $script + printf 'export NM=\x24{TARGET_PREFIX}nm\n' >> $script + printf 'export AS=\x24{TARGET_PREFIX}as\n' >> $script + printf 'export AR=\x24{TARGET_PREFIX}ar\n' >> $script + printf 'export RANLIB=\x24{TARGET_PREFIX}ranlib\n' >> $script + printf 'export OBJCOPY=\x24{TARGET_PREFIX}objcopy\n' >> $script + printf 'export OBJDUMP=\x24{TARGET_PREFIX}objdump\n' >> $script + printf 'export STRIP=\x24{TARGET_PREFIX}strip\n' >> $script echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux --with-libtool-sysroot=$SDK_PATH_TARGET"' >> $script echo 'export CPPFLAGS="${TARGET_CC_ARCH} --sysroot=$SDK_PATH_TARGET"' >> $script echo 'export CFLAGS="$CPPFLAGS"' >> $script@@ -97,32 +97,6 @@ arago_sdk_fixup () { done cleanup_toolchain_packages - - # Do some extra setup work due to new structure - mkdir -p "${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/lib/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}" - if [ "${TOOLCHAIN_TYPE}" = "internal" ]; then - lexec="${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/libexec/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/gcc/${TOOLCHAIN_SYS}" - else - lexec="${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/libexec/gcc/${TOOLCHAIN_SYS}" - fi - tcv=`ls -1 $lexec|head -1` - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/$tcv ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/$tcv - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/$tcv ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/$tcv - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/${TOOLCHAIN_SYS} ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/${TOOLCHAIN_SYS} - [ -e ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/${TOOLCHAIN_SYS} ] || ln -s . ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/${TOOLCHAIN_SYS} - tcpath="${SDK_OUTPUT}/${SDKPATHNATIVE}${prefix_nativesdk}/${TOOLCHAIN_SYS}" - mkdir -p $tcpath - ( cd $tcpath; \ - ln -s ${SDKTARGETSYSROOT}/include include; \ - if [ "${TOOLCHAIN_BRAND}" != "arago" ]; then \ - mkdir -p libc; \ - cd libc; \ - fi; \ - mkdir -p usr; \ - ln -s ${SDKTARGETSYSROOT}/lib lib; \ - ln -s ${SDKTARGETSYSROOT}/usr/lib usr/lib; \ - ln -s ${SDKTARGETSYSROOT}/usr/include usr/include; \ - ) } fakeroot create_sdk_files() {
Re: [EXTERNAL] [meta-arago] [kirkstone][PATCH 5/6] meta-arago: remove extra plumbing for internal toolchain
Quoted 24 lines · Aniket Limaye
Hi Denys,
This is probably not about this new patch series for the r5f toolchain. I am facing issues with the internal toolchain for A72
I was trying out u-boot and linux builds with these new internal toolchains and everything works fine EXCEPT for u-boot-a72 build:
I get this error : "aarch64-oe-linux-ld.bfd: cannot find -lgcc: No such file or directory"
I narrowed down the error to incorrect Ldir being parsed in the u-boot
Makefilehere [1] which expects absolute path for the print-libgcc-file-name.The build with the external toolchain works coz that prints the absolute path while the yocto internal toolchain is returning just the filename: ./bin/aarch64-none-linux-gnu-gcc -print-libgcc-file-name #Prints full path to libgcc.a file
./linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-gcc -print-libgcc-file-name #Prints just "libgcc.a". The dirname for
this returns "."
Quoted 5 lines
[1]: https://git.ti.com/cgit/ti-u-boot/ti-u-boot/tree/Makefile?h=ti-u-boot-2023.04#n895
As it stands, I am unable to build u-boot with the internal toolchain. Either something needs to be fixed in the toolchain itself or I am missing some flag / Env variable?
Aniket,
You need to pass the correct --sysroot to gcc.
And the environment-setup-aarch64-oe-linux script properly sets CC variable already with the correct --sysroot of the installed linux-devkit:
$ echo $CC aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=/tmp/sdk/sysroots/aarch64-oe-linux
$ $CC -print-libgcc-file-name /tmp/sdk/sysroots/aarch64-oe-linux/usr/lib/aarch64-oe-linux/11.4.0/libgcc.a
You can pass this to the U-boot Makefile:
$ make CC="$CC" <any other vars> <target>
As a reference, u-boot recipe passes at least CROSS_COMPILE, CC and HOSTCC.
Signature · 1 line
Denys
Re: [EXTERNAL] [meta-arago] [kirkstone][PATCH 5/6] meta-arago: remove extra plumbing for internal toolchain
Quoted 40 lines · Denys Dmytriyenko
Quoted 24 lines · Aniket Limaye
Hi Denys,
This is probably not about this new patch series for the r5f toolchain. I am facing issues with the internal toolchain for A72
I was trying out u-boot and linux builds with these new internal toolchains and everything works fine EXCEPT for u-boot-a72 build:
I get this error : "aarch64-oe-linux-ld.bfd: cannot find -lgcc: No such file or directory"
I narrowed down the error to incorrect Ldir being parsed in the u-boot
Makefilehere [1] which expects absolute path for the print-libgcc-file-name.The build with the external toolchain works coz that prints the absolute path while the yocto internal toolchain is returning just the filename: ./bin/aarch64-none-linux-gnu-gcc -print-libgcc-file-name #Prints full path to libgcc.a file
./linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-gcc -print-libgcc-file-name #Prints just "libgcc.a". The dirname for
this returns "."Quoted 5 lines
[1]: https://git.ti.com/cgit/ti-u-boot/ti-u-boot/tree/Makefile?h=ti-u-boot-2023.04#n895
As it stands, I am unable to build u-boot with the internal toolchain. Either something needs to be fixed in the toolchain itself or I am missing some flag / Env variable?
Aniket,
You need to pass the correct --sysroot to gcc.
And the environment-setup-aarch64-oe-linux script properly sets CC variable already with the correct --sysroot of the installed linux-devkit:
$ echo $CC aarch64-oe-linux-gcc -mbranch-protection=standard --sysroot=/tmp/sdk/sysroots/aarch64-oe-linux
Quoted 9 lines
$ $CC -print-libgcc-file-name /tmp/sdk/sysroots/aarch64-oe-linux/usr/lib/aarch64-oe-linux/11.4.0/libgcc.aYou can pass this to the U-boot
Makefile:$ make CC="$CC" <any other vars> <target>As a reference, u-boot recipe passes at least
CROSS_COMPILE, CC and HOSTCC.
Explicitly setting CC, with the correct sysroot, when calling make u-boot-a72 worked for me. Thanks for the clarification!
Ryan, we can merge this series now
PATCH 6/6 tisdk-bundle: package up secondary K3R5 toolchain
In reply to Denys DmytriyenkoFrom: Denys Dmytriyenko <[email protected]>
Use multiconfig to build and package a secondary toolchain for K3R5 cores. This makes some assumptions about k3r5 multiconfig using baremetal TCLIBC in meta-ti-bsp.
The toolchain for k3r5 is not combined with the Linux one and is packaged independently as k3r5-devkit.sh along with the main linux-devkit.sh inside the TISDK bundle.
--- .../classes/tisdk-bundle.bbclass | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-)
meta-arago-distro/classes/tisdk-bundle.bbclass +30 -7
@@ -35,10 +35,21 @@ TARGET_IMAGES ?= "tisdk-base-image" # path to install the meta-toolchain package in the SDK TISDK_TOOLCHAIN_PATH ?= "linux-devkit" -# meta toolchain recipe to build and package as part of the tisdk image +# Linux glibc toolchain recipe(s) to build and package as part of the tisdk bundle TISDK_TOOLCHAIN ?= "meta-toolchain-arago" TOOLCHAIN_SUFFIX ?= "-sdk" +# K3R5 baremetal toolchain recipe(s) to build and package as part of the tisdk bundle +TOOLCHAIN_MC_DEP = "" +TOOLCHAIN_MC_DEP:k3 = "mc::k3r5:meta-toolchain-arago" +TISDK_TOOLCHAIN_K3R5 ?= "${TOOLCHAIN_MC_DEP}" +TOOLCHAIN_K3R5_SUFFIX ?= "-sdk" + +# Since K3R5 packaging happens in the main default MC, these vars +# are not accessible and have to be set here +ARMPKGARCH_K3R5 ?= "armv7a" +TARGET_OS_K3R5 ?= "eabi" + # List of the type of target file system images we want to include TARGET_IMAGE_TYPES ?= "tar.xz tar.gz ubi wic.gz wic.xz"
@@ -81,6 +92,7 @@ do_rootfs[depends] += "${@string_set('%s:do_image_complete' % pn for pn in (d.ge # variable which will force us to build the toolchain first so that it will be # available for packaging do_rootfs[depends] += "${@string_set('%s:do_populate_sdk' % pn for pn in (d.getVar("TISDK_TOOLCHAIN") or "").split())}" +do_rootfs[mcdepends] += "${@string_set('%s:do_populate_sdk' % pn for pn in (d.getVar("TISDK_TOOLCHAIN_K3R5") or "").split())}" do_rootfs[nostamp] = "1" do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
@@ -698,12 +710,16 @@ tisdk_image_setup () { mkdir -p ${IMAGE_ROOTFS}/var/lib/opkg mkdir -p ${IMAGE_ROOTFS}/lib - if [ -e ${DEPLOY_DIR}/sdk/${SDK_NAME}-${ARMPKGARCH}-${TARGET_OS}${TOOLCHAIN_SUFFIX}.sh ] + if [ -e ${SDK_DEPLOY}/${SDK_NAME}-${ARMPKGARCH}-${TARGET_OS}${TOOLCHAIN_SUFFIX}.sh ] then - chmod 755 ${DEPLOY_DIR}/sdk/${SDK_NAME}-${ARMPKGARCH}-${TARGET_OS}${TOOLCHAIN_SUFFIX}*.sh + chmod 755 ${SDK_DEPLOY}/${SDK_NAME}-${ARMPKGARCH}-${TARGET_OS}${TOOLCHAIN_SUFFIX}.sh # Temporarily extract the toolchain sdk so we can read license information from it. - echo "${IMAGE_ROOTFS}/${TISDK_TOOLCHAIN_PATH}" | ${DEPLOY_DIR}/sdk/${SDK_NAME}-${ARMPKGARCH}-${TARGET_OS}${TOOLCHAIN_SUFFIX}*.sh + echo "${IMAGE_ROOTFS}/${TISDK_TOOLCHAIN_PATH}" | ${SDK_DEPLOY}/${SDK_NAME}-${ARMPKGARCH}-${TARGET_OS}${TOOLCHAIN_SUFFIX}.sh + fi + if [ -e ${SDK_DEPLOY}/${SDK_NAME}-${ARMPKGARCH_K3R5}-${TARGET_OS_K3R5}${TOOLCHAIN_K3R5_SUFFIX}.sh ] + then + chmod 755 ${SDK_DEPLOY}/${SDK_NAME}-${ARMPKGARCH_K3R5}-${TARGET_OS_K3R5}${TOOLCHAIN_K3R5_SUFFIX}.sh fi }
@@ -849,11 +865,18 @@ tisdk_image_build () { # not the extracted version rm -rf ${IMAGE_ROOTFS}/${TISDK_TOOLCHAIN_PATH} - # Copy over the toolchain sdk installer an give it a simple name which + # Copy over Linux glibc toolchain sdk installer and give it a simple name which + # matches the traditional name within the SDK. + if [ -e ${SDK_DEPLOY}/${SDK_NAME}-${ARMPKGARCH}-${TARGET_OS}${TOOLCHAIN_SUFFIX}.sh ] + then + cp ${SDK_DEPLOY}/${SDK_NAME}-${ARMPKGARCH}-${TARGET_OS}${TOOLCHAIN_SUFFIX}.sh ${IMAGE_ROOTFS}/linux-devkit.sh + fi + + # Copy over K3R5 baremetal toolchain sdk installer and give it a simple name which # matches the traditional name within the SDK. - if [ -e ${DEPLOY_DIR}/sdk/${SDK_NAME}-${ARMPKGARCH}-${TARGET_OS}${TOOLCHAIN_SUFFIX}.sh ] + if [ -e ${SDK_DEPLOY}/${SDK_NAME}-${ARMPKGARCH_K3R5}-${TARGET_OS_K3R5}${TOOLCHAIN_K3R5_SUFFIX}.sh ] then - cp ${DEPLOY_DIR}/sdk/${SDK_NAME}-${ARMPKGARCH}-${TARGET_OS}${TOOLCHAIN_SUFFIX}.sh ${IMAGE_ROOTFS}/linux-devkit.sh + cp ${SDK_DEPLOY}/${SDK_NAME}-${ARMPKGARCH_K3R5}-${TARGET_OS_K3R5}${TOOLCHAIN_K3R5_SUFFIX}.sh ${IMAGE_ROOTFS}/k3r5-devkit.sh fi # Copy the opkg.conf used by the image to allow for future updates
Signature · 1 line
2.25.1