LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-02-2017, 01:57 AM   #1
Borneq
Member
 
Registered: Aug 2014
Posts: 30

Rep: Reputation: Disabled
BUCK compilation required glibc


I have build with CMake and is OK, but I must build with Buck.
BUCK is configured to use Clang.
/usr/src/hbase/hbase-native-client/otherlibs/libzmq.a(ipc_listener.cpp.o): In function `zmq::ipc_listener_t::filter(int)':
ipc_listener.cpp.text+0xdc0): warning: Using 'getgrgid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
ipc_listener.cpp.text+0xda3): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
 
Old 10-02-2017, 03:43 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,278

Rep: Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994
And what is your question?
 
Old 10-02-2017, 05:07 AM   #3
Borneq
Member
 
Registered: Aug 2014
Posts: 30

Original Poster
Rep: Reputation: Disabled
How compile it?
 
Old 10-02-2017, 05:23 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,278

Rep: Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994
These are just warnings, so they don't prevent you from compiling your program. Nonetheless, statically linking libc is very unusual in Unix/Linux. Why would you do that?
 
Old 10-02-2017, 06:31 AM   #5
Borneq
Member
 
Registered: Aug 2014
Posts: 30

Original Poster
Rep: Reputation: Disabled
Sorry, I put no errors but warnings.
Erorr is
/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/src/hbase/hbase-native-client/otherlibs/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
clang: error: linker command failed with exit code 1 (use -v to see invocation)

libc.a is system library, how compile it with -fPIE, where are sources?
 
Old 10-02-2017, 06:56 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,679

Rep: Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855Reputation: 2855
you need to recompile your sources with -fPIE and relink with -pie. You do not need to rebuild libc.a, just relink it. But I think you need to give more information about this situation (if this won't help)
 
2 members found this post helpful.
Old 10-02-2017, 10:02 AM   #7
Borneq
Member
 
Registered: Aug 2014
Posts: 30

Original Poster
Rep: Reputation: Disabled
Thanks! linker_flags=['-pie'] helps a lot.
Is only next error:
/usr/bin/ld: /usr/src/hbase/hbase-native-client/otherlibs/libzmq.a(zmq.cpp.o): relocation R_X86_64_32 against `_ZSt7nothrow' can not be used when making a shared object; recompile with -fPIC
/usr/src/hbase/hbase-native-client/otherlibs/libzmq.a: error adding symbols: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I must not compile ZMQ with PIC because I want link ZMQ static?
I have
prebuilt_cxx_library(
name="zmq",
lib_dir='../otherlibs'
)

where in otherlibs is 1.8 MB of libzmq.a.
I changed to
prebuilt_cxx_library(
name="zmq",
static_lib='otherlibs/libzmq.a'
)

but still error:
/usr/bin/ld: /usr/src/hbase/hbase-native-client/block-exe/otherlibs/libzmq.a(zmq.cpp.o): relocation R_X86_64_32 against `_ZSt7nothrow' can not be used when making a shared object; recompile with -fPIC
/usr/src/hbase/hbase-native-client/block-exe/otherlibs/libzmq.a: error adding symbols: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
 
Old 10-02-2017, 11:21 PM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,278

Rep: Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994Reputation: 994
You seem to try and compile something that has a built-in libc... It does sound scary. (Also there is C++ in it which makes it scarier.)

Nonetheless, if it asks for relocatable code, then do use -fPIC flag
 
Old 10-03-2017, 11:12 AM   #9
Borneq
Member
 
Registered: Aug 2014
Posts: 30

Original Poster
Rep: Reputation: Disabled
Is because I compiled with -pie
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
glibc compilation error Eagle Eye Linux From Scratch 1 11-22-2013 02:07 PM
glibc required for all browsers? phantom_cyph Linux - Software 5 11-14-2008 06:47 PM
glibc compilation error newcomer4 Linux - Newbie 1 02-03-2006 02:53 PM
glibc compilation error newcomer4 Linux From Scratch 1 02-03-2006 05:02 AM
glibc package required Xing Linux - Software 2 09-27-2003 12:50 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration