# Legacy Firmware

**URL:** <https://forum.legato.io/t/legacy-firmware/5120>\
**Category:** Legato Application Framework\
**Created:** [March 30, 2020, 8:13pm UTC](https://forum.legato.io/t/legacy-firmware/5120 "2020-03-30T20:13:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisc](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@chrisc](https://forum.legato.io/u/chrisc)\
**Post date:** [March 30, 2020, 8:13pm UTC](https://forum.legato.io/t/legacy-firmware/5120/1 "2020-03-30T20:13:58Z")

</div>

Hi All,

I have a large amount of legacy firmware that I’d like to bring into my Legato application. What is the appropriate method to accomplish this? My current understanding is that I would just compile that code as a static library, and pull it into the required components using something like this:

```
cxxflags:
{
    -I ${MY_SYSTEM_DIR}/submodule/include
}

lddflags:
{
    -Wl,--whole-archive -lmylib -Wl,--no-whole-archive
}

```

But I would also like to have the project recompile the library if I make any changes to it. Also, as a side note, it’s currently set up as a git submodule, so it needs to be in it’s own directory.

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![raf](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@raf](https://forum.legato.io/u/raf)\
**Post date:** [March 30, 2020, 11:33pm UTC](https://forum.legato.io/t/legacy-firmware/5120/2 "2020-03-30T23:33:32Z")

</div>

Hi @chrisc,

I’d recommend creating a Legato Component and using [externalBuild](https://github.com/legatoproject/legato-af/tree/master/components/3rdParty) to cross-compile the static library.

Some examples of this can be seen in the Legato GitHub repo [here](https://github.com/legatoproject/legato-af/tree/master/components/3rdParty).

Your library will be recompiled when you (re)build an App utilising the Component.

Cheers,  
Raf

---

<div class="post-metadata">

**Author:** ![chrisc](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@chrisc](https://forum.legato.io/u/chrisc)\
**Post date:** [April 9, 2020, 12:33pm UTC](https://forum.legato.io/t/legacy-firmware/5120/3 "2020-04-09T12:33:48Z")

</div>

Hi @raf,

Thanks for the info. That definitely put me in the right direction. Still need more work on my part, but it definitely seems like the way to go.

Chris
