Commit graph

5 commits

Author SHA1 Message Date
Daniel Leung 37f94d66ab cmake: extra_flags: fix EXTRA_CPPFLAGS being applied as macros
The EXTRA_CPPFLAGS is applied via zephyr_compile_definitions()
instead of zephyr_compile_options(), which makes all specified
options as macros. So fix it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-13 13:23:40 -05:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Andy Ross fe04adf99b lib/os: Conditionally eliminate alloca/VLA usage
MISRA rules (see #9892) forbid alloca() and family, even though those
features can be valuable performance and memory size optimizations
useful to Zephyr.

Introduce a MISRA_SANE kconfig, which when true enables a gcc error
condition whenever a variable length array is used.

When enabled, the mempool code will use a theoretical-maximum array
size on the stack instead of one tailored to the current pool
configuration.

The rbtree code will do similarly, but because the theoretical maximum
is quite a bit larger (236 bytes on 32 bit platforms) the array is
placed into struct rbtree instead so it can live in static data (and
also so I don't have to go and retune all the test stack sizes!).
Current code only uses at most two of these (one in the scheduler when
SCHED_SCALABLE is selected, and one for dynamic kernel objects when
USERSPACE and DYNAMIC_OBJECTS are set).

This tunable is false by default, but is selected in a single test (a
subcase of tests/kernel/common) for coverage.  Note that the I2C and
SPI subsystems contain uncorrected VLAs, so a few platforms need to be
blacklisted with a filter.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-02-28 10:06:35 -08:00
Sebastian Bøe abbdd88683 cmake: Fix EXTRA_LDFLAGS feature
It is supported to add give extra flags to the linker from the
commandline like this:

cmake -DEXTRA_LDFLAGS=-Lmy_dir path

But unfortunately this was broken during the CMake
migration. Interestingly, the reason that it was broken is that KBuild
was also partially broken. KBuild would pass on EXTRA_LDFLAGS when
object files were linked together into built-in.o files, but it would
not use EXTRA_LDFLAGS for the final link into an elf file.

This patch fixes EXTRA_LDFLAGS.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-05 08:39:43 -05:00
Sebastian Bøe 9f59045546 cmake: Refactored EXTRA_FLAGS code into a dedicated script
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-15 19:47:44 -05:00