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

Turn on debugging by default when exporting. Remove optimizations for IAR and Uvision #3534

Merged
merged 2 commits into from
Jan 16, 2017

Conversation

sarahmarshy
Copy link
Contributor

@sarahmarshy sarahmarshy commented Jan 5, 2017

Description

This PR will turn on flags for debug symbols for all exporters.

It also removes optimization flags from the compiler flags, as those are set in the IDE by the user. If they exist as a hard-coded flag, the user will not be able to use the IDE to turn them off, and instead will have to manually search through the considerably long compiler flags to turn them off (if they realize they their IDE setting did nothing). Not a big deal in some exporters, but uvision makes them into a single text box in the GUI, so you just have to arrow over.

@janjongboom @theotherjimmy

Status

READY

Migrations

Now, if users do not want debug flags when exporting, they should use:
mbed export --profile default

Related: #3532
This is a more generalized version for all the exporters.

Todos

  • Tests
  • Reviewers

@@ -175,7 +175,7 @@ def main():
type=argparse_profile_filestring_type,
help="Build profile to use. Can be either path to json" \
"file or one of the default one ({})".format(", ".join(list_profiles())),
default=[])
default=[argparse_profile_filestring_type('debug')])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will do what you seem to think. I think it will always start with the debug profile and merge all of the profiles specified on the command line. That's not quite what we want here.

What we want here is for the default to be the debug profile.

@theotherjimmy
Copy link
Contributor

/morph export-build

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it :)

@mbed-bot
Copy link

mbed-bot commented Jan 5, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 68

Exporter Build failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 6, 2017

Please split the first commit into 2 logical separated commits:

  • Turn on debugging by default when exporting
  • Remove optimizations for IAR and Uvision

@@ -351,7 +351,7 @@
</ArmAdsMisc>
<Cads>
<interw>0</interw>
<Optim>2</Optim>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a reason for this? shall be a separate commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns off optimizations by default.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 9, 2017

Please split the first commit into 2 logical separated commits:
Turn on debugging by default when exporting
Remove optimizations for IAR and Uvision

@sarahmarshy Can you please?

@sarahmarshy
Copy link
Contributor Author

@0xc0170 They are split now.

@bridadan
Copy link
Contributor

/morph export-build

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 78

Exporter Build failed!

@bridadan
Copy link
Contributor

bridadan commented Jan 11, 2017

@sarahmarshy It looks like there are some ST devices that are failing to compile in debug mode, and I have a feeling that these are probably present when compiling with the mbed build system as well.

Would you mind trying the following and seeing if it fails? This failed with make_iar in the CI system.

mbed import mbed-os-example-mesh-minimal
cd mbed-os-example-mesh-minimal
mbed compile -m DISCO_F746NG -t IAR --profile debug

EDIT: This is the error I'm seeing in CI:

10:35:02 "C:\Jenkins\workspace\bm_wrap\1416\examples\mbed-os-example-mesh-minimal\mbed-os\features\FEATURE_LWIP\lwip-interface\lwip\src\include\lwip\arch.h",70  Warning[Pe301]: typedef name has already been declared (with same type)
10:35:02 Error[Li005]: no definition for "get_i2c_timing" [referenced from C:\Jenkins\wo
10:35:02           rkspace\bm_wrap\1416\examples\mbed-os-example-mesh-minimal\BUILD\mbed
10:35:02           -os\targets\TARGET_STM\i2c_api.o]
10:35:02 make[1]: *** [mbed-os-example-mesh-minimal.elf] Error 2
10:35:02 make: *** [all] Error 2

@sarahmarshy
Copy link
Contributor Author

Results:

GCC_ARM:

mbed compile -m DISCO_F746NG -t GCC_ARM --profile debug


Compiling stuff.....
....
Link: mbed-os-example-mesh-minimal
./.build/DISCO_F746NG/gcc_arm/mbed-os/targets/TARGET_STM/i2c_api.o: In function `i2c_frequency':
C:\Repos\mbed-os-example-mesh-minimal/.\mbed-os\targets\TARGET_STM/i2c_api.c:363: undefined reference to `get_i2c_timing'
collect2.exe: error: ld returned 1 exit status
[ERROR] ./.build/DISCO_F746NG/gcc_arm/mbed-os/targets/TARGET_STM/i2c_api.o: In function `i2c_frequency':
C:\Repos\mbed-os-example-mesh-minimal/.\mbed-os\targets\TARGET_STM/i2c_api.c:363: undefined reference to `get_i2c_timing'
collect2.exe: error: ld returned 1 exit status

IAR:

mbed compile -m DISCO_F746NG -t IAR --profile debug


Compiling stuff.....
....
Link: mbed-os-example-mesh-minimal
Error[Li005]: no definition for "get_i2c_timing" [referenced from C:\Repos\mbed
          -os-example-mesh-minimal\.build\DISCO_F746NG\IAR\mbed-os\targets\TARG
          ET_STM\i2c_api.o]
[ERROR] Error[Li005]: no definition for "get_i2c_timing" [referenced from C:\Repos\mbed
          -os-example-mesh-minimal\.build\DISCO_F746NG\IAR\mbed-os\targets\TARG
          ET_STM\i2c_api.o]

@bridadan
Copy link
Contributor

The export-build failure should be fixed now with #3577 being merged.

/morph export-build

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 81

All exports and builds passed!

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

Successfully merging this pull request may close these issues.

None yet

6 participants