Error when building Legato on a Raspberry Pi

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

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.

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

1 Like

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

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

/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?

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

1 Like

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?