Hi,
in S32DS 2017.R1, I create a S32DS library project, and am going to create a big lib file, which will put other sub lib files together.
for instance, create a libsdk.a library, this library will contain a.c, b.c, and lib1.a, lib2.a, lib3.a.
in the archiver settings, I didn't firgure out how to add the additional library files.
Solved! Go to Solution.
Hi, Jiri
finally, I figured out the build script to create huge lib. I added it in build-step commands, and it works.
thanks for your help.
mkdir -pv sdk_own/lib && cd sdk_own/lib && rm -f *.o && for i in ${ProjDirPath}/sdk_own/lib/libfmc_*.a; do powerpc-eabivle-ar -xv $$i; done
powerpc-eabivle-ar -rcsv ${BuildArtifactFilePrefix}${BuildArtifactFileName} sdk_own/lib/*.o && cp -fv ${BuildArtifactFilePrefix}${BuildArtifactFileName} ${ProjDirPath}/../common/sdk/lib/
Hi,
you can make thin archive by:
ar -rcT libmyhugelib.a lib1.a lib2.a lib3.a
Second option (in my opinion more clean) is to extract all .o files from existing archive and re-archive extracted *.o files into one .a. Something like this:
ar -x lib1.a
ar -x lib2.a
ar -x lib3.a
ar -c libmyhugelib.a *.o
Jiri
Hi, Jiri
finally, I figured out the build script to create huge lib. I added it in build-step commands, and it works.
thanks for your help.
mkdir -pv sdk_own/lib && cd sdk_own/lib && rm -f *.o && for i in ${ProjDirPath}/sdk_own/lib/libfmc_*.a; do powerpc-eabivle-ar -xv $$i; done
powerpc-eabivle-ar -rcsv ${BuildArtifactFilePrefix}${BuildArtifactFileName} sdk_own/lib/*.o && cp -fv ${BuildArtifactFilePrefix}${BuildArtifactFileName} ${ProjDirPath}/../common/sdk/lib/
Hi, jiri
thanks, so I have to add the "ar -rcs" command in post-build steps ?
this command edit is not good to add many command together. any other options ?
Hi, Jiri
I use "powerpc-eabivle-ar -rcsv" to archive our sub libraries together, but seem the archtechture property missed.
for example, I checked the libfmc_bsp_os.a, it should support "ppc", but after archived to the huge lib, the "ppc" disappeared.
any wrong options I specified ?