# CROSS Compiler error

**URL:** <https://mangoh.discourse.group/t/cross-compiler-error/2801>\
**Category:** mangOH Red\
**Created:** [July 22, 2019, 1:59pm UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801 "2019-07-22T13:59:16Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuxedo95](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tuxedo95](https://mangoh.discourse.group/u/tuxedo95)\
**Post date:** [July 22, 2019, 1:59pm UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/1 "2019-07-22T13:59:16Z")

</div>

Hello,

I’m setting up my pc following these instructions : [link](http://mangoh.io/uploaded-documents/Reference/mangOH%20Red/Discover/Getting%20Started/mangOH%20Red%20GSG%20-%20Linux%20R5/#t=41112261_mangOH_Red_GSG_-_HTML5%2F41112261_PrepComp%2F41112261_PrepComp.htm%23XREF_22697_Prepare_your)  
And at the end of the step 7 when I execute the command:

> ARCH=arm CROSS\_COMPILE=arm-poky-linux-gnueabi- make scripts

The terminal returns the following error:

> CC scripts/mod/empty.o  
> arm-poky-linux-gnueabi-gcc: No such file or directory  
> Is your PATH set correctly?  
> scripts/Makefile.build:257: recipe for target ‘scripts/mod/empty.o’ failed  
> make[2]: \*\*\* [scripts/mod/empty.o] Error 2  
> scripts/Makefile.build:402: recipe for target ‘scripts/mod’ failed  
> make[1]: \*\*\* [scripts/mod] Error 2  
> Makefile:560: recipe for target ‘scripts’ failed  
> make: \*\*\* [scripts] Error 2

After several researches I did not find any solutions and I created this topic in the hope that you can help me out.

I have a mangOH Red WP7702 and I set my PATH like this :  
export PATH=$PATH:/opt/swi/y22-ext-wp77XX/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi

Thank you.

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [July 22, 2019, 3:09pm UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/2 "2019-07-22T15:09:54Z")

</div>

The `make scripts` step is no longer required with current toolchains.

---

<div class="post-metadata">

**Author:** ![tuxedo95](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tuxedo95](https://mangoh.discourse.group/u/tuxedo95)\
**Post date:** [July 22, 2019, 3:56pm UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/3 "2019-07-22T15:56:32Z")

</div>

Thank you for your prompt answer, so I keep moving on and when I do in the mangOH directory :

> make red\_wp77xx

The terminal returns this :

> echo “Not building LEGATO due to $LEGATO == 0”  
> Not building LEGATO due to $LEGATO == 0  
> # NOTE: When using leaf, these TOOLCHAIN\_X variables don’t need to be passed to mksys.  
> TOOLCHAIN\_DIR=/opt/swi/y22-ext-wp77xx/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi   
> TOOLCHAIN\_PREFIX=arm-poky-linux-gnueabi-   
> mksys -t wp77xx --object-dir=build/red\_wp77xx --output-dir=build/update\_files red.sdef  
> \*\* Warning: Ignoring empty app specification  
> \*\* Warning: Ignoring empty app specification  
> \*\* Warning: Ignoring empty app specification  
> \*\* ERROR:  
> /home/insa/mangOH/apps/BatteryService/batteryUtils/Component.cdef:3:13: error: Unexpected subsection name ‘headerDir’ in ‘provides’ section.  
> Makefile:109: recipe for target ‘red\_wp77xx’ failed  
> make: \*\*\* [red\_wp77xx] Error 1

Any ideas for this ?

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [July 22, 2019, 4:20pm UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/4 "2019-07-22T16:20:25Z")

</div>

`provides/headerDir` is a feature that is only supported by relatively recent versions of Legato. Which legato version are you building against?

---

<div class="post-metadata">

**Author:** ![tuxedo95](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tuxedo95](https://mangoh.discourse.group/u/tuxedo95)\
**Post date:** [July 22, 2019, 6:06pm UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/5 "2019-07-22T18:06:45Z")

</div>

I am using legato 18.09 the latest one for wp77xx

---

<div class="post-metadata">

**Author:** ![tuxedo95](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tuxedo95](https://mangoh.discourse.group/u/tuxedo95)\
**Post date:** [July 23, 2019, 8:37am UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/6 "2019-07-23T08:37:36Z")

</div>

So I decided to uninstall et reinstall legato 18.09.0 with the command :

> sudo repo init -u [GitHub - legatoproject/manifest: repo manifests for Legato](https://github.com/legatoproject/manifest) -m legato/releases/18.09.0/legato.xml

Remark : as **git** ://github.com/legatoproject/manifest -m legato/releases/18.09.0/legato.xml with git prefix doesn’t work on my machine I replaced it by https prefix.

And I noticed that there is a line that triggers me, here is the whole terminal return and the line is highlighted :

> Get [https://gerrit.googlesource.com/git-repo/clone.bundle](https://gerrit.googlesource.com/git-repo/clone.bundle)  
> Get [git-repo - Git at Google](https://gerrit.googlesource.com/git-repo)  
> remote: Finding sources: 100% (61/61)  
> remote: Total 61 (delta 14), reused 61 (delta 14)  
> Dépaquetage des objets: 100% (61/61), fait.  
> Depuis [git-repo - Git at Google](https://gerrit.googlesource.com/git-repo)  
> 0c0e934…745be2e master → origin/master
> 
> … A new repo command ( 1.25) is available.  
> … You should upgrade soon:
> 
> ```
> cp /home/insa/legato_framework/.repo/repo/repo /usr/bin/repo
> 
> ```
> 
> Get [GitHub - legatoproject/manifest: repo manifests for Legato](https://github.com/legatoproject/manifest)  
> % Total % Received % Xferd Average Speed Time Time Time Current  
> Dload Upload Total Spent Left Speed  
> 0 0 0 0 0 0 0 0 --:–:-- --:-- 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0  
> **curl: (22) The requested URL returned error: 404 Not Found**  
> Server does not provide clone.bundle; ignoring.  
> remote: Enumerating objects: 10, done.  
> remote: Counting objects: 100% (10/10), done.  
> remote: Compressing objects: 100% (8/8), done.  
> remote: Total 824 (delta 3), reused 7 (delta 2), pack-reused 814  
> Réception d’objets: 100% (824/824), 104.42 KiB | 379.00 KiB/s, fait.  
> Résolution des deltas: 100% (381/381), fait.  
> Depuis [GitHub - legatoproject/manifest: repo manifests for Legato](https://github.com/legatoproject/manifest)
> 
> - [nouvelle branche] master → origin/master
> 
> Your identity is: tuxedo \*\*\*\*\*\*\*@myEmail.com  
> If you want to change this, please re-run ‘repo init’ with --config-name
> 
> repo has been initialized in /home/insa/legato\_framework

So actually I think this error might cause some packages or files to be missing.  
And if I continue with **repo sync** command this error occurs several times during the execution.  
So what do you think about it ?

---

<div class="post-metadata">

**Author:** ![tuxedo95](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tuxedo95](https://mangoh.discourse.group/u/tuxedo95)\
**Post date:** [July 23, 2019, 11:05am UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/7 "2019-07-23T11:05:44Z")

</div>

So, I have tried to download manually legato [legato-18.08.0.tar.bz2] from [link](https://docs.legato.io/latest/aboutReleaseInfo.html) (the version 18.09.0 is missing) and extract it in ~/legato\_framework/legato and of course I have cleaned the folder before.  
then I do **make wp77xx** , the execution ends up with an error :  
**/bin/sh: 1: /opt/swi/y22-ext-wp77xx/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc: not found**

so I decide to check the toolchain that I’ve installed previously. I do :

> source /opt/swi/y22-ext-wp77xx/environment-setup-armv7a-neon-poky-linux-gnueabi

then I try to execute arm-poky-linux-gnueabi-gcc compiler to compile a hello-world.c file

> arm-poky-linux-gnueabi-gcc -o hello-world hello-world.c

The terminal returns:

> bash: arm-poky-linux-gnueabi-gcc : command not found

I’ve installed the packages : gcc-arm-linux-gnueabi and gcc-arm-linux-gnueabihf as suggested by my researches on google but nothing have changed

So I have found many errors and maybe they are linked to each other.

Hope you can clarify this more

---

<div class="post-metadata">

**Author:** ![tuxedo95](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tuxedo95](https://mangoh.discourse.group/u/tuxedo95)\
**Post date:** [July 25, 2019, 9:31am UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/8 "2019-07-25T09:31:26Z")

</div>

So after several attempts, the issue is not solved yet but I succeeded into compiling legato tools by using this command :  
**repo init -u [GitHub - legatoproject/manifest: repo manifests for Legato](https://github.com/legatoproject/manifest)**  
(I think by not specifying the version of legato it will download the latest one)  
After that I built legato with make wp77xx (my version of magnOH)  
For the next step, I did : **make red\_wp77xx** in the my mangOH directory but the following error popped up :

> echo “Not building LEGATO due to $LEGATO == 0”  
> Not building LEGATO due to $LEGATO == 0
> 
> # NOTE: When using leaf, these TOOLCHAIN\_X variables don’t need to be passed to mksys.
> 
> TOOLCHAIN\_DIR=/opt/swi/SWI9X06Y\_02.22.12.00/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi   
> TOOLCHAIN\_PREFIX=arm-poky-linux-gnueabi-   
> mksys -t wp77xx --object-dir=build/red\_wp77xx --output-dir=build/update\_files red.sdef  
> \*\* ERROR:  
> /home/insa/mangOH/apps/RedSensorToCloud/redSensorToCloud.adef:30:4: error: Binding to non-existent server app ‘avcService’.  
> Makefile:109: recipe for target ‘red\_wp77xx’ failed  
> make: \*\*\* [red\_wp77xx] Error 1

the error still persists even after I followed your suggestions : [Make red\_wp85, return ERROR - #9 by Alex](https://mangoh.discourse.group/t/make-red-wp85-return-error/1175/9)  
Hope you can bring me an anwser

---

<div class="post-metadata">

**Author:** ![gj.jhang](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gj.jhang](https://mangoh.discourse.group/u/gj.jhang)\
**Post date:** [July 30, 2019, 1:57am UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/9 "2019-07-30T01:57:54Z")

</div>

Hi Tutxdo95,

I think you can try this export again  
`export PATH=/opt/swi/y22-ext-wp77XX/sysroots/x86_64-pokysdk-linux/usr/bin/:$PATH`

GJ 2019/07/30

---

<div class="post-metadata">

**Author:** ![tuxedo95](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tuxedo95](https://mangoh.discourse.group/u/tuxedo95)\
**Post date:** [July 30, 2019, 8:01am UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/10 "2019-07-30T08:01:41Z")

</div>

Thank you for your answer, I’ve tried to edit the PATH like you said but the terminal returns : “not a valid identifier” .

Anyway, I have found an other solution, I’m using a Virtual Machine and I managed to do all the configurations and installations.

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![m2msupport](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@m2msupport](https://mangoh.discourse.group/u/m2msupport)\
**Post date:** [August 3, 2019, 2:11pm UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/11 "2019-08-03T14:11:09Z")

</div>

@tuxedo95 I’m getting the same error, can you let me know how you solved it?  
/home/insa/mangOH/apps/BatteryService/batteryUtils/Component.cdef:3:13: error: Unexpected subsection name ‘headerDir’ in ‘provides’ section.

---

<div class="post-metadata">

**Author:** ![tuxedo95](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tuxedo95](https://mangoh.discourse.group/u/tuxedo95)\
**Post date:** [August 4, 2019, 2:59pm UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/12 "2019-08-04T14:59:23Z")

</div>

For this error I’ve just installed an other version of legato and compiled it before compiling mangOH but on my PC several other errors appeared and as I said, I am using a virtual machine to be able to program apps and transfert them to my mangOH red.

---

<div class="post-metadata">

**Author:** ![m2msupport](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@m2msupport](https://mangoh.discourse.group/u/m2msupport)\
**Post date:** [August 4, 2019, 5:17pm UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/13 "2019-08-04T17:17:45Z")

</div>

@tuxedo95 Thanks for your reply. I’m using a virtual machine as well per the instructions in this link - [https://mangoh.io/setting-up-vm](https://mangoh.io/setting-up-vm)

What VM image did you use?

---

<div class="post-metadata">

**Author:** ![tuxedo95](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tuxedo95](https://mangoh.discourse.group/u/tuxedo95)\
**Post date:** [August 4, 2019, 6:50pm UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/14 "2019-08-04T18:50:55Z")

</div>

Ubuntu 18.04 that I had downloaded on the official website of Linux, I don’t have the link but it’s easy with a Google research.

Good luck

---

<div class="post-metadata">

**Author:** ![m2msupport](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@m2msupport](https://mangoh.discourse.group/u/m2msupport)\
**Post date:** [August 5, 2019, 6:21am UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/15 "2019-08-05T06:21:14Z")

</div>

@dfrey I’m getting the same error for the red\_wp77xx build.  
/home/insa/mangOH/apps/BatteryService/batteryUtils/Component.cdef:3:13: error: Unexpected subsection name ‘headerDir’ in ‘provides’ section.

I’m following the instructions as in [https://mangoh.io/setting-up-vm](https://mangoh.io/setting-up-vm). Is the VM image provided in that link supports build for red\_wp77xx?

---

<div class="post-metadata">

**Author:** ![psherk](https://avatars.discourse-cdn.com/v4/letter/p/b9e5f3/32.png) [@psherk](https://mangoh.discourse.group/u/psherk)\
**Post date:** [August 26, 2019, 11:23pm UTC](https://mangoh.discourse.group/t/cross-compiler-error/2801/16 "2019-08-26T23:23:46Z")

</div>

I’m getting the same headerDir issue in json/Component.cdef, and this is based on the MangOH VM, legato 18.09.0 on Ubuntu 18.04. Following the Rev 5 instructions online, for the Windows w/ VM option, command is make red\_wp76xx. Getting a bit frustrated with the hoops required just to start building…
