# Error when building Legato on a Raspberry Pi

**URL:** https://forum.legato.io/t/error-when-building-legato-on-a-raspberry-pi/6201
**Category:** Legato Application Framework
**Created:** [May 13, 2022, 5:43am UTC](https://forum.legato.io/t/error-when-building-legato-on-a-raspberry-pi/6201 "2022-05-13T05:43:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![uchida.s](https://avatars.discourse-cdn.com/v4/letter/u/b9bd4f/32.png) [@uchida.s](https://forum.legato.io/u/uchida.s)
#### Post date: [May 13, 2022, 5:43am UTC](https://forum.legato.io/t/error-when-building-legato-on-a-raspberry-pi/6201/1 "2022-05-13T05:43:06Z")

</div>

I would like to install Legato on a Raspberry Pi 3 Model B.  
To install Legato, I downloaded and build Legato files according to a website below:  
[https://docs.legato.io/latest/raspbianMain.html](https://docs.legato.io/latest/raspbianMain.html)

I built the files on Ubuntu 18.04 LTS.

However, after I executed `make raspi`, I encountered an error below (actual messages contained Japanese, but I translated Japanese to English):  
`/home/common/legato_specify_products_wp76xx_releases_Release16.xml/legato/framework/liblegato/linux/eventLoop.c:163:27: error: 'EPOLLWAKEUP' undeclared (first use in this function).`

Alternatively, instead of executing `export RASPI_TOOLCHAIN_DIR=~/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/`, I executed `export RASPI_TOOLCHAIN_DIR=~/rpi/tools/arm-bcm2708/arm-rpi4.9.3-linux-gnueabihf/bin`.  
However, I encountered another error below:  
`/home/common/legato_specify_products_wp76xx_releases_Release16.xml/legato/framework/daemons/linux/common/ima.c:24:26: fatal error: openssl/x509.h: No such file or directory`

I am afraid that I missed some settings, but I can’t find them.

Would you tell me what I should check?

Please let me know if I can give you any other information.

---

<div class="post-metadata">

### Author: ![gregnietsky](https://avatars.discourse-cdn.com/v4/letter/g/7feea3/32.png) [@gregnietsky](https://forum.legato.io/u/gregnietsky)
#### Post date: [May 13, 2022, 10:29am UTC](https://forum.legato.io/t/error-when-building-legato-on-a-raspberry-pi/6201/2 "2022-05-13T10:29:36Z")

</div>

you need openssl available to the toolchain first build openssl and install it in the toolchain.

---

<div class="post-metadata">

### Author: ![uchida.s](https://avatars.discourse-cdn.com/v4/letter/u/b9bd4f/32.png) [@uchida.s](https://forum.legato.io/u/uchida.s)
#### Post date: [May 16, 2022, 12:01am UTC](https://forum.legato.io/t/error-when-building-legato-on-a-raspberry-pi/6201/3 "2022-05-16T00:01:02Z")

</div>

I built openSSL and installed it in the Raspberry Pi toolchain. However, I have got an error:

```auto
make[2]: Entering directory '/home/common/legato_specify_products_wp76xx_releases_Release16.xml/legato'
  CMAKE /home/common/legato_specify_products_wp76xx_releases_Release16.xml/legato/build/raspi/framework/lib/libjansson.so
Makefile.targetTools:107: recipe for target '/home/common/legato_specify_products_wp76xx_releases_Release16.xml/legato/build/raspi/framework/lib/libjansson.so' failed
make[2]: Leaving directory '/home/common/legato_specify_products_wp76xx_releases_Release16.xml/legato'
Makefile.framework:249: recipe for target 'targetTools' failed
make[1]: Leaving directory '/home/common/legato_specify_products_wp76xx_releases_Release16.xml/legato'
Makefile:535: recipe for target 'framework' failed

```

To find the cause of the error, I checked the file `.../legato/build/raspi/framework/libjansson/CMakeFiles`; which said that

```auto
/home/common/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
/home/common/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status

```

I suppose I missed some settings, but I don’t know what I set.

What should I check or set?

---

<div class="post-metadata">

### Author: ![gregnietsky](https://avatars.discourse-cdn.com/v4/letter/g/7feea3/32.png) [@gregnietsky](https://forum.legato.io/u/gregnietsky)
#### Post date: [May 16, 2022, 12:31pm UTC](https://forum.legato.io/t/error-when-building-legato-on-a-raspberry-pi/6201/4 "2022-05-16T12:31:32Z")

</div>

crt\* are from glibc and should be in the pi toolchain the linker is looking for them so you may need to adjust your linker paths. been a while since i did this hope it helps

---

<div class="post-metadata">

### Author: ![uchida.s](https://avatars.discourse-cdn.com/v4/letter/u/b9bd4f/32.png) [@uchida.s](https://forum.legato.io/u/uchida.s)
#### Post date: [May 17, 2022, 12:35am UTC](https://forum.legato.io/t/error-when-building-legato-on-a-raspberry-pi/6201/5 "2022-05-17T00:35:41Z")

</div>

gregnietsky, thank you for your advice.  
I tried to adjust my linker paths, but I have trouble adjusting them.

I found crt\* in `~/rpi/tools/arm-bcm2708/arm-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/lib/`.  
However, I can’t find how to set the path; I don’t know what settings affect the build settings of libjansson (which caused errors in my environment when being built).

What documents should I check to adjust the paths?  
Or, how do I adjust them?
