Skip to main content
added 6 characters in body
Source Link
osgx
  • 95.3k
  • 58
  • 389
  • 531

Even better you perform partial linking on each library and them make an archive of the two resulting object files. That way it operates like shared libraries would

You do partial linking with

gcc -r --nostdlib" so either instead of making the intermediate archive or after reextracting it, runnostdlib 

so either instead of making the intermediate archive or after reextracting it, run

gcc -r --nostdlib $CFLAGS $OBJECTS_A -o $LIBNAME_A.o gcc -r --nostdlib $CFLAGS $OBJECTS_B -o $LIBNAME_B.o 

then

ar -cr $LIBNAME_JOINED.a $LIBNAME_A.o $LIBNAME_B.o 

Even better you perform partial linking on each library and them make an archive of the two resulting object files. That way it operates like shared libraries would

You do partial linking with

gcc -r --nostdlib" so either instead of making the intermediate archive or after reextracting it, run gcc -r --nostdlib $CFLAGS $OBJECTS_A -o $LIBNAME_A.o gcc -r --nostdlib $CFLAGS $OBJECTS_B -o $LIBNAME_B.o 

then

ar -cr $LIBNAME_JOINED.a $LIBNAME_A.o $LIBNAME_B.o 

Even better you perform partial linking on each library and them make an archive of the two resulting object files. That way it operates like shared libraries would

You do partial linking with

gcc -r --nostdlib 

so either instead of making the intermediate archive or after reextracting it, run

gcc -r --nostdlib $CFLAGS $OBJECTS_A -o $LIBNAME_A.o gcc -r --nostdlib $CFLAGS $OBJECTS_B -o $LIBNAME_B.o 

then

ar -cr $LIBNAME_JOINED.a $LIBNAME_A.o $LIBNAME_B.o 

Even better you perform partial linking on each library and them make an archive of the two resulting object files. That way it operates like shared libraries would

You do partial linking with "gcc -r --nostdlib" so either instead of making the intermediate archive or after reextracting it, run gcc -r --nostdlib $CFLAGS $OBJECTS_A -o $LIBNAME_A.o gcc -r --nostdlib $CFLAGS $OBJECTS_B -o $LIBNAME_B.o then ar -cr $LIBNAME_JOINED.a $LIBNAME_A.o $LIBNAME_B.o

gcc -r --nostdlib" so either instead of making the intermediate archive or after reextracting it, run gcc -r --nostdlib $CFLAGS $OBJECTS_A -o $LIBNAME_A.o gcc -r --nostdlib $CFLAGS $OBJECTS_B -o $LIBNAME_B.o 

then

ar -cr $LIBNAME_JOINED.a $LIBNAME_A.o $LIBNAME_B.o 

Even better you perform partial linking on each library and them make an archive of the two resulting object files. That way it operates like shared libraries would

You do partial linking with "gcc -r --nostdlib" so either instead of making the intermediate archive or after reextracting it, run gcc -r --nostdlib $CFLAGS $OBJECTS_A -o $LIBNAME_A.o gcc -r --nostdlib $CFLAGS $OBJECTS_B -o $LIBNAME_B.o then ar -cr $LIBNAME_JOINED.a $LIBNAME_A.o $LIBNAME_B.o

Even better you perform partial linking on each library and them make an archive of the two resulting object files. That way it operates like shared libraries would

You do partial linking with

gcc -r --nostdlib" so either instead of making the intermediate archive or after reextracting it, run gcc -r --nostdlib $CFLAGS $OBJECTS_A -o $LIBNAME_A.o gcc -r --nostdlib $CFLAGS $OBJECTS_B -o $LIBNAME_B.o 

then

ar -cr $LIBNAME_JOINED.a $LIBNAME_A.o $LIBNAME_B.o 
Source Link

Even better you perform partial linking on each library and them make an archive of the two resulting object files. That way it operates like shared libraries would

You do partial linking with "gcc -r --nostdlib" so either instead of making the intermediate archive or after reextracting it, run gcc -r --nostdlib $CFLAGS $OBJECTS_A -o $LIBNAME_A.o gcc -r --nostdlib $CFLAGS $OBJECTS_B -o $LIBNAME_B.o then ar -cr $LIBNAME_JOINED.a $LIBNAME_A.o $LIBNAME_B.o