Gcc default version crashes - c

I working on open source GHDL project for my project purpose installed ghdl-0.29-2.143svn.4.fc16.src.rpm consisting of ghdl 0.29 and gcc 4.3.4 through rpm -i and rpmbuild -ba command successfully.
In ghdl folder, I edited one ada program then I did make and make install : no errors but it creates problem changes in gcc version 4.6.3 (default) to 4.3.4 and no gcc program execution gave error:
error: C compiler cannot create executables
See `config.log' for more details."
In config.log file /usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
Thanks in advance
Regards
Raghu

Have you tried reinstalling glibc? That might work.

Related

GCC:- unable to find libpthread_nonshared.a file while linking libraries to create a so file on Linux

Hi I'm trying to compile a c project with gcc 10.2 in Ubuntu 20.04.
But at the end it gives me error as below
/usr/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a
collect2: error: ld returned 1 exit status
Below are the libraries I'm trying to link while creating a so file
-lpthread -ldl -lm -lstdc++ -lrt
When i looked into /usr/lib64 i could see only *.so files but no *.a files.
Do we need to install them separately?
Could someone help with this.
Do we need to install them separately?
You need to install glibc-devel (or similar) package.

Gcc collect2: fatal error: cannot find 'ld'

I'm going through the tutorial on making an OS on http://wiki.osdev.org/Bare_Bones. When I try to link boot.o and kernel.o using this command: i686-elf-gcc -T linker.ld -o myos.bin -ffreestanding -O2 -nostdlib boot.o kernel.o -lgcc , I just get this error:
collect2: fatal error: cannot find 'ld'
compilation terminated.
I just installed fresh Ubuntu 15.10 that with gcc-5.2.1 and binutils-2.25.1 .
I have searched the internet for answers but nothing helped.
I also got once the same error during a pentest while I was trying to compile my exploit on the victim server.
In my case, the directory where the "ld" program was located had not been defined in the PATH environment variable, so I simply added it.
eg. export PATH=$PATH:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
I had this error while hacking a remote machine and trying to use gcc to compile an exploit on the victim machine.
I simply copied the program ld to /tmp/, the working directory where i was compiling my exploit exploit.c by running
cp /usr/bin/ld /tmp/ld
followed by the original gcc compile command and the compile worked.
I searched a lot to fix this issue and nothing worked but lastly i uninstalled MinGw and reinstalled it then did edited the environment variables again and then uninstalled and reinstalled vs code extensions then it worked.

what package do I need to use clang with asan for 32 bit?

I get this error when compiling with clang++ and -fsanitize=address -m32:
/usr/bin/ld: cannot find /usr/lib/llvm-3.6/bin/../lib/clang/3.6.0/lib/linux/libclang_rt.asan-i386.a: No such file or directory
/usr/bin/ld: cannot find /usr/lib/llvm-3.6/bin/../lib/clang/3.6.0/lib/linux/libclang_rt.asan_cxx-i386.a: No such file or directory
What package do I need? I already tried with libclang-3.6-dev
I also got an error for clang 3.7 with -m64:
/usr/bin/ld: cannot find /usr/lib/llvm-3.7/bin/../lib/clang/3.7.1/lib/linux/libclang_rt.asan-x86_64.a: No such file or directory
/usr/bin/ld: cannot find /usr/lib/llvm-3.7/bin/../lib/clang/3.7.1/lib/linux/libclang_rt.asan_cxx-x86_64.a: No such file or directory
With clang 3.7 this seems to be a known problem, see https://llvm.org/bugs/show_bug.cgi?id=22757.
With clang 3.6 I could link without a problem.
On Ubuntu these installation instructions worked for me: https://askubuntu.com/a/509223

C-Motif code project porting from unix to linux

I am porting C-Motif code project from unix to ubuntu linux system.
I'm able to solve various problems but still there are some problems while doing make.
/usr/bin/ld: cannot find -lXmu
/usr/bin/ld: cannot find -lnls
/usr/bin/ld: cannot find -lsocket
/usr/bin/ld: cannot find -ll
collect2: error: ld returned 1 exit status
make: *** [../bin/ipsge] Error 1
For -lXmu install:
sudo apt-get install libxmu-headers
sudo apt-get install libxmu-dev
Try compiling without -lnls / -lsocket
and see if the problem is fixed.
I don't know libl.a What flavor of UNIX are you porting from?

/usr/bin/ld: cannot find -lhogweed

I;m trying to compile GnuTLS. When I thy to configure the package I get this error:
configure:8820: gcc -std=gnu99 -o conftest -g -O2 conftest.c -lnettle -lhogweed -lgmp >&5
/usr/bin/ld: cannot find -lhogweed
collect2: ld returned 1 exit status
I searched google for hogweed but there is no such a package? How I can fix this problem?
When linking with libraries you remove the lib from their name and append it to -l
ie for example libcrypto library will be linked by passing option -lcrypto
in your case its is -lhogweed that is missing. That means libhogweed library is missing.
A simple Google search of 'libhogweed' shows that its a part of 'GNU Nettle cryptographic library'. So you can install this and fix your problem.
I think you need to install the Nettle cryptographic library. As you didn't post your OS, I can't give more details.
More information on Nettle and Hogweed: http://www.lysator.liu.se/~nisse/nettle/nettle.html#Linking
According to this message, you need to build Nettle after you install GMP. Try to rebuild Nettle and see if it gets built.

Resources