This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: using ar to make a shared lib


well because i'm redoing my companies build system and in our lib dir, there are like 30 subdirs. so i just made one file called "libtargets" that has a bunch of common targets and rules for our libs. so for most of the makefiles in that libs dir, its just a matter of setting a few vars and then including the "libtargets". as it is, most of our lib makefiles just compile a bunch of .o files and then add them to some .a file somewhere. i just wanted to see if i could get the shared libs to use "libtargets" also instead of having to write a makefile by hand.

thanks.

On Feb 17, 2004, at 12:50 PM, Daniel Jacobowitz wrote:

On Tue, Feb 17, 2004 at 12:45:54PM -0600, Christopher Bottaro wrote:
hello,
is it possible to make a shared lib (.so file) with ar? i compile all
my sources with gcc and the -fPIC option, but instead of linking them
together with gcc and the -shared linker flag, i just wanna use ar...is
this possible?


example:
gcc -c s1.c -fPIC
gcc -c s2.c -fPIC
gcc -c s3.c -fPIC
ar crv s.so s1.o s2.o s3.o

thanks for the help.

No. Why don't you try to explain why you don't want to use gcc -shared?

--
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]