Missing sources for clang compilation with gcc-arm-none-eabi toolchain - clang

I do clang --target=arm-unknown-none-eabi compilation and lld linking with the toolchain (STL headers and libraries) from
https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.07/gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2?rev=4dd88ffd827940cbaf365c6f507680c6&hash=25DCA60D08717550548BB15E83726B31
without problems, but when I want to install the toolchain via apt-get
and run the build process I got following warnings
...
[32/32] Linking CXX executable bin/test.out
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/stdlib/../../../../../../../../newlib/libc/stdlib/atexit.c
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/stdlib/../../../../../../../../newlib/libc/stdlib/__atexit.c
llvm-objdump: warning: 'test.out': failed to find source /build/libstdc++-arm-none-eabi-gDiE7C/libstdc++-arm-none-eabi-17/build_nano/thumb/v7e-m+fp/hard/libstdc++/libsupc++/../../../../../../src/libstdc++-v3/libsupc++/del_op.cc
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/stdlib/../../../../../../../../newlib/libc/stdlib/malloc.c
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/stdlib/../../../../../../../../newlib/libc/stdlib/nano-mallocr.c
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/stdlib/../../../../../../../../newlib/libc/stdlib/mlock.c
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/reent/../../../../../../../../newlib/libc/reent/sbrkr.c
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build/arm-none-eabi/thumb/v7e-m+fp/hard/libgloss/libnosys/../../../../../../../libgloss/libnosys/sbrk.c
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/machine/arm/../../../../../../../../../newlib/libc/machine/arm/aeabi_memmove-thumb2.S
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/machine/arm/../../../../../../../../../newlib/libc/machine/arm/aeabi_memcpy.c
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/machine/arm/../../../../../../../../../newlib/libc/machine/arm/memcpy-armv7m.S
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/machine/arm/../../../../../../../../../newlib/libc/machine/arm/aeabi_memclr.c
llvm-objdump: warning: 'test.out': failed to find source /build/newlib-pB30de/newlib-3.3.0/build_nano/arm-none-eabi/thumb/v7e-m+fp/hard/newlib/libc/machine/arm/../../../../../../../../../newlib/libc/machine/arm/aeabi_memset-thumb2.S
Can I ignore this warnings or is there any way to solve this (e.g., by installing an additional/missing library or a dedicated llvm-objdump options)?
Note: Compared to Ubuntu20.04 there is no libnewlib-nano-arm-none-eabi available for Ubuntu22.04
E: Unable to locate package libnewlib-nano-arm-none-eabi
Thanks for the help

Related

unable to compile opencv 3.4.4 from source

Running ubuntu with 5.3 kernel.
/usr/bin/ld: /usr/local/lib/libavcodec.a(vc1dsp_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pw_9' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:307: recipe for target 'lib/libopencv_videoio.so.3.4.0' failed
make[2]: *** [lib/libopencv_videoio.so.3.4.0] Error 1
CMakeFiles/Makefile2:8259: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
Also:
ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1) 2.27
gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Any ideas ?

ld: archive has no table of contents file error with homebrew

I'm trying to compile weechat,
%> brew upgrade weechat --debug
...
[ 86%] Built target weechat_gui_curses_normal
[ 87%] Building C object src/gui/curses/normal/CMakeFiles/weechat.dir/main.o
[ 87%] Linking C executable weechat
ld: archive has no table of contents file '../../../plugins/libweechat_plugins.a' for architecture x86_64
clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)
make[2]: *** [src/gui/curses/normal/weechat] Error 254
make[1]: *** [src/gui/curses/normal/CMakeFiles/weechat.dir/all] Error 2
make: *** [all] Error 2
bash-3.2$ exit
It fails with archive has no table of contents file for architecture x86_64, it seem to be a generic error, as it happens with mysql#5.5 and many other packages.
I also see ranlib errors
/usr/local/homebrew/bin/ranlib: libweechat_gui_curses_normal.a(gui-curses-term.o): unknown load command 0x32
Any ideas?
Resolved.
Simple do brew unlink binutils or specify RANLIB=/usr/bin/ranlib.

clang linking error : unable to find library -lclang_rt.builtins-arm.a

I am trying to build ChibiOS using clang , but currently i am stuck at below linking error.
Linking build/ch.elf
clang-7: warning: argument unused during compilation: '-nostartfiles' [-Wunused-command-line-argument]
/home/quest/clang_build/clang_all/build/bin/ld.lld: error: unable to find library -lclang_rt.builtins-arm.a
clang-7: error: ld.lld command failed with exit code 1 (use -v to see invocation)
../../../os/common/startup/ARMCMx/compilers/LLVM/mk/rules.mk:208: recipe for target 'build/ch.elf' failed
make: *** [build/ch.elf] Error 1
I did downloaded the lib and provided the path in makefile but still its not picked up (ldd might be looking at a specific path for this).
Any help on this ?

ionic cordova compile ios . Error code 65 for command: xcodebuild with args: -xcconfig,

I encountered the same problem.
Version information: node -v : v7.10.0 npm -v : 4.6.1 cordova -v :7.0.1 angular/cli: 1.0.4 ionic -v : 3.3.0
The error message:
cordova compile ios
✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova compile ios (exit code 1):
Error: EACCES: permission denied, open '/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/cordova/build-extras.xcconfig'
gegaozhaodeiMac:SengledLife-0 gegaozhao$ sudo ionic cordova compile ios
cordova compile ios
✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova compile ios (exit code 1):
(truncated) ... :/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/ImageMagick/bin:/Applications/Wireshark.app/Contents/MacOS"
/usr/sbin/chown -RH root:wheel /var/root/Library/Developer/Xcode/DerivedData/SengledLife-ewbxwhbmxfyrqvehvjnxjlgxqyej/Build/Intermediates/ArchiveIntermediates/SengledLife/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libCordova.a
SetMode u+w,go-w,a+rX /var/root/Library/Developer/Xcode/DerivedData/SengledLife-ewbxwhbmxfyrqvehvjnxjlgxqyej/Build/Intermediates/ArchiveIntermediates/SengledLife/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libCordova.a
cd /Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/CordovaLib
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/ImageMagick/bin:/Applications/Wireshark.app/Contents/MacOS"
/bin/chmod -RH u+w,go-w,a+rX /var/root/Library/Developer/Xcode/DerivedData/SengledLife-ewbxwhbmxfyrqvehvjnxjlgxqyej/Build/Intermediates/ArchiveIntermediates/SengledLife/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libCordova.a
=== BUILD TARGET SengledLife OF PROJECT SengledLife WITH CONFIGURATION Debug ===
Check dependencies
Signing for "SengledLife" requires a development team. Select a development team in the project editor.
warning: no rule to process file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/System/Library/Frameworks/SLLivePlaySdk.framework' of type wrapper.framework for architecture armv7
warning: no rule to process file '/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/SengledLife/Plugins/com.sengled.slliveplayer/SLLivePlayBundle.bundle' of type wrapper.plug-in for architecture armv7
warning: no rule to process file '/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/SengledLife/Plugins/com.sengled.snapNetwork/cloud' of type file for architecture armv7
warning: no rule to process file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/System/Library/Frameworks/ElementScanBulbCodeVIewSdk.framework' of type wrapper.framework for architecture armv7
warning: no rule to process file '/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/SengledLife/Plugins/com.sengled.zxing.barcodescanner/notice.gif' of type image.gif for architecture armv7
warning: no rule to process file '/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/SengledLife/Plugins/com.sengled.zxing.barcodescanner/ScanBulbCodeViewController.h' of type sourcecode.c.h for architecture armv7
warning: no rule to process file '/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/SengledLife/Plugins/com.sengled.zxing.barcodescanner/SlScanNavigationController.h' of type sourcecode.c.h for architecture armv7
warning: no rule to process file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/System/Library/Frameworks/SLLivePlaySdk.framework' of type wrapper.framework for architecture arm64
warning: no rule to process file '/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/SengledLife/Plugins/com.sengled.slliveplayer/SLLivePlayBundle.bundle' of type wrapper.plug-in for architecture arm64
warning: no rule to process file '/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/SengledLife/Plugins/com.sengled.snapNetwork/cloud' of type file for architecture arm64
warning: no rule to process file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/System/Library/Frameworks/ElementScanBulbCodeVIewSdk.framework' of type wrapper.framework for architecture arm64
warning: no rule to process file '/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/SengledLife/Plugins/com.sengled.zxing.barcodescanner/notice.gif' of type image.gif for architecture arm64
warning: no rule to process file '/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/SengledLife/Plugins/com.sengled.zxing.barcodescanner/ScanBulbCodeViewController.h' of type sourcecode.c.h for architecture arm64
warning: no rule to process file '/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/SengledLife/Plugins/com.sengled.zxing.barcodescanner/SlScanNavigationController.h' of type sourcecode.c.h for architecture arm64
Code signing is required for product type 'Application' in SDK 'iOS 10.2'
** ARCHIVE FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/cordova/build-debug.xcconfig,-workspace,SengledLife.xcworkspace,-scheme,SengledLife,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,SengledLife.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/gegaozhao/Desktop/SengledLife-0/platforms/ios/build/sharedpch
--- The above is my detailed information, if there is a good solution, please share, thanks

skipping incompatible xxx.a when searching for -l

When compiling my project I get the following error:
/usr/bin/ld: skipping incompatible ../../Build/qtpropertybrowser/Linux/Develop/libqtpropertybrowser.a when searching for -lqtpropertybrowser
/usr/bin/ld: cannot find -lqtpropertybrowser
/usr/bin/ld: skipping incompatible ../../Build/libqxt/Linux/Develop/libqxt.a when searching for -lqxt
/usr/bin/ld: cannot find -lqxt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I assume that if anything, the files it should be searching for should be qtpropertybrowser and qxt. Is this correct? And if so, how do I change this?
New to Linux by the way.

Resources