LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 11-28-2005, 01:41 AM   #1
mattengland
Member
 
Registered: Nov 2004
Location: Chicago, IL USA
Posts: 42

Rep: Reputation: 15
Simplify dynamic lib creation & transportability?


While creating .so files (aka shared objects aka dynamic libraries aka shared libraries) for a suite of appliaction software (with many different apps) on a CentOS4/RHEL4 platform, I've been reading up on .so-file creation:

http://www.tldp.org/HOWTO/Program-Li...libraries.html
http://wiki.linuxquestions.org/wiki/...ands_and_Files
http://www.mpi-sb.mpg.de/~hitoshi/ot...gcc-memo.shtml

While I can see power in the soname for versioning purposes, I wonder: why am I forced to use this .so.x.y.z naming and complexity? It's screwing things up big time when I got to copy libraries around for transport to other systems and/or to save the libraries in a CVS/Subversion repository (and checkout the lib files later). I'd rather just have one .so-file name, if I could, manage only one file, not mess with and ldconfig things or soft links, etc. Is there a way to do this? If not, is there a way to simplify this seemingly-hazy topic for the moment?

Additionally, can I force g++ to build an app that looks, at run time, *only* in the directories I specify for .so-file resolution? I ask as a security measure to keep crackers on my host systems from inserting rogue libraries in /usr/lib, etc.

Also: I haven't yet see --rpath or -Wl,rpath work for my g++ builds...but I still could be screwing something up.

Thanks for any help,
-Matt
 
Old 11-28-2005, 02:08 AM   #2
mattengland
Member
 
Registered: Nov 2004
Location: Chicago, IL USA
Posts: 42

Original Poster
Rep: Reputation: 15
I should also mention:

I want my .so files/libraries to be in directories of my choosing, and NOT the standard places (/usr/lib, /usr/local/lib, etc). I have a software/application suite that I wish to operate "autonomously," separate from any other installed libraries on the host system, for both reliability and security purposes. This way I feel I can better ensure that all the "embedded" libraries on the distributed systems behave as they should, just as they do on my test systems. I can also be protected from non-malicious sysadmins (and malicious users) from upgrading/changing libraries in standard places which break my software.

I have a /toplevel dir with /toplevel/lib, /toplevel/bin, etc...and I want all my .so files to be "transported" (different from "ported" because I'm currently only using RHEL4/CentOS4 and don't need to "port" across heterogenous systems...yet) to different /toplevel directory names/prefixes on different systems without creating much fuss...as well as being able to softlink a standard /toplevel-soft-link dir to the full /toplevel directory name so I can adhere to any hard-coded run-time .so search path if need be (which is good for lowering post-sales support stuff, too).

I really want to avoid relying on LD_LIBRARY_PATH.

Thanks again for any help. I hope my ramblings make sense. I can clarify some tomorrow after some sleep...hopefully.

-Matt
 
  


Reply



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
creation/handling of dynamic char[]s purefan Programming 8 03-29-2005 08:48 AM
Dynamic creation of Objects in C++ poeta_boy Programming 9 08-02-2004 01:58 PM
help - what env var for dynamic lib path? emanresu Linux - Newbie 3 05-31-2004 03:32 PM
Moving from dynamic lib (Windows) to linux simbo Linux - Newbie 1 02-25-2004 10:59 PM
can't load dynamic linker '/lib/ld.so qanopus Linux - General 4 01-06-2003 06:19 AM

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

All times are GMT -5. The time now is 07:49 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
Open Source Consulting | Domain Registration