Skip to content

compiler-rt: fix do_install error with multilib #1072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 1, 2025

Conversation

shr-project
Copy link
Contributor


Contributor checklist

Reviewer Guidelines

  • When submitting a review, please pick:
    • 'Approve' if this change would be acceptable in the codebase (even if there are minor or cosmetic tweaks that could be improved).
    • 'Request Changes' if this change would not be acceptable in our codebase (e.g. bugs, changes that will make development harder in future, security/performance issues, etc).
    • 'Comment' if you don't feel you have enough information to decide either way (e.g. if you have major questions, or you don't understand the context of the change sufficiently to fully review yourself, but want to make a comment)

* it was added here in 7836278, but it's also
  defined in clang.inc since 98a9122

Signed-off-by: Martin Jansa <[email protected]>
since the upgrade to 20 it's installed in nonarch_libdir even when
multilib is used and LLVM_LIBDIR_SUFFIX is set to '32'.

I don't know if some people are setting LLVM_LIBDIR_SUFFIX in some
more creative way where this won't work, but with the default:
LLVM_LIBDIR_SUFFIX="${@d.getVar('baselib').replace('lib', '')}"
we don't seem to need this conditional, which actually breaks the
build now when the 'else' branch is used.

fixes:
http://errors.yoctoproject.org/Errors/Details/850268/
mv: cannot stat 'lib32-compiler-rt/20.1.1/image/usr/lib32/linux': No such file or directory

No change for build without multilib and compared with 19 most notably
include/orc/c_api.h is no longer included in {libdir}/clang/<version>:

$ find tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/usr
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/usr/lib
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/usr/lib/clang
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/usr/lib/clang/20.1.1
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/usr/lib/clang/20.1.1/lib
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/usr/lib/clang/20.1.1/lib/linux
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/usr/lib/clang/20.1.1/lib/linux/libclang_rt.builtins-x86_64.a
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/usr/lib/clang/20.1.1/lib/linux/liborc_rt-x86_64.a
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/usr/include
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/usr/include/orc
tmp/work/core2-64-oe-linux/compiler-rt/20.1.1.after/image/usr/include/orc/c_api.h

$ find tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/usr
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/usr/lib
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/usr/lib/clang
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/usr/lib/clang/19.1.7
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/lib
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/lib/linux
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/lib/linux/libclang_rt.builtins-x86_64.a
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/lib/linux/liborc_rt-x86_64.a
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/include
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/include/orc
tmp/work/core2-64-oe-linux/compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/include/orc/c_api.h

for lib32-compiler-rt:
$ find tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/usr
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/usr/lib
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/usr/lib/clang
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/usr/lib/clang/19.1.7
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/lib
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/lib/linux
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/lib/linux/libclang_rt.builtins-i386.a
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/include
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/include/orc
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/19.1.7/image/usr/lib/clang/19.1.7/include/orc/c_api.h

$ find tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/usr
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/usr/lib
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/usr/lib/linux
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/usr/lib/linux/libclang_rt.builtins-i386.a
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/usr/lib/clang
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/usr/lib/clang/20.1.1
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/usr/lib/clang/20.1.1/lib
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/usr/include
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/usr/include/orc
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.before/image/usr/include/orc/c_api.h
    this is where it failed because there is no /usr/lib32/clang

$ find tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/usr
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/usr/lib
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/usr/lib/clang
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/usr/lib/clang/20.1.1
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/usr/lib/clang/20.1.1/lib
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/usr/lib/clang/20.1.1/lib/linux
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/usr/lib/clang/20.1.1/lib/linux/libclang_rt.builtins-i386.a
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/usr/include
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/usr/include/orc
tmp/work/i586-oemllib32-linux/lib32-compiler-rt/20.1.1.after/image/usr/include/orc/c_api.h

Signed-off-by: Martin Jansa <[email protected]>
@shr-project shr-project requested a review from kraj as a code owner April 1, 2025 10:17
@shr-project shr-project changed the title Jansa/compiler rt compiler-rt: fix do_install error with multilib Apr 1, 2025
As in previous commit for compiler-rt.

Since the upgrade to 20 it's installed in nonarch_libdir even when
multilib is used and LLVM_LIBDIR_SUFFIX is set to '32'.

Fixes:
http://errors.yoctoproject.org/Errors/Details/850269/

mv: cannot stat 'TOPDIR/tmp/work/i586-oemllib32-linux/lib32-compiler-rt-sanitizers/20.1.1/image/usr/lib32/linux': No such file or directory

Signed-off-by: Martin Jansa <[email protected]>
Copy link
Owner

@kraj kraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

mv ${D}${libdir}/linux ${D}${libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib
fi
mkdir -p ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib
mv ${D}${nonarch_libdir}/linux ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, previously clang/compiler-rt was not configured to add suffix to runtime libs so they could not live in same directory but now it can so this perhaps is a good fix

@kraj kraj merged commit 6ec8e77 into kraj:master Apr 1, 2025
1 check passed
@shr-project shr-project deleted the jansa/compiler-rt branch April 8, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants