Skip to content

Conversation

kaspar030
Copy link
Contributor

Based on #3361.

This PR adds the possibility to exclude some files from being built with LTO, and applies this to some critical files on Cortex-M.

Some boards don't compile (all msp430, mulle, pba-d-01-kw2x), but as this is completely optional (have to manually add LTO=1 to the Makefile, still get a big fat warning), and the codesize savings are 5-10%, IMHO we should get this merged as is.

@kaspar030 kaspar030 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: build system Area: Build system labels Aug 10, 2016
@kaspar030 kaspar030 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 10, 2016
@kaspar030
Copy link
Contributor Author

@gebart Are you fine with me basically adopting your PR? I dropped the "LTO=yes" compatibility stuff and the WIP cortex fix commit from 3361.

@jnohlgard
Copy link
Member

@kaspar030 sure, feel free to improve on this. I agree with dropping the
LTO=yes argument btw.

Den 10 aug. 2016 4:40 PM skrev "Kaspar Schleiser" <notifications@github.com

:

@gebart https://github.com/gebart Are you fine with me basically
adopting your PR? I dropped the "LTO=yes" compatibility stuff and the WIP
cortex fix commit from 3361.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#5742 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AATYQsdmqiu4Vcum7-ieXiI0bXJzyP7pks5qeeLTgaJpZM4JhNs4
.

);
}

void __attribute__((naked)) __attribute__((used)) isr_svc(void) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it not dangerous to assume that these two functions will be placed in order and next to each other without any padding in the final binary? I'm sensing that we are relying on linker implementation specific behaviour here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

totally, I forgot the function call in pendsv. will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@kaspar030 kaspar030 added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Aug 10, 2016
@kaspar030
Copy link
Contributor Author

  • improved LINKFLAGS comment text

}

void __attribute__((naked)) __attribute__((used)) isr_svc(void) {
__asm__ volatile (
/* SVC handler entry point */
/* PendSV will continue from above and through this part as well */
Copy link
Member

Choose a reason for hiding this comment

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

Reword or remove this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reworded

@kaspar030
Copy link
Contributor Author

  • added comments to SRC_NOLTO Makefile statements

@kaspar030
Copy link
Contributor Author

@gebart IMHO this can be merged, what do you think?

@jnohlgard
Copy link
Member

I agree. Since LTO is still experimental it does not matter that it only produces working binaries for some of the platforms.

@kaspar030 kaspar030 removed the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Aug 29, 2016
@kaspar030
Copy link
Contributor Author

  • squashed

I agree. Since LTO is still experimental it does not matter that it only produces working binaries for some of the platforms.

Is that an ACK? :)

@kaspar030 kaspar030 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 29, 2016
@jnohlgard
Copy link
Member

Changes look fine, though it's missing SRC_NOLTO for kw2x and k60 (vector.c) if that causes the same build error as the other cortex vectors.

If you feel like it you could rename vector.c -> vectors.c in kw2x and k60 to match all the other Cortex CPUs.

@jnohlgard jnohlgard added this to the Release 2016.10 milestone Aug 29, 2016
@kaspar030
Copy link
Contributor Author

If you feel like it you could rename vector.c -> vectors.c in kw2x and k60 to match all the other Cortex CPUs.

did!

@jnohlgard
Copy link
Member

ACK

@jnohlgard
Copy link
Member

Murdock is happy -> go!

@jnohlgard jnohlgard merged commit 455fb6c into RIOT-OS:master Aug 29, 2016
smlng added a commit to smlng/RIOT that referenced this pull request Sep 1, 2016
  - corrects and enhances changes introduces in RIOT-OS#5742
smlng added a commit to smlng/RIOT that referenced this pull request Sep 1, 2016
  - corrects and enhances changes introduced in RIOT-OS#5742
smlng added a commit to smlng/RIOT that referenced this pull request Sep 12, 2016
  - corrects and enhances changes introduced in RIOT-OS#5742
smlng added a commit to smlng/RIOT that referenced this pull request Sep 12, 2016
  - corrects and enhances changes introduced in RIOT-OS#5742
@kaspar030 kaspar030 mentioned this pull request Jan 15, 2017
4 tasks
@kaspar030 kaspar030 deleted the fix_lto branch February 7, 2017 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants