SPRUIG8J January 2018 – March 2024
Consider these object file libraries that all have the same members, but are built with different build options:
Object File Library Name | Build Options |
---|---|
mylib_7100_le.lib | --silicon_version=7100 |
mylib_7100_be.lib | --silicon_version=7100 --big_endian |
Using the library information archiver, you can create an index library called mylib.lib from the above libraries:
libinfo7x --output mylib.lib mylib_7100_be.lib mylib_7100_le.lib
You can now specify mylib.lib as a library for the linker of an application. The linker uses the index library to choose the appropriate version of the library to use. If the --issue_remarks option is specified before the --run_linker option, the linker reports which library was chosen.
cl7x -mv7100 --endian=little --issue_remarks main.c -z -l lnk.cmd ./mylib.lib
<Linking>
remark: linking in "mylib_7100_le.lib" in place of "mylib.lib"
cl7x -mv7100 --endian=big --issue_remarks main.c -z -l lnk.cmd ./mylib.lib
<Linking>
remark: linking in "mylib_7100_be.lib" in place of "mylib.lib"