Make a static library from source using build scripts from the SDK

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I'm trying to compile a project as a static archive (.a) to supply it as a component for the SDK. The static library should expose only certain symbols, so an additional preparation is necessary.

Is there any way to do it natively by using standard build scripts from the SDK? I tried to analyse build scripts in <SDK>/tools/makefiles but didn't find any graceful solution.

Now as a temporary solution I use a workaround:

  1. compile the project as always, but without application_start() symbol and just ignore link error.
  2. ld -r $(find build/proj.wiced-platform-os/Modules/apps/proj/ -name "*.o") -o Lib_proj.o
  3. objcopy Lib_proj.o --localize-hidden
  4. ar rcs Lib_proj.a Lib_prj.o
0 Likes
1 Solution
Anonymous
Not applicable

Hello Andrey,

We have done the same implementation in our SDK. If you look into th Apollo demo it will call the the .mk file which is in libraries folder of the SDK which intern create the object file and linked. You can implement in the same way. Please refer to this and if you find any issues please let me know.

View solution in original post

2 Replies
DaBa_2244756
Level 5
Level 5
25 likes received 10 likes received 10 likes given

Maybe try do it like wiced component.

Darius

Anonymous
Not applicable

Hello Andrey,

We have done the same implementation in our SDK. If you look into th Apollo demo it will call the the .mk file which is in libraries folder of the SDK which intern create the object file and linked. You can implement in the same way. Please refer to this and if you find any issues please let me know.