Error while running cloud9 "error: ld terminated with signal 11" - llvm

I am trying to run the cloud9 application on ubuntu. However make command is giving me error
llvm[2]: Linking Release+Asserts executable klee (without symbols)
collect2: error: ld terminated with signal 11 [Segmentation fault], core dumped
make[2]: *** [/home/mmalik9/cloud9-cloudsuite/cloud9/Release+Asserts/bin/klee] Error 1
make[2]: Leaving directory `/home/mmalik9/cloud9-cloudsuite/cloud9/tools/klee'
make[1]: *** [klee/.makeall] Error 2
make[1]: Leaving directory `/home/mmalik9/cloud9-cloudsuite/cloud9/tools'
make: *** [all] Error 1
Please give any idea how to solve this issue?
PS Update from https://askubuntu.com/questions/441621/cloud9-application-is-giving-error-error-ld-terminated-with-signal-11-segment
g++ helloworld.cpp -o proj
I am getting same error "collect2: error: ld terminated with signal 11 [Segmentation fault], core dumped

If you can't run the ld even for simplest programs (like helloworld), it seems like something (ld binary or its libraries) was corrupted, either in memory (reboot will help), or on the hard drive.
You can recheck md5sums of the installed packages (in rpm-based linuxes - rpm --verify; in deb-based - debsums or dpkg --verify - according to debian bug 187019), or simply reinstall them.
With memtest you can test RAM for defects (ECC RAM is better to protect your data). And with modern filesystems, having data checksumming (ZFS, btrfs) and/or integrity checkers like AIDE you can detect silent corruption of data, stored on your harddrive.

Related

Building AWS secure tunneling localproxy on rPi

I'm trying to compile the AWS iot localproxy on an rPi (have tried 3 and 4 and getting the same issue). I follow the instructions here >> https://github.com/aws-samples/aws-iot-securetunneling-localproxy
I have been sucessful compiling on macOS and the binary works, but when building on an rPi I get the folowing error...
[ 4%] Linking CXX executable bin/localproxytest
/usr/bin/ld: /usr/local/lib/arm-linux-gnueabihf/libprotobuf-lite.a(arena.cc.o): in function `google::protobuf::internal::ThreadSafeArena::Init(bool)':
arena.cc:(.text+0xa60): undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/localproxytest.dir/build.make:292: bin/localproxytest] Error 1
make[1]: *** [CMakeFiles/Makefile2:97: CMakeFiles/localproxytest.dir/all] Error 2
make: *** [Makefile:103: all] Error 2
It seems to be a problem linking to '__atomic_fetch_add_8' or the atomic libs? Any clues on how to resolve? Anyone been successful building this on an rPi?
I believe there is an issue with CMake and the order of linking with ld.
In CMakeLists.txt
Moving atomic to be the last link command after all the sources fixed this for me
https://github.com/aws-samples/aws-iot-securetunneling-localproxy/blob/main/CMakeLists.txt#L94
if(NOT APPLE AND NOT MSVC) target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TARGET_NAME} atomic) target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TEST_NAME} atomic) endif()
should be below
https://github.com/aws-samples/aws-iot-securetunneling-localproxy/blob/main/CMakeLists.txt#L111
target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TEST_NAME} ${Protobuf_LITE_STATIC_LIBRARY})

I got an "cannot find -lOpenGL::OpenGL" error when make install partio

When I install the partio it shows the following error message
/usr/bin/ld: cannot find -lOpenGL::OpenGL
collect2: error: ld returned 1 exit status
src/tools/CMakeFiles/partview.dir/build.make:91: recipe for target 'src/tools/partview' failed
make[2]: *** [src/tools/partview] Error 1
CMakeFiles/Makefile2:967: recipe for target 'src/tools/CMakeFiles/partview.dir/all' failed
make[1]: *** [src/tools/CMakeFiles/partview.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
When I search the internet I barely see any information regard to -lOpenGL::OpenGL. I have seen OpenGL::GLU or GL. But I havent seen OpenGL::OpenGL yet. So I don't know how to solve this.
I am using the cmake version exactly 3.15.0.
Is there any solution to this? Anything would help.
Welcome to Stack Overflow!
The library you're looking for is called libGL.so, not libOpenGL.so or similar. To link it, add -lGL to your command line and delete references to OpenGL::OpenGL on the command line. (If you're still having troubles, show us your whole build command line.)
That said, OpenGL is a C-based library, so C++ constructs like OpenGL::OpenGL (presumably a constructor of a class) will not be found therein. Or perhaps that's a reference to CMake, in which case my answer would need to change significantly.

Having trouble compiling 32-bit binary on 64-bit linux armv8 machine

I am trying to use a c++ ARM 32-bit library on a Jetson Tx2, which is an ARM 64-bit linux machine. When I try to compile some of the sample code provided with the library I get the following compilation error:
/usr/bin/ld: skipping incompatible /home/nvidia/libroyale/bin/libroyale.so
when searching for -lroyale
/usr/bin/ld: cannot find -lroyale
collect2: error: ld returned 1 exit status
CMakeFiles/sampleCameraInfo.dir/build.make:94: recipe for target
'sampleCameraInfo' failed
make[2]: *** [sampleCameraInfo] Error 1
CMakeFiles/Makefile2:67: recipe for target
'CMakeFiles/sampleCameraInfo.dir/all' failed
make[1]: *** [CMakeFiles/sampleCameraInfo.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I assume that this error is because the 32-bit library is somehow incompatible with a 64-bit machine.
I have been browsing other StackOverflow forums on similar issues, and in accordance with those forum recommendations added the -m32 flag to CXXFLAGS and LDFLAGS when I compile. However, I then get the following error:
g++: error: unrecognized command line option ‘-m32’
CMakeFiles/sampleCameraInfo.dir/build.make:62: recipe for target
'CMakeFiles/sampleCameraInfo.dir/sampleCameraInfo.cpp.o' failed
make[2]: *** [CMakeFiles/sampleCameraInfo.dir/sampleCameraInfo.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target
'CMakeFiles/sampleCameraInfo.dir/all' failed
make[1]: *** [CMakeFiles/sampleCameraInfo.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Some other StackOverflow threads said that in order to use the -m32 flag, one has to run the command:
sudo apt-get install g++-multilib
I don't think that the installation is working correctly, as I'm getting the following errors:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
g++-multilib:armhf : Depends: cpp:armhf (>= 4:5.3.1-1ubuntu1) but it is
not going to be installed
Depends: gcc-multilib:armhf (>= 4:5.3.1-1ubuntu1) but it is not going to be installed
Depends: g++:armhf (>= 4:5.3.1-1ubuntu1) but it is not going to be installed
Depends: g++-5-multilib:armhf (>= 5.3.1-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Any suggestions would be very much appreciated. Thanks!
UPDATE: I realized that the -m32 flag is only supported on x86 linux machines. Does anyone know if there is some equivalent for ARM machines?
I had a look at the GCC documentation, especially on the following pages:
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/x86-Options.html
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/AArch64-Options.html
Looks like for the GNU compilers x86 is one type of CPU; you can create 16-, 32- or 64-bit code for this CPU type.
However it also looks like for the GNU compilers 32-bit ARM CPUs and 64-bit ARM CPUs are two completely different CPU types.
Therefore compiling for 32-bit ARM with a 64-bit ARM compiler is the same as compiling for x86 with an ARM compiler: It won't work.
Of course the 32-bit library will not be accepted; an ARM compiler would not accept a x86 library, either.

Compiling opencv for ARM platform

I want to put C++ opencv algorithm on ARM-Linux based camera.
I am able to do Configure and Generate steps for opencv build using CMake.
Then when I try to do “make” operation on terminal I am facing some issue.
->>>>>>>>>>>>>>>>>Issue->>>
Linking CXX shared library ../../lib/libopencv_core.so
/opt/montavista_pro_arm_v5t_le/bin/../lib/gcc/armv5tl-montavista-linux-gnueabi/4.2.0/../../../../armv5tl-montavista-linux-gnueabi/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[2]: *** [lib/libopencv_core.so.3.0.0] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2
->>>>>>>>>>>>>>>>
I searched online. I tried to do some stuff from link http://answers.opencv.org/question/33564/opencv-master-branch-compilation-issue/ . I removed ${ZLIB_LIBRARIES} option in modules/core/CMakeLists.txt.
But still I am facing same issue.
Can you please help me with that.

llvm error: linking error to libLTO.so

During compilation of llvm I get following error:
llvm[2]: ======= Finished Linking Debug+Asserts Executable llvm-config
llvm[2]: Installing Debug+Asserts /usr/local/bin/llvm-config
make[2]: Leaving directory `/usr/bin/tools/llvm-config'
make[2]: Entering directory `/usr/bin/tools/lto'
llvm[2]: Compiling LTODisassembler.cpp for Debug+Asserts build (PIC)
llvm[2]: Compiling lto.cpp for Debug+Asserts build (PIC)
llvm[2]: Linking Debug+Asserts Shared Library libLTO.so
collect2: ld terminated with signal 9 [Killed]
make[2]: *** [/usr/bin/Debug+Asserts/lib/libLTO.so] Error 1
make[2]: Leaving directory `/usr/bin/tools/lto'
make[1]: *** [install] Error 1
make[1]: Leaving directory `/usr/bin/tools'
make: *** [install] Error 1
I do configure llvm by giving path of gcc & g++ compilers.
I don't get any error during configuration; but during build same error persist with clang also. I am using Ubntu-12.10 32 bit.
OK, so to solve this problem, I referred to llvm.org and during configuration added few options as follows:
sudo ./configure CC="/usr/bin/gcc" CXX="/usr/bin/g++" --enable-optimization --enable-jit --enable-debug-runtime --enable-targets=all
And I ran a build as SuperUser.
I faced the same error using Ubuntu 13.04 (arch: x86_64). The following error
collect2: ld terminated with signal 9 [Killed]
was an issue with memory usage. I was indeed using a Koding.com cloud VM with 1GB RAM.
I tried the compilation on my laptop as a normal user and the compilation finished without any issues. I used:
$ ./configure
$ make -j4