From 181d645e76f7f60260871d5f3f1e1502506fa452 Mon Sep 17 00:00:00 2001 From: alichinese Date: Mon, 11 Nov 2024 17:14:28 +0800 Subject: [PATCH] toolchain: optimize the toolchain build * adapt the new openEuler Embedded gcc build step Signed-off-by: alichinese --- .../app/plugins/toolchain/toolchain.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/oebuild/app/plugins/toolchain/toolchain.py b/src/oebuild/app/plugins/toolchain/toolchain.py index cb54552..53c4e44 100644 --- a/src/oebuild/app/plugins/toolchain/toolchain.py +++ b/src/oebuild/app/plugins/toolchain/toolchain.py @@ -38,6 +38,19 @@ class Toolchain(OebuildCommand): description = textwrap.dedent('''\ The toolchain provides similar functionality to bitbake, allowing for the construction of an openEuler cross-toolchain. + + auto oebuild can fully automate the construction of a cross-compilation + chain, however, you need to specify the architecture of the + cross-compilation chain to be built in toolchain.yaml. + setlib it's for llvm toolchain because it rely on gcc lib + upenv it will cp cross-compile files to toolchain build directory + downsource it will download repos which relies by toolchain + + if you want to build cross compile, follow steps: + 1, oebuild generate(select build target with gcc) + 2, cd toolchain build directory + 3, oebuild toolchain downsource(download relative repos) + 4, oebuild toolchain aarch64 ''') def __init__(self): @@ -311,6 +324,12 @@ ln -sf ld.lld aarch64-openeuler-linux-gnu-ld logger.info("cp cross-tools data to ./") src_cross_dir = os.path.join(Configure().source_yocto_dir(), ".oebuild/cross-tools") subprocess.run(f'cp -ru {src_cross_dir}/* ./', shell=True, check=False) + # replace MANIFEST param in configs/config.xml + replace_manifest = ('sed -i "`grep -n \'MANIFEST=\' configs/config.xml ' + '| awk -F \':\' \'{print $1}\'`c MANIFEST=/usr1/openeuler' + '/src/yocto-meta-openeuler/.oebuild/manifest.yaml"' + 'configs/config.xml') + subprocess.run(replace_manifest, shell=True, check=False) else: # cp all llvm-toolchain files to build_dir logger.info("cp llvm-toolchain data to ./") -- Gitee