LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 07-20-2005, 09:19 AM   #1
DavePrince
LQ Newbie
 
Registered: Jul 2005
Location: Cambridgeshire, UK
Distribution: SuSE
Posts: 1

Rep: Reputation: 0
Commandline legth problem linking a shared library


I'm trying to get some development scripts, currently running on Solaris, working on Linux (RH9 to be specific), and I can't work out how to build my main shared library. The basic command is

% g++ -shared -o lib${lib}.so ${objList}
/usr/bin/g++: Argument list too long.

but because of the nature of the beast $objList is thousands of objects and the variable ends up being over 200k long [I've heard 40k is the limit on linux.]

I've worked round this quite happily using xargs when building the static archive libraries, but I can't work out how to either

A) Increase the commandline length limit; or
B) incrementally link portions of the .so

I've tried splitting $objList up (E.g. alphabetically into 26 lists) and I can make 26 separate .sos but I when I try to link them into one big so I get one tiny .so indirectly referencing all 26 intermediate ones...

% g++ -shared -o lib${lib}.so lib[a-z]$lib.so

...which isn't really what I want.

Does anybody know any easy way to increase this limit, or how to actually get g++/ld to link shared objects incrementally - not sure what the terminology is here - passing the input shared objects by value rather than by reference?

Last edited by DavePrince; 07-25-2005 at 06:18 AM.
 
  


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
Linking Programs to the commandline BorgKiller Linux - Software 2 04-05-2005 10:10 PM
any links on linking, loading shared libraries, shared objects. etc? ananthbv Programming 0 02-03-2005 08:47 AM
Still library linking problem The_Nerd Programming 19 05-20-2004 05:08 PM
Library linking problem The_Nerd Programming 10 04-27-2004 12:07 AM
Linking a platform independent shared library rozeboom Programming 3 11-18-2003 03:10 PM


All times are GMT -5. The time now is 04:02 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration