meta-clang icon indicating copy to clipboard operation
meta-clang copied to clipboard

When setting up sdk relocating error

Open Lorac opened this issue 5 years ago • 61 comments

When I setup our SDK I get this error :

ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/lib/libclang.so.8, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/lib/LLVMgold.so, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/lib/libOptRemarks.so.8, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/lib/libLTO.so.8, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-format, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-tblgen, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-stress, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-diff, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-offload-bundler, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-extract, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-cxxfilt, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-opt-report, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-profdata, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-bcanalyzer, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/diagtool, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-nm, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-rtdyld, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/lld, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-tidy, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-extdef-mapping, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-config, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/bugpoint, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-as, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-refactor, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-8, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llc, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/lli, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/yaml2obj, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-modextract, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-cxxdump, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-cat, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/dsymutil, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/opt, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-mt, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-xray, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-mca, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-dwarfdump, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-import-test, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-size, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-lto2, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-elfabi, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-symbolizer, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/modularize, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-cvtres, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-c-test, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-objcopy, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-cxxmap, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-split, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-strings, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-mc, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-rc, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-apply-replacements, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/sancov, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-query, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-lto, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-cfi-verify, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-objdump, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-ar, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-include-fixer, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/sanstats, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/obj2yaml, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-change-namespace, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-exegesis, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-link, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-rename, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/find-all-symbols, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-reorder-fields, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-dis, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-cov, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/verify-uselistorder, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clang-check, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-dwp, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/c-index-test, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-pdbutil, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-undname, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-readobj, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/clangd, interp size = 71 and 86 is needed.
ERROR: could not relocate ...../sysroots/x86_64-pikosdk-linux/usr/bin/llvm-tblgen, interp size = 71 and 86 is needed.

The ..... is just to mask the path

Lorac avatar Apr 04 '19 19:04 Lorac

Can you post the build configuration

kraj avatar Apr 05 '19 02:04 kraj

I'm on a native x86_64 cross compiling for aarch64. Is that the information you were looking for?

Lorac avatar Apr 05 '19 02:04 Lorac

Are you able to post the Build Configuration printed by bitbake at the beginning of build

kraj avatar Apr 05 '19 02:04 kraj

Build Configuration:
BB_VERSION           = "1.40.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-piko-linux"
MACHINE              = "OUR MACHINE"
DISTRO               = "piko"
DISTRO_VERSION       = "2.6.1"
TUNE_FEATURES        = "aarch64"
TARGET_FPU           = ""
meta                 
meta-poky            
meta-yocto-bsp       = "HEAD:db755e5b6165fa0fdd95bb17d24015278574efdb"
meta-oe              
meta-multimedia      
meta-python          = "HEAD:02ac765fa8095626386fc592f9d65f7e4f53e77b"
meta-xilinx-bsp      
meta-xilinx-contrib  = "HEAD:d2cccbabeceec246e92132151d71831f50f74bf1"
meta-xilinx-tools    = "HEAD:ab9ff94851230027be445faf218b7d7eb1bf81c7"
meta-qt5             = "HEAD:68afc7108388d76ad53200c7f027609820a6ab3a"
meta-clang           = "HEAD:686c29d744a5c3b0766e50a137cca777e0c7cfe5"

Lorac avatar Apr 05 '19 02:04 Lorac

You seem to be using thud release Could you try same with master

kraj avatar Apr 05 '19 14:04 kraj

I've got the same bug, also building for an aarch64 target (might not be an aarch-specific thing though). I'm also on thud, since that's the current release (we couldn't wait for warrior, and needed to lock a version).

My SDK errors are very slightly different - they read "interp size = 75 and 106 is needed" , but otherwise the same.

I'm happy to help repro/debug as needed. Is there anything about master that I can backport into our thud layer which might tweak the error? We use the SDK pretty heavily.

Here's my build config with a couple of codenames blanked out:

Build Configuration:
BB_VERSION           = "1.40.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-poky-linux"
MACHINE              = $DISTRO_MACHINE"
DISTRO               = $DISTRO_NAME
DISTRO_VERSION       = "0.9"
TUNE_FEATURES        = "aarch64 crypto cortexa53"
TARGET_FPU           = ""
meta
meta-poky
meta-yocto-bsp       = "HEAD:1cab405d88149fd63322a867c6adb4a80ba68db3"
meta-multimedia
meta-networking
meta-oe
meta-python    = "thud:4cd3a39f22a2712bfa8fc657d09fe2c7765a4005"
meta-clang     = "master:ae23e30d7050779186c93b2cefd0690ce3023818"
meta-$BSP      = "HEAD:433f379c457313f586c8806ee1c4b2384ddb1091"
meta-$PRODUCT  = "HEAD:6e8be36bdce9a694bf5fb29c7b0c17a8f08d5f5b"

nrclark avatar Apr 17 '19 07:04 nrclark

Can you try it on master/warrior please ?

kraj avatar May 20 '19 16:05 kraj

So I'm still stuck on poky thud, but I tried with meta-clang master and same problem for now...

I won't be able to upgrade poky until meta-xillinx push their update for the warrior release.

Lorac avatar May 31 '19 16:05 Lorac

We tried to generate a sdk for a x86-64 machine and getting the same errors.

Lorac avatar Jun 05 '19 14:06 Lorac

@Lorac I think the problem comes from OE-core so you need to try poky/oe-core master as well along with meta-clang

kraj avatar Jun 12 '19 19:06 kraj

I can confirm this issue with all layers (poky, meta-oe, meta-clang) on latest warrior.

Only difference is, I get the messages with

ERROR: could not relocate .../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/lib/LLVMgold.so, interp size = 78 and 84 is needed.

My build configuration is:

Build Configuration:
BB_VERSION           = "1.42.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-$SUPPLIER-linux-gnueabi"
MACHINE              = "qemuarm"
DISTRO               = "$DISTRO"
DISTRO_VERSION       = "2.7-0"
TUNE_FEATURES        = "arm armv7ve vfp thumb neon callconvention-hard"
TARGET_FPU           = "hard"
meta
meta-poky
meta-yocto-bsp       = "feature/clang:a3b49960885626544e043731eada210266d26bd6"
meta-oe              = "warrior:8d5dcd6522e9d15e68637b6d7dda0401f9bb91d0"
meta-ptx             = "HEAD:1a5ad62192cd352ac596d52a2281802cbf29d619"
meta-rauc            = "warrior:a1a5d590a6548a1ee43e3dbff98fd23af4207339"
meta-clang           = "warrior:4babecabc58ec64a5a12c180165996ea34f9e48a"

Here are additional infos. The installed files seem to be linked against /usr/local/oecore-x86_64, instead of the real SDK location ../sdk/qemu:

$ file .../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/*clang*
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang:                    symbolic link to clang-8
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang++:                  symbolic link to clang
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-8:                  ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-apply-replacements: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-change-namespace:   ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-check:              ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-cl:                 symbolic link to clang
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-cpp:                symbolic link to clang
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clangd:                   ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-extdef-mapping:     ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-format:             ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-import-test:        ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-include-fixer:      ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-offload-bundler:    ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-query:              ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-refactor:           ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-rename:             ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-reorder-fields:     ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-tblgen:             ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/clang-tidy:               ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
.../sdk/qemu/sysroots/x86_64-oesdk-linux/usr/bin/git-clang-format:         Python script, ASCII text executable

Atomisirsi avatar Jul 31 '19 06:07 Atomisirsi

OK I guess we need to deep dive into it since its seem in many instances. Can you share what is your host OS and version.

kraj avatar Jul 31 '19 06:07 kraj

From hostnamectl:

Operating System: Debian GNU/Linux 10 (buster)
Kernel: Linux 4.19.0-5-amd64
Architecture: x86-64

Atomisirsi avatar Jul 31 '19 08:07 Atomisirsi

@Atomisirsi can you try commenting out the line below

https://github.com/kraj/meta-clang/blob/master/classes/clang.bbclass#L30

kraj avatar Jul 31 '19 15:07 kraj

Can you try to install this SDK on the SDK host where you see this error

https://uclibc.org/~kraj/yoe-glibc-sysvinit-wayland-glibc-x86_64-meta-toolchain-aarch64-raspberrypi3-64-toolchain-2.6.sh

kraj avatar Jul 31 '19 23:07 kraj

Thank you very much @kraj: commenting out line 30 fixed the relocating issues. But the clang tools still do not use the SDK's ld-linux-x86-64.so.2. Instead, they are linked to /lib/ld-linux-x86-64.so.2, which does not exist on Debian 10. After creating a symlink from the SDK's ld-linux-x86-64.so.2 to /lib/ld-linux-x86-64.so.2, I was finally able to execute the clang tools.

Unfortunatelly, clang seems to lack support for target CPU arm7ve, hence the integration of clang-tidy in our target build environment seems not to be possible. Though, it's working for target x86-64 where we can just use the system's installation of clang-tidy.

I have tried the SDK you provided and it worked out of the box: No relocation errors and the clang-tools are linked to the SDK's ld-linux-x86-64.so.2.

Atomisirsi avatar Aug 01 '19 07:08 Atomisirsi

line 30 fixes that exact problem of nativesdk not using nativesdk ldso. But I think we have nailed the cause of the issue which is good.

kraj avatar Aug 03 '19 04:08 kraj

This is a hairy problem and especially seen with components compiled with clang targetted for nativesdk, It would need teaching some tricks to clang driver when it comes to creating enough space in ELF header for relocation of toolchain which we do on gcc. Meanwhile a workaround could be to set the paths similar to where it will be installed something like this.

SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}"
SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}"

let me know if this workaround works for you and you can live with it for a while.

kraj avatar Aug 05 '19 17:08 kraj

The workarounds are acceptable! Now I have a working clang in my SDK for architecture x86_64. Since my last try, I have also included the latest commit on the warrior branch:

commit 16f62e8de7e9816e95f2ba8eeaad7d863bd12c16 (HEAD -> warrior, origin/warrior)
Author: Daniel Dittmann <[email protected]>
Date:   Thu Aug 1 13:01:47 2019 +0200

    use native-clang compiler when building nativesdk-clang

    Some cmake based steps when building clang uses BUILD_CC, BUILD_CXX variables,
    which points to gcc even if TOOLCHAIN_class-nativesdk = "clang".

    This patch sets it to clang if TOOLCHAIN_class-nativesdk = "clang" is set.

    Signed-off-by: Daniel Dittmann <[email protected]>

This could also have had impact, because I use gcc by default and only use clang(-tidy) for static analysis.

Atomisirsi avatar Aug 13 '19 11:08 Atomisirsi

@Atomisirsi thanks for report

kraj avatar Aug 15 '19 01:08 kraj

I've got the same bug, also building for an aarch64 target base on warrior branch,

the error info is:

could not relocate /home/ning.ding/proj/a500-sdk-clang/sysroots/x86_64-bstsdk-linux/usr/bin/clang-offload-bundler, interp size = 72 and 90 is needed. ERROR: could not relocate /home/ning.ding/proj/a500-sdk-clang/sysroots/x86_64-bstsdk-linux/usr/bin/llvm-dwp, interp size = 72 and 90 is needed. ERROR: could not relocate /home/ning.ding/proj/a500-sdk-clang/sysroots/x86_64-bstsdk-linux/usr/bin/obj2yaml, interp size = 72 and 90 is needed. ERROR: could not relocate /home/ning.ding/proj/a500-sdk-clang/sysroots/x86_64-bstsdk-linux/usr/bin/llvm-rc, interp size = 72 and 90 is needed. ERROR: could not relocate /home/ning.ding/proj/a500-sdk-clang/sysroots/x86_64-bstsdk-linux/usr/bin/bugpoint, interp size = 72 and 90 is needed. …………

My build configuration is:

Build Configuration: BB_VERSION = "1.43.0" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "ubuntu-18.04" TARGET_SYS = "aarch64-bst-linux" MACHINE = "a500" DISTRO = "bstos" DISTRO_VERSION = "0.3.3-20191104" TUNE_FEATURES = "aarch64" TARGET_FPU = "" meta = "HEAD:952bfcc3f4b9ee5ba584da0f991f95e80654355a" meta-clang = "warrior:3611f25304bbb86f4a1600c3399a8a5a6cc050fa" meta-oe
meta-multimedia
meta-python
meta-networking
meta-filesystems = "HEAD:8d5dcd6522e9d15e68637b6d7dda0401f9bb91d0" meta-bstos = "a500-luneos-merge:3f47f19ce083183402b5700a8041364747c6e0ef" meta-qt5 = "master:2a5f9415e48a38f6f4eb0cf375737a2d8438e2fe" meta-luneos
meta-luneui = "a500-luneos-merge:3f47f19ce083183402b5700a8041364747c6e0ef"

I have tried commenting out line "#TUNE_CCARGS_remove_toolchain-clang_powerpc = "-mhard-float" in clang.bbclass and add

SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}" SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}"

in my bb file, but it does not work.

AKADiNG avatar Nov 04 '19 09:11 AKADiNG

SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}"
SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}"

Should be set in conf/local.conf

kraj avatar Nov 05 '19 01:11 kraj

SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}"
SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}"

Should be set in conf/local.conf

I found that it will be ok when you installed the sdk into the default path,。Chang the install path will call this problem.

AKADiNG avatar Nov 05 '19 08:11 AKADiNG

yes, as long as your install path is smaller than build path, it will work. The real fix is to create space in ELF header to expand the paths but thats quite invasive and needs a bit of time to get it right and upstream with not accept such a patch.

kraj avatar Nov 05 '19 22:11 kraj

I wonder why this wasn't an issue in the past? We were using clang 5 for a long time based on this layer and we didn't have any difficulties with the SDK. Maybe this information could point to a possible solution?

ghost avatar Mar 27 '20 08:03 ghost

A solution would be to do something what we do for binutils/gcc/glibc where it introduces padding section .gccrelocprefix which is then edited by the SDK installer during install to input the final location of SDK. e.g. glibc case

kraj avatar Mar 27 '20 08:03 kraj

Was this in place before? Why is it that this didn't happen before?

ghost avatar Mar 27 '20 09:03 ghost

Can this problem be worked around by simply removing the meta-clang layer? I also removed meta-browser which depended on meta-clang, but I don't think I need that either.

fmhess avatar Apr 07 '20 22:04 fmhess

If you don’t need clang then you don’t have this problem

kraj avatar Apr 07 '20 23:04 kraj

What I am trying to ask is if Angstrom Zeus needs Clang or if removing the meta-clang layer is going to cause other problems. As far as I know, all Clang is doing for me is generating a bunch of errors when trying to install the SDK.

fmhess avatar Apr 07 '20 23:04 fmhess