GCC 5.3 failing in the make phase - linux

Currently I have GCC 5.4.0-6 installed on my Ubuntu 16.04.4 machine. However nvcc wants me to use 5.3, so I am trying to install that version as well. I did this by:
1. downloading gcc-5.3.0.tar.gz
2. extracting it to ~/Documents/libraryDownloads/GCC-5/gcc-5.3.0
3. creating the folder ~/Documents/libraryDownloads/GCC-5/gcc-build
4. In ~/Documents/libraryDownloads/GCC-5/gcc-5.3.0 I used the command ./contrib/download_prerequisites.
5. In ~/Documents/libraryDownloads/GCC-5/gcc-build I used the command ./../gcc-5.3.0/configure --enable-multilib
6. and finally in ~/Documents/libraryDownloads/GCC-5/gcc-build I used the command make
The make-process rand for a short while and then ended with the following error:
checking whether the gcc -m32 linker (ld -m elf_x86_64 -m elf_i386) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
Makefile:10699: recipe for target 'configure-stage1-zlib' failed
make[2]: *** [configure-stage1-zlib] Error 1
make[2]: Leaving directory '/home/myUser/Documents/libraryDownloads/GCC-5/gcc-build'
Makefile:22461: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/home/myUser/Documents/libraryDownloads/GCC-5/gcc-build'
Makefile:902: recipe for target 'all' failed
make: *** [all] Error 2
As far as I know, I have all prerequisites installed and I am doing all this in a separate build folder as recommended. I tried searching for error: Link tests are not allowed after GCC_NO_EXECUTABLES., but I couldn't find anyone with similar problems. Does anyone know what could be the cause of this error?

Related

Kernel module on cross-compile kernel: /bin/sh: 1: scripts/basic/fixdep: Exec format error

I'm doing some experiment on rpi4, and trying to reproduce this kernel module from github https://github.com/sysprog21/dont-trace on my rpi4. I encounter this problem:
make -C /lib/modules/`uname -r`/build M=/home/ubuntu/dont-trace modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.65-rt49-preemptrt-full-raspi'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: aarch64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110
You are using: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
CC [M] /home/ubuntu/dont-trace/dont_trace.o
/bin/sh: 1: scripts/basic/fixdep: Exec format error
make[2]: *** [scripts/Makefile.build:289: /home/ubuntu/dont-trace/dont_trace.o] Error 126
make[2]: *** Deleting file '/home/ubuntu/dont-trace/dont_trace.o'
make[1]: *** [Makefile:1896: /home/ubuntu/dont-trace] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.65-rt49-preemptrt-full-raspi'
make: *** [Makefile:7: all] Error 2
The kernel here is cross-compiled from x86 server and do show above. I was wondering how to solve this problem & what's the root cause. I can make it on x86 server. It should be something fundamental knowledge I don't understand. Thks!
it seems work this time
My solution might be a bit workaround, but it works. I follow the clues /bin/sh: 1: scripts/basic/fixdep: Exec format error. So I copy the source code to local raspberry pi, and make modules_prepare to construct complete /scripts, then move it into /lib/modules/`uname -r\`/build. It remain the gcc version warning, but work properly.

Asterisk make crashes with cannot find -lwebrtc-x86_64-unknown-linux-gnu

I do ./configure with-pjproject-bundled, and it runs OK. Then, I issue make, and it crashes with cannot find -lwebrtc-x86_64-unknown-linux-gnu. Full stack here:
CC="cc" CXX="g++" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" make -C
menuselect CONFIGURE_SILENT="--silent" makeopts
make[1]: Entering directory `/usr/local/asterisk-14.4.0/menuselect'
make[1]: `makeopts' is up to date.
make[1]: Leaving directory `/usr/local/asterisk-14.4.0/menuselect'
Generating input for menuselect ...
menuselect/menuselect --check-deps menuselect.makeopts
menuselect/menuselect --check-deps menuselect.makeopts
Generating embedded module rules ...
[LD] libasteriskpj.o -> libasteriskpj.so.2
/usr/bin/ld: cannot find -lwebrtc-x86_64-unknown-linux-gnu
collect2: error: ld returned 1 exit status
make[1]: *** [libasteriskpj.so.2] Error 1
make: *** [main] Error 2
I use RedHat 7.3 and Asterisk 14.4.
If I do ./configure without parameters, then make runs without an error. What am I doing wrong?
You’re simply missing a library. Run this command to install it:
yum install webrtc-audio-processing-devel
Then clear out your settings before running configure again:
make clean all
I’m not at my computer now but I believe there’s a script bundled with the code that installs all the dependencies for you. Might be worth checking out.

While building kernel image i am getting this error while doing make -j4 (Using ubuntu)

lib/mpi/generic_mpih-lshift.o:/home/shubh/Root/XENO_WS/linux-3.8.13/lib/mpi/mpi-inline.h:110: first defined here
scripts/Makefile.build:443: recipe for target 'lib/mpi/mpi.o' failed
make[2]: *** [lib/mpi/mpi.o] Error 1
scripts/Makefile.build:454: recipe for target 'lib/mpi' failed
make[1]: *** [lib/mpi] Error 2
Makefile:791: recipe for target 'lib' failed
make: *** [lib] Error 2
make: *** Waiting for unfinished jobs....
How can I resolve this? When I am doing same steps in OpenSUSE it is not giving any error. I followed these steps:
make mrproper
make oldconfig
make -j4
then I get the error in between this.
So you use gcc of version 5, which is incompatible with Linux kernel version you want to compile. – Tsyvarev
It is resolve now. I build the kernel with lower version of gcc. – sam1006

undefined reference to symbol 'pthread_rwlock_wrlock##GLIBC_2.2.5' in azure storage c++ sdk compilation

I am trying to compile Azure storage c++ SDK on Fedora 22. I am using gcc version 5.1.1-1. When I compile test application using following command:
$> CASABLANCA_DIR=/source/codebox/azure/cpprestsdk/ CXX=g++ cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=on
$> make
It produces following error message:
/usr/bin/ld: CMakeFiles/azurestoragetest.dir/main.cpp.o: undefined reference to symbol 'pthread_rwlock_wrlock##GLIBC_2.2.5'
/usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
tests/CMakeFiles/azurestoragetest.dir/build.make:879: recipe for target 'Binaries/azurestoragetest' failed
make[2]: *** [Binaries/azurestoragetest] Error 1
CMakeFiles/Makefile2:125: recipe for target 'tests/CMakeFiles/azurestoragetest.dir/all' failed
make[1]: *** [tests/CMakeFiles/azurestoragetest.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
make: *** [all] Error 2
I can see libpthread.so.0 library in /usr/lib64 directory. Which other library I need to install?
Add the right find_package invokation to your CMakeLists.txt:
find_package(Threads)
Then, link the library to your target:
target_link_libraries(my_target ${CMAKE_THREAD_LIBS_INIT})
That's all. Likely you forgot the target_link_libraries.
In general (outside of CMake and Azure Storage SDK), this error indicates you need to link with -lpthread. (With gcc you likely want -pthread.)

Issue trying to build LLVM and clang

I'm trying to build LLVM and clang on my machine (Ubuntu 12.04). I followed the instructions on http://clang.llvm.org/get_started.html up to step 6 (build LLVM and clang). When I make, I get a whole load of warnings about potentially incompatibly plugin versions (to do with dragonegg?). But the whole thing fails with these messages:
llvm[2]: Linking Debug+Asserts executable llvm-tblgen
/usr/bin/ld: /home/peter/llvm/build/Debug+Asserts/bin/llvm-tblgen: hidden symbol `llvm::Type::~Type()' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[2]: *** [/home/peter/llvm/build/Debug+Asserts/bin/llvm-tblgen] Error 1
make[2]: Leaving directory `/home/peter/llvm/build/utils/TableGen'
make[1]: *** [TableGen/.makeall] Error 2
make[1]: Leaving directory `/home/peter/llvm/build/utils'
make: *** [all] Error 1
So any help you could give me would be really helpful.
Thanks
I ended up deleting the llvm folder and checking everything out again, and it worked, so I'm just putting it down to bad timing.
You may want to use the existing LLVM packages, as provided by your distributions.
This askubuntu question about LLVM 3.1 could be relevant.
And you should at least do apt-get build-dep llvm-3.1-dev to ensure all dependencies are available.
You could also ask help on some LLVM related mailing list.

Resources