Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurs when building exported mbed-os programs on e2studio #7155

Closed
TomoYamanaka opened this issue Jun 7, 2018 · 44 comments · Fixed by #7758 or #8303
Closed

Error occurs when building exported mbed-os programs on e2studio #7155

TomoYamanaka opened this issue Jun 7, 2018 · 44 comments · Fixed by #7758 or #8303

Comments

@TomoYamanaka
Copy link
Contributor

Description

I faced the several build error when compiled the exported mbed-os programs on Renesas' IDE e2studio.
The build errors are a bit different by programs, but I frequently look messages such as "No such file or directory".

The procedure is as follows:

  1. Export the program on Online Compiler
  2. Build the exported program on e2studio

The error that is shown when building exported mbed-os-example-blinky(mbed os 5.8.5) on e2studio is as follows:

../mbed-os/features/storage/FEATURE_STORAGE/storage-volume-manager/source/storage_volume.cpp:25:59: fatal error: storage-volume-manager/storage_volume_manager.h: No such file or directory
 #include "storage-volume-manager/storage_volume_manager.h"
                                                           ^
../mbed-os/features/storage/FEATURE_STORAGE/storage-volume-manager/source/storage_volume_manager.cpp:25:59: fatal error: storage-volume-manager/storage_volume_manager.h: No such file or directory
 #include "storage-volume-manager/storage_volume_manager.h"
                                                           ^
../mbed-os/features/storage/FEATURE_STORAGE/flash-journal/flash-journal-strategy-sequential/flash_journal_crc.c:18:65: fatal error: flash-journal-strategy-sequential/flash_journal_crc.h: No such file or directory
 #include "flash-journal-strategy-sequential/flash_journal_crc.h"
                                                                 ^
make: *** [mbed-os/features/storage/FEATURE_STORAGE/storage-volume-manager/source/storage_volume_manager.o] Error 1
mbed-os/features/storage/FEATURE_STORAGE/storage-volume-manager/source/subdir.mk:21: recipe for target 'mbed-os/features/storage/FEATURE_STORAGE/storage-volume-manager/source/storage_volume_manager.o' failed
make: *** Waiting for unfinished jobs....
make: *** [mbed-os/features/storage/FEATURE_STORAGE/storage-volume-manager/source/storage_volume.o] Error 1
mbed-os/features/storage/FEATURE_STORAGE/storage-volume-manager/source/subdir.mk:21: recipe for target 'mbed-os/features/storage/FEATURE_STORAGE/storage-volume-manager/source/storage_volume.o' failed
make: *** [mbed-os/features/storage/FEATURE_STORAGE/flash-journal/flash-journal-strategy-sequential/flash_journal_crc.o] Error 1
mbed-os/features/storage/FEATURE_STORAGE/flash-journal/flash-journal-strategy-sequential/subdir.mk:24: recipe for target 'mbed-os/features/storage/FEATURE_STORAGE/flash-journal/flash-journal-strategy-sequential/flash_journal_crc.o' failed
../mbed-os/features/storage/FEATURE_STORAGE/flash-journal/flash-journal-strategy-sequential/strategy.c:18:65: fatal error: flash-journal-strategy-sequential/flash_journal_crc.h: No such file or directory
 #include "flash-journal-strategy-sequential/flash_journal_crc.h"
                                                                 ^
make: *** [mbed-os/features/storage/FEATURE_STORAGE/flash-journal/flash-journal-strategy-sequential/strategy.o] Error 1
mbed-os/features/storage/FEATURE_STORAGE/flash-journal/flash-journal-strategy-sequential/subdir.mk:24: recipe for target 'mbed-os/features/storage/FEATURE_STORAGE/flash-journal/flash-journal-strategy-sequential/strategy.o' failed

With respect to file of "No such file or directory", it seems that file was exported but not included headers in the include paths.

Anyway, I think that this should not be the expected behavior, could you confirm the above?

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug

@ciarmcom
Copy link
Member

ciarmcom commented Jun 7, 2018

ARM Internal Ref: MBOTRIAGE-568

@toyowata
Copy link
Contributor

@theotherjimmy

Probably, it is related this?
#7129

@theotherjimmy
Copy link
Contributor

@toyowata That's a good guess, but I was under the impression that GNU MCU Eclipse could handle the extra long paths without issues.

@theotherjimmy
Copy link
Contributor

Also, you'll notice that the error is different in this issue than in #7129

@TomoYamanaka
Copy link
Contributor Author

TomoYamanaka commented Jun 25, 2018

@toyowata @theotherjimmy

I verified Export by following two patterns.



By Online Compiler
As shown the above, I faced the "No such file or directory" error when building the exported program.
Since the corresponding files(Following 5 passes) look like unnecessary include, I set them outside of build target on e2studio as a trial.

features/cryptocell
features/FEATURE_BLE
features/FEATURE_UVISOR
features/nanostack
features/storage

As the result of it, the following build error was shown.

arm-none-eabi-g++ @"mbed-os-example-blinky.elf.in"
arm-none-eabi-g++: error: unrecognized command line option '--wrap=main'; did you mean '--warn-main'?
arm-none-eabi-g++: error: unrecognized command line option '--wrap=_malloc_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=_free_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=_realloc_r'; did you mean '--warn-realloc-lhs'?
arm-none-eabi-g++: error: unrecognized command line option '--wrap=_memalign_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=_calloc_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=exit'; did you mean '--graphite'?
arm-none-eabi-g++: error: unrecognized command line option '--wrap=atexit'; did you mean '--graphite'?
makefile:130: recipe for target 'mbed-os-example-blinky.elf' failed
make: *** [mbed-os-example-blinky.elf] Error 1

By Mbed CLI
I built the exported program by running the following command.

$ mbed import http://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-blinky/
$ cd mbed-os-example-blinky
$ mbed export -m RZ_A1H -i e2studio
Build the exported program on e2studio

As the result of it, the following build error was shown("No such file or directory" error is not shown and the same "--wrap" error as above is shown).

arm-none-eabi-g++ @"mbed-os-example-blinky.elf.in"
arm-none-eabi-g++: error: unrecognized command line option '--wrap=main'; did you mean '--warn-main'?
arm-none-eabi-g++: error: unrecognized command line option '--wrap=__malloc_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=__free_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=__realloc_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=__memalign_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=__calloc_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=exit'; did you mean '--graphite'?
arm-none-eabi-g++: error: unrecognized command line option '--wrap=atexit'; did you mean '--graphite'?
makefile:185: recipe for target 'mbed-os-example-blinky.elf' failed
make: *** [mbed-os-example-blinky.elf] Error 1

To summarize the above, I think that check point is the below.

  • When exporting from Online Compiler, the unnecessary include path seems to set.
  • Whichever export method is used, the --wrap option related problem seems to be blocking the build on e2studio.

@theotherjimmy
Copy link
Contributor

@TomoYamanaka That's not an "unnecessary include path", that's the include paths from mbed compile.

the --wrap options are required to link. The problem is that g++ is being called instead of the linker. That's very odd.

@TomoYamanaka
Copy link
Contributor Author

@theotherjimmy

I investigated several points.

With respect to "No such file or directory" error :

  1. When building mbed-os program by Mbed LCI, this error is not shown.
$ mbed compile -m RZ_A1H -t GCC_ARM
  1. Also when exporting mbed-os program by Mbed LCI, this error is not shown.
$ mbed import http://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-blinky/
$ cd mbed-os-example-blinky
$ mbed export -m RZ_A1H -i e2studio
Build the exported program on e2studio
  1. Only when exporting mbed-os program by Online Compiler, this error is shown.
Select "Export program" and "Export Toolchain is e2studio" on Online compiler
Build the exported program on e2studio

It seems like there is something issue with export from Online, could you let me know your opinion on this ?


With respect to "--wrap" related error :
I tried adding -Wl prefix manually in .cproject file as below.

<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.flags.187528822" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.flags" valueType="stringList">
	<listOptionValue builtIn="false" value="-Wl,--wrap=main"/>
	<listOptionValue builtIn="false" value="-Wl,--wrap=_malloc_r"/>
	<listOptionValue builtIn="false" value="-Wl,--wrap=_free_r"/>
	<listOptionValue builtIn="false" value="-Wl,--wrap=_realloc_r"/>
	<listOptionValue builtIn="false" value="-Wl,--wrap=_memalign_r"/>
	<listOptionValue builtIn="false" value="-Wl,--wrap=_calloc_r"/>
	<listOptionValue builtIn="false" value="-Wl,--wrap=exit"/>
	<listOptionValue builtIn="false" value="-Wl,--wrap=atexit"/>
</option>

As the result of it, the build was successful.
Reference issue is here : #4624

@TomoYamanaka
Copy link
Contributor Author

@theotherjimmy
How is it going?

@TomoYamanaka
Copy link
Contributor Author

@theotherjimmy
I'd really appreciate it if you could give me any information.
Also would this issue update by #7410 ?

@theotherjimmy
Copy link
Contributor

theotherjimmy commented Jul 18, 2018

Sorry about that @TomoYamanaka

#7410 is not related to this. It may look like it because "exporter" but that's where the relevance stops.


Here's some pointers that may help you resolve the problem yourself:

@TomoYamanaka
Copy link
Contributor Author

Could you help me to resolve the following two points because this is a blocker for Renesas Mbed user's activity?

  • "No such file or directory" error (only when exporting on Online)
  • "--wrap" related error

@theotherjimmy
Copy link
Contributor

@TomoYamanaka You could extend the jinja template to include the --wrap. The "no such file or directory" errors sound like something else...

@phyokyaw
Copy link

Thanks for the reply @theotherjimmy. @TomoYamanaka as for --warp problem since e2 studio template extends gnu arm eclipse template, I'll update the jinja template on GNU ARM exporter to fix both. As for not adding include paths (No such file or directory error) I am not sure why some include paths are added but not others. I can look into it the next week.

Thanks
Phyo

@theotherjimmy
Copy link
Contributor

@phyokyaw The missing include paths are related to features that are disabled. They're supposed to show up in the export (if I recall correctly), and be disabled. It looks to me like the e2studio is missing the second part.

@theotherjimmy
Copy link
Contributor

@phyokyaw The e2studio template does not extend the GNU ARM Eclipse template. It does use the same variables though.

@TomoYamanaka
Copy link
Contributor Author

@phyokyaw @theotherjimmy Thank you for your comments.
@phyokyaw I'll be looking forward to your update.

@phyokyaw
Copy link

phyokyaw commented Aug 3, 2018

Hi @theotherjimmy,

Thank you for your comment. I am looking into the issue regards to excluding source files to see why there are "No such file or directory" errors. When we export using mbed-cli <entry excluding .../> entries in the exported .cproject contains the right path. E.g. for FEATURE_STORAGE

<sourceEntries> <entry excluding="...|./mbed-os/features/storage/FEATURE_STORAGE|... /> </sourceEntries>

However in .cproject file exported from online compiler contains

<sourceEntries> <entry excluding="...|/filer/web_data/repo_dicts/github.com/armmbed/mbed-os/main/features/storage/FEATURE_STORAGE|..." /> </sourceEntries>

Hence the compiler is not excluding the ignored files/directories. Looks like its referencing paths from online mapped repo rather than local path. Do you have view on how to make the excluded items reflect the correct path?

Is there a way we can convert the top path for excluded_folders in

def compute_exclusions(self):

Thanks
Phyo

@theotherjimmy
Copy link
Contributor

@phyokyaw Thanks for looking into this. I'll take a look at why that's going wrong.

@phyokyaw
Copy link

phyokyaw commented Aug 8, 2018

@TomoYamanaka @theotherjimmy

Just for FYI, I also noticed that in 5.9 mbed-os/features/nanostack/sal-stack-nanostack/source/configs folder is missing for Web exporter. The problem has been reported for other exporters.

https://os.mbed.com/questions/81597/Problems-when-exporting-to-uVision5-with/

https://os.mbed.com/forum/bugs-suggestions/topic/32790/?page=1#comment-58923

Once I manually copied the configs/ folder and resolved the excluded path I am able to build and debug from the exported project.

Thanks
Phyo

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 8, 2018

Just for FYI, I also noticed that in 5.9 mbed-os/features/nanostack/sal-stack-nanostack/source/configs folder is missing for Web exporter. The problem has been reported for other exporters.

👍

This issue was reported here #7615. It shall be fixed for 5.9.5

@TomoYamanaka
Copy link
Contributor Author

@phyokyaw
Thank you for information. You updated about the excluded path problem, on the other hand, is there any update about the "--warp" problem?

@phyokyaw
Copy link

@theotherjimmy Please review the PR if possible. This is to fix the --wrap error.

Thank you.
Phyo

@0xc0170 0xc0170 reopened this Aug 28, 2018
@TomoYamanaka
Copy link
Contributor Author

@theotherjimmy
How are you doing after that?
We will appreciate if you could inform us about the current status regarding the missing include paths.

@TomoYamanaka
Copy link
Contributor Author

@theotherjimmy
Since this issue keeps to block Renesas Mbed user's activity, we would be grateful if you would resolve this quickly.

@phyokyaw Thanks for looking into this. I'll take a look at why that's going wrong.

Would you please tell us update about the above?

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 21, 2018

@theotherjimmy is out of office this week. @cmonr Who else could help?

@theotherjimmy
Copy link
Contributor

@TomoYamanaka The issue with mbed_config.h including filer paths is gone.

@theotherjimmy
Copy link
Contributor

And the compute_exclusions bug is still there.

@theotherjimmy
Copy link
Contributor

See #8303 for the compute_exclusions fix.

@TomoYamanaka
Copy link
Contributor Author

@theotherjimmy Thank you for your update. We'll check #8303.

@adbridge
Copy link
Contributor

adbridge commented Oct 4, 2018

Internal Jira reference: https://jira.arm.com/browse/IOTCORE-14

@TomoYamanaka
Copy link
Contributor Author

@theotherjimmy

I checked whether this issue could be solved by exporting mbed-os-example-blinky(Mbed OS 5.10.4) on Mbed Online Compiler, unfortunately the problem seems to occur yet. (the exported program by CLI was no problem.)
The build error on e2studio is here.

../mbed-os/features/storage/FEATURE_STORAGE/storage-volume-manager/source/storage_volume.cpp:25:59: fatal error: storage-volume-manager/storage_volume_manager.h: No such file or directory
 #include "storage-volume-manager/storage_volume_manager.h"

Also, in the .cproject file exported from Online Compiler, I found that a part of excluding path is still mapped online path, not local path. (expected path is local path and this path by CLI is local path)
ex: FEATURE_STORAGE
by Mbed CLI
<sourceEntries> <entry excluding="...|./mbed-os/features/storage/FEATURE_STORAGE|... /> </sourceEntries>
by Online Compiler
<sourceEntries> <entry excluding="...|/filer/web_data/repo_dicts/github.com/armmbed/mbed-os/2fd0c5cfbd83fce62da6308f9d64c0ab64e1f0d6/features/storage/FEATURE_STORAGE|... /> </sourceEntries>


Although the solution PR #8303 was already merged into Mbed OS 5.10.3, could you make sure whether this contents reflected to Online Exporter environment?

@theotherjimmy
Copy link
Contributor

@TomoYamanaka #8303 is not in the online compiler.

@TomoYamanaka
Copy link
Contributor Author

TomoYamanaka commented Dec 7, 2018

@theotherjimmy

I'm in trouble with export from online so I'll be very grateful if you could help me.

My understanding is that PR #8303 solves to generate unusable project file from online compiler, and this solution should be applied to online environment not only mbed-os/tools. Also I know there is time rag regarding merge into online exporter. Are those correct?

@cmonr
Copy link
Contributor

cmonr commented Dec 7, 2018

I'm actually confused as well. @theotherjimmy This is at least in 5.10.3, correct? I'm missing the disconnect as well.

@theotherjimmy
Copy link
Contributor

I don't see what's so confusing. This is in 5.10.3. This is not in the online compiler.

@TomoYamanaka
Copy link
Contributor Author

@theotherjimmy

Could you tell me why this is not in the online compiler?
I think this should also be in online compiler because it affects project files generated from online.

@theotherjimmy
Copy link
Contributor

Could you tell me why this is not in the online compiler?

Because that requires a tools-release that has not been made. I'll be making a tools release for 5.11.0, and updating the online compiler to use that in the future.

@TomoYamanaka
Copy link
Contributor Author

TomoYamanaka commented Dec 11, 2018

@theotherjimmy

Thank you for your reply.

I understood that PR #8303 will be incorporated into next tools-release (the timing is in synchronization with mbed os 5.11.0).
I will confirm this issue again after next tools-release was published.

May I ask you something? Is the next tools-release that you mentioned different from tools-release-5.11.0-rc1 ?

@theotherjimmy
Copy link
Contributor

Is the next tools-release that you mentioned different from tools-release-5.11.0-rc1 ?

Yes. tools-release-5.11.0-rc1 is based on mbed-os-5.11.0-rc1, and the next tools release will be based on mbed-os-5.11.0.

@TomoYamanaka
Copy link
Contributor Author

@theotherjimmy

Although tools-release-5.11.0 was already released, when I build mbed-os-example-blinky after exporting from Mbed Online Compiler to e2studio, I faced this issue yet.

Could you check to whether this tools-release took into Online Expoter?

@theotherjimmy
Copy link
Contributor

@TomoYamanaka The tools release for 5.11 is not yet in the online compiler.

@TomoYamanaka
Copy link
Contributor Author

@theotherjimmy

When will it be ready? We will be grateful if you could let me know the scheduled date that is incorporated to Online Compiler.

@TomoYamanaka
Copy link
Contributor Author

@theotherjimmy

Thank you for continued support, I confirmed this issue was finally solved.
FYI, the program I tried by exporting is mbed-os-example-blinky Rev.91.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment