LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 06-20-2017, 06:42 AM   #1
ohijames
LQ Newbie
 
Registered: Jun 2010
Posts: 17

Rep: Reputation: 0
Compile source without dependencies


I downloaded and compiled Sudo from sudo.ws
however when I install my compiled version of Sudo on a Solaris machine that doesn't have gcc I get the following errors.

libintl.so.8 => (file not found)
libiconv.so.2 => (file not found)


bash-2.05$ sudo -V
ld.so.1: sudo: fatal: libintl.so.8: open failed: No such file or directory
bash-2.05$ ldd /opt/quest/bin/sudo
/usr/lib/secure/s9_preload.so.1
libproject.so.1 => /usr/lib/libproject.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libsudo_util.so.0 => /opt/quest/libexec/sudo/libsudo_util.so.0
libintl.so.8 => (file not found)
libiconv.so.2 => (file not found)
libsec.so.1 => /usr/lib/libsec.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
librt.so.1 => /usr/lib/librt.so.1
libsecdb.so.1 => /usr/lib/libsecdb.so.1
libproc.so.1 => /usr/lib/libproc.so.1
libpool.so.1 => /usr/lib/libpool.so.1
libmp.so.2 => /usr/lib/libmp.so.2
libintl.so.8 => (file not found)
libiconv.so.2 => (file not found)
libaio.so.1 => /usr/lib/libaio.so.1
libmd5.so.1 => /usr/lib/libmd5.so.1
libcmd.so.1 => /usr/lib/libcmd.so.1
librtld_db.so.1 => /usr/lib/librtld_db.so.1
libelf.so.1 => /usr/lib/libelf.so.1
libxml2.so.2 => /usr/lib/libxml2.so.2
libpthread.so.1 => /usr/lib/libpthread.so.1
libz.so.1 => /usr/lib/libz.so.1
libm.so.1 => /usr/lib/libm.so.1
/usr/platform/sun4v/lib/libc_psr.so.1
libthread.so.1 => /usr/lib/libthread.so.1

I looked into the dependencies and I don't need them for what I want to achieve however I need to use the compiled version for added functionality

If I download the and install already compiled version I don't see those missing dependencies like below

# ldd /usr/bin/sudo
/usr/lib/secure/s9_preload.so.1
libproject.so.1 => /usr/lib/libproject.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libsudo_util.so.0 => /usr/local/libexec/sudo/libsudo_util.so.0
libdl.so.1 => /usr/lib/libdl.so.1
librt.so.1 => /usr/lib/librt.so.1
libc.so.1 => /usr/lib/libc.so.1
libsecdb.so.1 => /usr/lib/libsecdb.so.1
libproc.so.1 => /usr/lib/libproc.so.1
libpool.so.1 => /usr/lib/libpool.so.1
libmp.so.2 => /usr/lib/libmp.so.2
libaio.so.1 => /usr/lib/libaio.so.1
libmd5.so.1 => /usr/lib/libmd5.so.1
libcmd.so.1 => /usr/lib/libcmd.so.1
librtld_db.so.1 => /usr/lib/librtld_db.so.1
libelf.so.1 => /usr/lib/libelf.so.1
libxml2.so.2 => /usr/lib/libxml2.so.2
libpthread.so.1 => /usr/lib/libpthread.so.1
libz.so.1 => /usr/lib/libz.so.1
libm.so.1 => /usr/lib/libm.so.1
/usr/platform/sun4v/lib/libc_psr.so.1
libthread.so.1 => /usr/lib/libthread.so.1
#

Is it possible to compile from source without those dependencies?
 
Old 06-20-2017, 06:47 AM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 2,857

Rep: Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226
Read through the documents in the sudo build file set, and there are build options. I no longer remember the exact syntax, but you can set STATIC and compile to a single larger executable that includes all of the dependencies rather than using the dynamic calls. It creates a larger package, and is arguably less secure since security updates to those packages will be ignored until your next build.
 
1 members found this post helpful.
Old 06-20-2017, 03:49 PM   #3
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 142Reputation: 142
.so files are dynamically linked, so they have to be present everytime you run the program.

Copy those library files into /usr/lib or /usr/local/lib or something. (Assuming these computers are all of the same architecture -- i.e. UltraSPARC or x86_64, etc.)

If you put it in /usr/local/lib (or anywhere else), make sure that directory is in your LD_LIBRARY_PATH environment variable.

Last edited by Laserbeak; 06-20-2017 at 03:57 PM.
 
Old 06-20-2017, 04:04 PM   #4
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by ohijames View Post
Is it possible to compile from source without those dependencies?
As noted by wpeckham, there should be a way to build it with all static libraries. But this is not recommended since you'll end up with a much larger binary and no bug fixes or improvements in upgraded libraries will be automatically included in your program.
 
Old 06-20-2017, 04:15 PM   #5
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 142Reputation: 142
Are you writing this for yourself or for widespread distribution?
 
Old 06-21-2017, 09:55 AM   #6
ohijames
LQ Newbie
 
Registered: Jun 2010
Posts: 17

Original Poster
Rep: Reputation: 0
Smile Thank you

Quote:
Originally Posted by wpeckham View Post
Read through the documents in the sudo build file set, and there are build options. I no longer remember the exact syntax, but you can set STATIC and compile to a single larger executable that includes all of the dependencies rather than using the dynamic calls. It creates a larger package, and is arguably less secure since security updates to those packages will be ignored until your next build.
Thank you for all the suggestions guys. Its all working

Last edited by ohijames; 06-21-2017 at 09:57 AM.
 
Old 06-21-2017, 12:24 PM   #7
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 2,857

Rep: Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226Reputation: 1226
Quote:
Originally Posted by ohijames View Post
Thank you for all the suggestions guys. Its all working
I suggest that you then leave a post with a short description of what worked, and mark this thread SOLVED.

It may help someone else working on the same issue one day.
 
Old 06-21-2017, 12:42 PM   #8
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 142Reputation: 142
Yes, I'd also like to know what your solution was.

Also, these are GNU items, so on Solaris 11.3, they probably should live in /usr/gnu, so if you needed to install them, they should probably go there, making sure the appropriate directories are in the appropriate environment PATHs.
 
  


Reply

Tags
gcc, solaris, source code, sudo


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
How to learn to compile from source with dependencies and libraries needed? askjoe Linux - Newbie 8 10-05-2012 03:02 PM
Compile from source as limited user - how do I tell configure where dependencies are? versaulis Linux - Software 9 09-15-2009 10:32 AM
How do I compile against different dependencies jabeavers Programming 6 08-29-2007 04:24 PM
Missing dependencies, can't compile BiPolar Linux - Software 3 08-17-2005 10:31 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 09:48 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