Ask Your Question
1

fedora20,static link, cannot find -lgcc_s

asked 2014-01-25 21:11:59 -0600

flnx gravatar image

updated 2014-09-30 09:19:09 -0600

mether gravatar image

when I link a program statically, I got the error:

g++ -Wl,-z,relro -Wl,-z,now  -o ptsminer  obj/cpuid.o obj/sha512_avx.o obj/sha512_sse4.o obj/sha512_avx2.o obj/sha512.o obj/sph_sha2.o obj/sph_sha2big.o obj/main_poolminer.o  -Wl,-Bstatic -l boost_system -l boost_filesystem -l boost_program_options -l boost_thread -Wl,-Bstatic -l z -l dl -l pthread
/usr/bin/ld: cannot find -lgcc_s

I figured out that libgcc_s.a should belongs to libgcc, but it seems there's no static version for libgcc, Am I doing sth wrong?

edit retag flag offensive close merge delete

Comments

1
marcindulak gravatar imagemarcindulak ( 2014-01-26 10:39:59 -0600 )edit

I used "yum provides */libgcc_s.a" and "repoquery --whatprovides /usr/lib64/libgcc_s.a" to find the lib, but failed, and I already installed glibc-static. I wonder if libgcc_s.a exist in fedora20?

flnx gravatar imageflnx ( 2014-01-26 22:48:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-02-01 09:47:59 -0600

marcindulak gravatar image

So you are building https://github.com/thbaumbach/ptsminer? The linking problem you report is due to an incorrect makefile.unix and not Fedora. Try this (check http://stackoverflow.com/questions/13187499/static-linking-glibc for background):

cd /tmp
su -c "yum -y install git"
git clone https://github.com/thbaumbach/ptsminer
su -c "yum -y install gcc-c++"
su -c "yum -y install yasm"
su -c "yum -y install glibc-static"
su -c "yum -y install libstdc++-static"
su -c "yum -y install boost-static"
su -c "yum -y install zlib-static"
cd ptsminer/src
sed -i 's#boost_thread-mt#boost_thread#' makefile.unix  # apply this on Fedora >= 20
CXX='g++ -static' STATIC=all make -f makefile.unix
edit flag offensive delete link more

Comments

I was compiling dga's cpu pts miner, but your way fixed the problem as well! thank you

flnx gravatar imageflnx ( 2014-02-05 03:14:59 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-01-25 21:11:59 -0600

Seen: 2,379 times

Last updated: Feb 01 '14