[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] libjpeg



Miro Kropacek a écrit :
Doesn't that run into the mintlib problem though ?
Nope. When you make library, you link only object files into one big
file (i.e. *.o => my_lib.a). When you make final executable, you link
your application object files (*.o), libraries (my_lib.a) and system
libraries (libc.a, libgcc.a) into one big file. So you see, mintlib
problem is only with executable files.

Totally true.

But please, do not use the verb "link" for creating a static library, because one might understand the linker tool is involved, and it is not the case.

To make a static library, the "ar" tool must be used to aggregate several .o files into a single .a file. These .a files are more or less similar to an uncompressed zip archive. As a result, the original .o files can be extracted from a .a file for test purposes.

To make an executable, the "ld" (linker) tool must be used. It merges the .o files passed on the command line and the required ones found in the .a files. It resolves the undefined references between .o files. The contents of the .o files transformed for building the final executable, so it is not possible to "extract" the .o files from an executable.

As a result, the only really nonstandard stuff in the binutils for MiNT is the linker, with the ability to create .PRG files. Everything else (as, ar, format of .o files...) is standard. That's why it is not so difficult to port the binutils patches from one version to another.

--
Vincent Rivière