mirror of
https://github.com/thead-yocto-mirror/meta-external-toolchain
synced 2026-09-16 12:13:08 +02:00
This link is required by linker to link libraries and crt* files in our
ADE/SDK. The 'rm -f' command is changed to 'rm -rf' because
external-toolchain.bbclass copies all the stuff required by PACKAGES to image
folder (in do_install stage). In doing so it copies the architecture folder
(as it is required by FILES_${PN}-dev ) from sourcery folder to image folder
in work directory. Afterwords when we try to remove the directory with 'rm -f'
it prompts an error as directories cannot be deleted with this command.
Signed-off-by: adnan-ali1 <adnan_ali@mentor.com>
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
26 lines
949 B
PHP
26 lines
949 B
PHP
def sysroot_multilib_suffix(d):
|
|
PATH = d.getVar('PATH', True)
|
|
target_cc_arch = d.getVar('TARGET_CC_ARCH', True)
|
|
options = d.getVar('TOOLCHAIN_OPTIONS', True) or d.expand('--sysroot=${STAGING_DIR_TARGET}')
|
|
sysroot = external_run(d, 'gcc', *(target_cc_arch.split() + options.split() + ['-print-sysroot'])).rstrip()
|
|
staging = d.getVar('STAGING_DIR_HOST', True)
|
|
return os.path.relpath(sysroot, staging)
|
|
|
|
create_multilib_link () {
|
|
dest="$1"
|
|
multilib_suffix="${@sysroot_multilib_suffix(d)}"
|
|
if [ "$multilib_suffix" != "." ]; then
|
|
rm -rf $dest/$multilib_suffix
|
|
ln -s . $dest/$multilib_suffix
|
|
fi
|
|
}
|
|
|
|
SYSROOT_PREPROCESS_FUNCS += "external_toolchain_sysroot_adjust"
|
|
external_toolchain_sysroot_adjust() {
|
|
create_multilib_link ${SYSROOT_DESTDIR}
|
|
|
|
# If the usr/lib directory doesn't exist, the toolchain fails to even
|
|
# try to find crti.o in a completely different directory (usr/lib64)
|
|
install -d ${SYSROOT_DESTDIR}/usr/lib
|
|
}
|