Commit Graph

117 Commits (52cb2c2cfcb2ca221f783ca6c16f2e4980d12b87)

Author SHA1 Message Date
Deepika ca1f24cc0e Add -mcmse flag for GCC and improved logic for cpu core 2017-09-11 11:49:28 -05:00
Deepika 9422c351e4 Initial RTX and tools support for Cortex M-23/M-33 devices 2017-09-11 11:43:26 -05:00
Jimmy Brisson 09afe23762 Upgrade OUTPUT_EXT and use it to pick binary type
targets.json contained a key for some targets, `OUTPUT_EXT`, which I
moved to `Target`, the root of all targets. Following on that, the tools
now use this extension provided by `OUTPUT_EXT` to determine the file
type of the output executable.
2017-03-29 16:46:21 -05:00
Anna Bridge ae10ca8787 Merge pull request #3895 from theotherjimmy/find-exec-in-path
Use PATH env variable when gcc found in PATH
2017-03-14 14:41:32 +00:00
Jimmy Brisson fbb6f71be8 Ignore build directory from scan resources
This is a bug fix for the following bug (Github issue #437):

If two builds were run specifying a non-default build folder, the second
build would fail to link with duplicate symbols and may not fit on the
device. The root of this problem is that these non-default build folders
are not ignored by scan-resources, and therefore included in the build.

We fix this bug by ignoring the build directory passed into the tools.
2017-03-06 17:10:57 -06:00
Jimmy Brisson a5745cadd9 Use PATH env variable when gcc found in PATH
Resolves the github issue #3790: Blinky fails to build (on Mac) after
addition of linker script preprocessing feature. Paraphrasing, this
issue is that Homebrew on mac does not install `arm-none-eabi-gcc` in
the same location as `arm-none-eabi-cpp`, the C Pre-Processor. The tools
prior to this commit, and after turning on the pre-processing of the
linker-script will fail on any Mac homebrew installed toolchains.

This commit resolves the above issue by allowing the toolchain's path to
the executable to remain empty after a call to `check_executable`. When
this path is empty, the tools will search the PATH environment variable
for the executable.
2017-03-06 15:24:58 -06:00
Sam Grove 067f5a0fef Merge pull request #3791 from theotherjimmy/remove-cr
Remove GCC_CR and refurbish LPCXpresso exporter
2017-02-22 13:33:14 -06:00
Jimmy Brisson 1d95604275 Remove GCC_CR
It has not worked since the introduction of build profiles
2017-02-16 15:03:24 -06:00
Liviu Ionescu 47b164b00b Merge remote-tracking branch 'ARMmbed/master' 2017-02-09 19:11:44 +02:00
Sam Grove 9ae6f7aa49 Merge pull request #3730 from c1728p9/redirect_support
Add redirect support to toolchains
2017-02-09 09:51:32 -06:00
Sam Grove 2de453c8fa Merge pull request #3706 from c1728p9/pre_process
Use the C Pre-Processor on GCC Linker scripts
2017-02-09 09:40:36 -06:00
Liviu Ionescu b2638646b8 Merge remote-tracking branch 'ARMmbed/master' 2017-02-09 05:17:22 +02:00
Jimmy Brisson c0f27597ec Add redirect support to toolchains
We create an API for generating the linker flags needed to redirect
functions in an application
2017-02-08 17:34:35 -06:00
Jimmy Brisson af4d848144 Use the C Pre-Processor on GCC Linker scirpts
This allows us to define parts of the linker script outside of the
linker script itself. In particular, we are interested in restricting
ROM to a subsection.
2017-02-08 17:26:36 -06:00
Brian Daniels b0739d7520 Fixing Cortex-A and SARA_NBIOT_EVK build failures (#3)
* Adding Cortex-A support for gnuarmeclipse
* Preventing '-mthumb' from being added to Cortex-A builds.
Previously, both '-mthumb' and '-marm' were being supplied to the
compiler (in that order). Because '-marm' came last, the compiler
respected this option. This change makes it so '-mthumb' is added for
all 'Cortex-M' targets only.
* Renaming to capital .S for Eclipse compatibility
2017-02-07 21:18:18 +02:00
Brian Daniels 6be8278246 Adding case insensitive 'error' detection
GCC Assembler errors were being missed because it prints 'error'
with a captial 'E'. This change allows the 'e' to be either lower
case or upper case.
2017-02-02 12:27:59 -06:00
Brian Daniels 3ad3a9f1d5 Adding fatal error detection to toolchians.
Before the toolchains would ignore error messages that contained the
string "Fatal error". This would lead to a silent failure unless the
compile command was ran with verbose options. This is now fixed.
2017-01-27 12:07:13 +02:00
Russ Butler 9f6b346c88 Properly set flags for default_lib = small
Use newlib nano for targets which have the key "default_lib" set to
"small". Also support the legacy key of "default_build".
2016-10-12 20:36:09 -05:00
Sam Grove 761ec4423b Merge pull request #2856 from bridadan/fixing-missed-build-error-prints
[Tools] Making all toolchains print final compiler message
2016-09-30 15:01:20 -05:00
Jimmy Brisson d88852d150 Replace -o with profiles 2016-09-29 10:20:05 -05:00
Jimmy Brisson ceda396e18 Add simple build profiles to toolchains 2016-09-28 17:25:24 -05:00
Brian Daniels 10534019b9 Making all toolchains print final compiler message.
This functionality was already present in the ARM toolchain script, but
this commit adds this across all toolchain scripts. Solves an issue that
cropped up where a build error wasn't being printed unless the verbose
flag was used. This should now print any existing error messages that have
been printed when the compiler output is being parsed.
2016-09-28 14:42:35 -05:00
Sam Grove 0c0455bf3f Merge pull request #2745 from pan-/disable_global_objects_destruction
Disable global objects destruction
2016-09-22 00:48:08 -05:00
Vincent Coubard f4f8b491d1 Override exit and atexit functions from newlib.
This change simplify the exit and initialization process.
It also reduce the number of hidden memory allocation made by atexit.
2016-09-19 15:17:39 +01:00
Sam Grove 663fdb796f Merge pull request #2721 from theotherjimmy/profile-documentation
tools - Add documentation about profiles to the toolcahins
2016-09-16 17:38:13 -05:00
Jimmy Brisson 924d242b39 Add documentation about profiles to the toolcahins 2016-09-15 15:03:10 -05:00
Sarah Marsh ab92a5ace2 Toolchain check generic in mbedToolchain 2016-09-13 13:59:11 -05:00
Sarah Marsh 8b74c5b3c7 Docstrings. Empty executable search path handling. 2016-09-13 12:06:01 -05:00
Sarah Marsh 61dee45dca Revise checking toolchain path 2016-09-12 18:54:39 -05:00
Sam Grove ea3526d657 Merge pull request #2418 from sarahmarshy/path_error_rev
Readable error when toolchain paths not set. Allow IAR and ARM toolchains to be set in user's PATH.
2016-08-26 13:10:48 -05:00
Vincent Coubard fe322adc9c Make selection of c library used consistent.
* rename "default_build" property into "default_lib"
* rename "standard" value for "default_build" into "std".
2016-08-23 16:04:56 +01:00
Vincent Coubard 73a925810c Improve naming of the command line option which select the c library to use.
* rename 'small-build' into 'small-lib'
* rename 'standard-build' into 'std-lib'
2016-08-23 15:42:08 +01:00
Vincent Coubard afde624a26 Rename big-build option into standard-build.
With this change, the name is more descriptive and aligned with the targets
definitions in hal/targets.json.
2016-08-23 15:38:44 +01:00
Russ Butler 6a31ffbf3e Heap statistics
Keep track of the current size allocated, maximum size allocated,
number of allocations, failed allocations and total size allocated for
both GCC and ARM. Report the maximum size allocated at the end of
testing.

Also, add a test to verify heap metrics are working as expected.
2016-08-22 18:32:51 -05:00
Sarah Marsh cd229bacc3 Allow users to set armcc and iccarm in path.
Raise exceptin instead of exit.
Corrected error for arm-none-eabi-gcc/g++ set in path.
2016-08-17 09:14:05 -05:00
Brian Daniels 20ddba6e90 Fixing issue where GCC fails to report compile errors when non-verbose
The output of the GCC compiler is such that the toolchain regex sometimes
got hung up on the ':' charcter being printed in front of the drive letter when
running on Windows. This PR changes the matching logic to be more flexible
by using 'search' to check the entire string for a match, not just the
beginning of the string.
2016-08-16 12:34:18 -05:00
Sarah Marsh 1445886844 Readable error when toolchain paths not set.
Fixes #2360.

New error:
[Error] Toolchain path does not exist for IAR.
Current value: /default/path/that/doesnt/exist
(System exit before any build system calls)
2016-08-10 11:52:45 -05:00
Mihail Stoyanov 88564a9ac3 Differentiate ASM and CXX symbols as they are not treated the same in ARMCC and IAR compilers 2016-08-04 18:19:08 +01:00
Sam Grove 381b352df5 Merge pull request #2168 from c1728p9/remove_float_printf
Remove floating point formatting in newlib nano
2016-07-26 00:20:45 -05:00
Bogdan Marinescu fd757d3b84 Merge pull request #2180 from mbedmicro/online-build-system
[Tools] mbed Online Build System support and improvements
2016-07-19 16:30:48 +03:00
Mihail Stoyanov ad87f9da34 Document code and mark which methods are used by the online build system 2016-07-19 11:16:05 +01:00
Mihail Stoyanov 74b7f9e923 mbed Online Build System support:
* added/improved global chroot support
* added RESPONSE_FILES flag to support optional response files (on linux the cmd param length is 2 megabytes). Default True
* added unified handling for archive and link response file (similar to includes)
* added COMPILE_C_AS_CPP flag to support compiling of c files as cpp. Default False
* added mbedToolchain.init() for post __init__ hooks
* added caching to mbedToolchain.need_update() to reduce IO hits
* added support to identify compiler warning/error column (supports ARMCC, GCC and IAR). Errors/warnings now report file@line,col
* added global TOOLCHAIN_PATHS which allows overriding/changing of the toolchain paths. Also simplified ARM-related paths
* added target.json to mbed library release (by @0xc0170)* migrated compile_worker() to utils.py for lightweight thread initialization
* improved run_cmd() performance by removing unnecessary check about the command being executed (should be checked once in the relevant toolchain instead)
* removed remnants of Goanna support (should be reimplemented as hooks to compile/link/archive instead)
* fixes for Python 2.7 compatibility (by @0xc0170)
* fixes for Exporters (by @0xc0170)
2016-07-19 11:14:42 +01:00
Martin Kojtal 5cd73170ba Merge pull request #2185 from yogpan01/master
Changing -O2 parameter to -Os
2016-07-19 10:42:34 +01:00
Yogesh Pande e6043daa04 Changing -O2 parameter to -Os
This commit includes
- Changing build option parameter from -O2 to -Os to reduce flash size of the
  final binary pacakge.
  The original parameter of -O2 is kept to circumvent the error
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46762 .
 But this error has been long fixed and released in latest 4.9.x GCC compiler.

 This change is necessary to reduce the generated binary size of mbed Client component to
avoid problem of getting images over 512 kB which is causing application to crash because of
Configuration Store problem https://github.com/ARMmbed/configuration-store/issues/21
2016-07-18 13:59:39 +03:00
Russ Butler 546b5dec7c Remove floating point formatting in newlib nano
Remove special case targets which have floating point enabled in
Newlib Nano from gcc.py.  To enable floating point printf/scanf
for a target configure it to use the 'standard' default build in
targets.json rather than 'small'.
2016-07-13 18:48:43 -05:00
0xc0170 359d33cc16 Revert part of the FPU change
We keep target.core names, it defines if CPU contains FPU, as it's common - Cortex M4F/M7F.
We add Cortex M7FD for double precision FPU.
2016-07-11 10:39:23 +01:00
Olaf Hagendorf bd614a2a11 [bugfix gcc_arm] build+make <-> export project+make: different results
when in target.json "default_build": "small" is configured
- build.py+make.py
  - uses linker option --specs=nano.specs
  - macro MBED_RTOS_SINGLE_THREAD is defined
- exporting with project.py + make Makefile
  - doesn't use the linker option --specs=nano.specs
  - doesn't contain macro MBED_RTOS_SINGLE_THREAD
2016-07-06 13:35:09 +02:00
Olaf Hagendorf 4fe41d4edd fpu with single/double precision - removing redundancy
- removing redundancy as discussed in PR #2087:
 - in target.json the core option can have only this values : "Cortex-M0", "Cortex-M0+", "Cortex-M1", "Cortex-M3", "Cortex-M4", "Cortex-M7", "Cortex-A9" - Cortex-M4F and Cortex-M7F removed
 - in target.json an additional fpu option with values: "single" and "double" can be used
- build and export scripts are changed to handle this

- tested (compiling, running on hardware) with nucleo_f767 (cortex-m7 with double precision fpu), nucleo_f746 (cortex-m7 with single precision fpu), nucleo_f446 and nucleo_l467 (cortex-m4 with single precision fpu), teensy31 (cortex-m4 without fpu - only build test), nucleo_l073 (cortex-m0)
- singletest results are added to PR #2087 comments
2016-07-04 22:08:31 +02:00
Olaf Hagendorf ea196e2adb fpu with single/double precision - bugfix and extension
- creating new core name Cortex_M7F_DP for a target with a double precision fpu
- adding new core name to arm.py to set compiler/linker flags to a double precision fpu when configured in target.json
- up to now: gcc wrote flag for a double precision fpu -> target with STM32F746 didn't run when using double variables - mcu has only single precision fpu
- changing gcc.py to use single precision for Cortex-M7 und double precision for Cortex_M7F_DP

tested with NUCLEO_F746, NUCLEO_F767 and build.py+make.py and exporting with project.py + compiling/flashing

- iar.py need a similar extention - I didn't change that yet because
  - did not run at the moment - python exception
  - currently worked on in PR #1948
2016-07-04 22:08:30 +02:00
Erwan Gouriou 9bb08291ce [STM32F4xx] Add support for NUCLEO_F429ZI 2016-07-04 14:00:41 +02:00
Laurent Meunier 4e1a3351b2 [NUCLEO_F446ZE] Add to build and export scripts 2016-07-04 11:44:28 +02:00
Mihail Stoyanov 879ae8c6bd Fixed gcc.py typo
get_conifg_option -> get_config_option
2016-06-27 14:06:41 -05:00
Jimmy Brisson 5532fb8697 Export command line for including mbed_conf.h from toolchains 2016-06-27 14:06:34 -05:00
Sam Grove 667d49ed8f Merge pull request #1985 from kjbracey-arm/iar_vlas
Turn on C99 VLAs in IAR
2016-06-24 16:13:22 -05:00
Kevin Bracey b74546c731 Warn about or prevent VLA use in C++
ARM and GNU compilers currently are in a mode where they will accept VLAs
in C++ as an extension. IAR does not accept them in C++.

Avoid potential portability surprises by making GCC warn, and
deactivating the extension in ArmCC.
2016-06-23 09:57:05 +03:00
Bogdan Marinescu a164224acf Changed prefix file name to mbed_conf.h
Also changed some function names to make it clear that the prefix
headers feature is only used for config.
2016-06-16 17:01:41 +03:00
Bogdan Marinescu 85eca37d29 Added toolchain support for configuration in prefix headers
This commit uses the previously introduced feature of generating
configuration data as a C header file rather than as command line macro
definitions. Each toolchain was modified to use prefix headers if
requested, and build_api.py was modified to set up the toolchain's
prefix header content using the data generated by the config system.

Tested by compiling blinky for GCC and ARMCC. I'm having a few issues
with my IAR license currently, but both ARMCC and IAR use the same
`--preinclude` option for prefix headers, so this shouldn't be an issue.

Note that at the moment all exporters still use the previous
configuration data mechanism (individual macro definitions as opposed to
a prefix header). Exporters will be updated in one or more PRs that will
follow.
2016-06-16 16:13:50 +03:00
Jimmy Brisson 685f4ed648 Adds -funsigned-char to default gcc args
It would resolve #1525, but for the fact that KDS is used.
2016-06-13 16:02:45 +01:00
Jimmy Brisson e3b9def8cf Refactors all toolchains to have flags api 2016-06-13 15:58:23 +01:00
Martin Kojtal 3a0d5611dd Merge pull request #1911 from mbedmicro/config-tests
Config tests, GCC flags, requirements.txt
2016-06-13 16:52:49 +02:00
Vincenzo Frascino 4f61cfd7f6 [BEETLE] Add support for GCC ARM exporter
This patch adds support for GCC ARM exporter to the Beetle Target.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
2016-06-13 14:26:47 +01:00
Mihail Stoyanov 0034ffb716 Add tests to the config system. Add GCC flags to support uVisor 2016-06-12 19:04:41 +01:00
Russ Butler 3db2c030d2 Only allow one thread on unsafe standard libs
When using a standard library which does not support multi-threading
allow only one thread to be used.  This allows the code to remain
safe.
2016-06-12 18:18:40 +01:00
Mihail Stoyanov f6acb1ffb4 Forward ported changes to tools 2016-06-10 15:19:02 +01:00
Mihail Stoyanov 51c10165ca Fixed toolchain flags so exporters can use them 2016-06-10 13:12:21 +01:00
Mihail Stoyanov c2e3001739 Add config system, memap, updates to build_api and toolchains 2016-06-09 23:50:03 +01:00
Mihail Stoyanov 3d45b2cdbb Renamed workspace_tools folder to tools 2016-06-09 21:34:53 +01:00