cpu/mips: Integrate better with RIOT newlib layer#6639
cpu/mips: Integrate better with RIOT newlib layer#6639jnohlgard wants to merge 11 commits intoRIOT-OS:masterfrom
Conversation
cpu/mips32r2_common/Makefile.include
Outdated
| # A bit of makefile magic: | ||
| # foreach symbol in overridable ld-symbols : | ||
| # If symbol has a value, produce a linker argument for that symbol. | ||
| MIPS_HAL_LDFLAGS = $(foreach a,$(priv_symbols),$(if $($a),-Wl$(comma)--defsym$(comma)__$(call lc,$(a))=$($a))) |
There was a problem hiding this comment.
The above block is basically the only thing that had any effect for our use case in mipshal.mk, all other CFLAGS and tool paths were already copied to this file in the initial MIPS PR.
There was a problem hiding this comment.
We probably want to add this too:
ifdef ROMABLE
MIPS_HAL_LDFLAGS += -T bootcode.ld
endif
As we use the toolchain bootcode for PIC32.
|
references #6588 |
cpu/mips32r2_common/Makefile.include
Outdated
| export APP_START=0x80000000 | ||
|
|
||
| include $(MIPS_ELF_ROOT)/share/mips/rules/mipshal.mk | ||
| # Portable 'lowercase' func. |
There was a problem hiding this comment.
While this looks definitely beautiful, we're using $(shell echo X | tr 'A-Z' 'a-z') in many other places. Mental note to myself: analyze what is faster and then unify.
|
Yes will do.
This will conflict with #6066 and #6092 which re-factors out common
makefile code to a new file (cpu/Makefile.include.mips_common)
It would be nice if we could get these merged first, then apply this
change to the new common file.
Neil
…On 02/24/17 15:05, Kaspar Schleiser wrote:
The changes look fine and very necessary. Thanks @gebart
<https://github.com/gebart>!
@neiljay <https://github.com/neiljay> Could you test this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6639 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/AUEU6p8vMK3jsqZtmQ_Sj7sGJdiWIgC9ks5rfvHIgaJpZM4MI90U>.
|
|
I found an issue. The Makefile.include for sys/newlib does not seem to be included with this patch. Need to investigate |
|
Sure, I will try to rebase onto those PRs
…On Feb 24, 2017 4:18 PM, "neiljay" ***@***.***> wrote:
Yes will do.
This will conflict with #6066 and #6092 which re-factors out common
makefile code to a new file (cpu/Makefile.include.mips_common)
It would be nice if we could get these merged first, then apply this
change to the new common file.
Neil
On 02/24/17 15:05, Kaspar Schleiser wrote:
> The changes look fine and very necessary. Thanks @gebart
> <https://github.com/gebart>!
>
> @neiljay <https://github.com/neiljay> Could you test this?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#6639 (comment)>, or
> mute the thread
> <https://github.com/notifications/unsubscribe-auth/AUEU6p8vMK3jsqZtmQ_
Sj7sGJdiWIgC9ks5rfvHIgaJpZM4MI90U>.
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6639 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AATYQt_DS4mlYblZM3eyZNmYVYqIpEXQks5rfvTigaJpZM4MI90U>
.
|
cpu/mips32r2_common/Makefile.include
Outdated
| export CFLAGS_DBG = -O0 -g2 | ||
| export CFLAGS_OPT = -Os -g2 | ||
| export CFLAGS_DBG = -g3 | ||
| export CFLAGS_OPT = -Os |
There was a problem hiding this comment.
It can be useful to have debug symbols on a release build too, the elf is typically converted to some binary format for 'real world' targets anyway.
There was a problem hiding this comment.
@neiljay you have misinterpreted the intent of the CFLAGS_DBG and CFLAGS_OPT variables in the other Makefiles, they are simply groupings for making the file easier to read:
- CFLAGS_DBG contains flags which affect the generation of debug symbols
- CFLAGS_OPT contains flags which affect the code optimization
If you check the other platforms you'll see that they are both unconditionally added to CFLAGS.
We don't have any concept of Release build vs. Debug build in the current RIOT build system.
I forgot to remove the comment on CFLAGS_DBG below, though.
|
@gebart
Ah ok I see, it would be nice to have a standard mechanism to do debug
vs release builds, GUI debuggers can get confused with optimised code.
Neil
…On 03/01/17 10:53, Joakim Nohlgård wrote:
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In cpu/mips32r2_common/Makefile.include
<#6639 (comment)>:
> export CFLAGS_LINK = -ffunction-sections -fdata-sections -fno-builtin -fshort-enums
-export CFLAGS_DBG = -O0 -g2
-export CFLAGS_OPT = -Os -g2
+export CFLAGS_DBG = -g3
+export CFLAGS_OPT = -Os
@neiljay <https://github.com/neiljay> you have misinterpreted the intent
of the CFLAGS_DBG and CFLAGS_OPT variables in the other Makefiles, they
are simply groupings for making the file easier to read:
* CFLAGS_DBG contains flags which affect the generation of debug symbols
* CFLAGS_OPT contains flags which affect the code optimization
If you check the other platforms you'll see that they are both
unconditionally added to CFLAGS.
We don't have any concept of Release build vs. Debug build in the
current RIOT build system.
I forgot to remove the comment on CFLAGS_DBG below, though.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6639 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/AUEU6vyaVTEo8ATxeYJPnxo3uema3ZfCks5rhU4UgaJpZM4MI90U>.
|
afc4a9c to
23975a0
Compare
|
rebased on top of #6092 |
|
I have checked this works on the pic32-clicker and pic32-wifire boards. I guess this needs re-basing now the VFS PR got merged. |
|
I will try to rebase this some time during the evening or weekend |
f88e513 to
9ca8437
Compare
|
rebased |
9aabfa5 to
3c4f80a
Compare
- Copied the relevant parts of mipshal.mk from the toolchain - Cleaned up CFLAGS and more in Makefile.include - Added empty syscalls implementation which can be used to interface with the UHI system - Added a note on why -std=gnu99 is necessary for this CPU presently
Some headers in the tool chain cause compilation errors with Clang in assembly mode.
Causes compilation error on Clang
3c4f80a to
6716925
Compare
|
@gebart, Is it possible for me to commit directly to the PR, or should I create my own based off this ? |
|
@neiljay AFAIK it's not possible for you to update my PR branch, but if you would like to take over this PR you can open a new PR with your own branch and I'll close this one. |
|
Closing in favour of #6892 |
Depends on #4699
#6066#6092#6670#6672#6673The reason for this PR is that we need VFS (#5616) to be able to tell when newlib is used in order to provide the correct headers for use in statvfs etc.