Make sure that kernel/unified, that is included in libs-y does not
built recursively through building kernel/ directory.
Make sure that any lib.a library is not included into libzephyr.a
and thus object modules from those lib.a files are linked only if a
function from that object module is referenced from the application.
Jira: ZEP-1025
Change-Id: Id3a3e96ca0b8abc9aedde0ffb9baa0164e380464
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Oops, turns out that we don't require perl in all our build
environments. Rewrite this script (it's tiny) in Python. Exactly the
same logic.
Change-Id: Icbf4b36ef0b18fca94d54fc7fe5e47343c55c669
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
For projects like JerryScript and Micropython we are starting to see
hybrid build systems emerge where the application (which targets a
variety of OSs and already includes a complex build system) is compiled
using the applications own build system before handing over to the
zephyr build system for the final link.
Currently the integration is becoming quite complex as the applications
build integration tries to figure out sane values for CC and CFLAGS.
Much of this complexity can be avoided if we allow the zephyr build
system to export its configuration in a manner that can easily be
consumed by the alien build system.
Change-Id: I4ea4cda2ed0437222d9550c50f0b07e51d9ac91b
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
There are demons hiding in binutils with regard to the size of the
data section that needs to be copied in XIP platforms. It's easy to
mess up and get a mismatch between the linker data output and the
runtime addresses. Add a cheap check to discover this early when it
occurs.
Jira: ZEP-955
Change-Id: If1c61fe8712221c6450b5b89f5f8af006b41b3fe
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This framework makes testing in most parts a lot easier, since it gives
an unified base to work with, removing a lot of unnecessary code from
tests. This framework currently features simple assertions and basic
mocking support. The framework works both with and without Zephyr
running, so it can be used for real unit testing.
Origin: Original
Change-Id: I8c5bf2e6b8d6656b6197ee91699b61e730c1cfe3
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Building kernel objects as a static library allows not
to include the initialization function for an object
type if this type is not used by the application.
It reduces memory footprint
Change-Id: I2b3c79cb2591fdd1ce15d27684c4a874e759c559
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Build system will first check if the linker script is found relative to
the project directory, and if not, it will consider it to be an absolute
path, as before.
Change-Id: Idfc7e55febbc8c197643ca514dc01c3e2262712a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Some make implementations have different implementations for
notdir and absdir functions.
notdir may require that his parameter do not finish with "\".
absdir may fail when given a windows formated path as input.
The path that is given to notdir as parameter is removed from
the final "\" and abspath is replaced with realpath when the
input given can be a windows formated path.
Jira: ZEP-762
Change-Id: Ic83e3526fc5234decb3192ab1f9f538addf9a76e
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
QEMU_BIN_PATH is frequently set to pick up qemu binaries from "obvious"
places such as /usr/bin or /usr/local/bin. Neither of these values will
be correct for all users and both directories would typically be found
in the user's PATH. Much better to make QEMU_BIN_PATH optional and picking
up qemu via PATH instead.
Tested with ZEPHYR_GCC_VARIANT={zephyr|xtools}.
Change-Id: I1acfc5b12341c6d330a3e9e90b0ab5bde29e2e4f
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Andrew Boie <andrew.p.boie@intel.com>
The build system uses absolute path names to generate
target names. In Windows, absolute path names include the
character ":".
Makefile does not support target names with the character ":"
on them.
The target names involved are PHONY. The commit modifies the
Makefile logic to not include directory names in zephyr-app-dirs
and clean-dirs targets.
Jira: ZEP-517
Change-Id: I37b62f04b8bc6bffbbc19e0e4fd2a827347e5cbd
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
Adds the diskio interface for the FAT file system. This
revision uses RAM to emulate disk storage.
Origin: Original
Jira: ZEP-285
Change-Id: I7a30c8761d5ed9b564f1d1e08482c5ef199d7372
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Introduce a quiet_cmd to create the .a for libzephyr.a so that we can
get see explicitly what's going on if V=1 is set
Change-Id: Id0a3cf0aefac4f28bab1da3ba244b7dcead394a8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Enabling building of the kernel archive as the first step towards
split kernel and app builds.
An application will be able to link against this archive in the final
step of the build process.
Change-Id: If0abc7002d19ca2ca10c7babd83fe1dc6fccebfa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Several Zephyr SDK toolchains support multilibs.
Instead of hard-coding locations of the libraries, the proper/cleanest way
is to query the GCC compiler for the locations of libgcc and libc.
However, in order to do this, we need to ensure a certain order of
initialization in the Makefile:
1. Determine CROSS_COMPILE.
We cannot determine LIB_INCLUDE_DIR, TOOLCHAIN_CFLAGS yet, as we don't
know the KBUILD_CFLAGS yet.
2. Calculate KBUILD_CFLAGS using CROSS_COMPILE
KBUILD_CFLAGS often need the compiler to validate options, i.e:
KBUILD_CFLAGS += $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m0)
However, LIB_INCLUDE_DIR, TOOLCHAIN_CFLAGS should not be needed for this
3. Finally, using CROSS_COMPILE and KBUILD_CFLAGS determine LIB_INCLUDE_DIR,
TOOLCHAIN_CFLAGS by querying GCC using -print-libgcc-file-name and
-print-multi-directory command line options.
This change should only affect Zephyr SDK toolchains, all other toolchains
are expected to function as before.
Change-Id: I27b460d46fe65d05fcb8bafb51cd6b3deba275ed
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The IRQ implementations of ARC, ARM, and Nios II use .gnu.linkonce
sections for declaring entires in the sw_isr_table array. It's
imperative that arch/built-in.o be linked after everything else
as we want custom interrupt handlers to take precedence over the
default spurious interrupt handlers.
Currently, any interrupt handlers defined in ext/ or usb/ will not
be installed properly on the above mentioned arches.
Change-Id: Ib3fb21ff1ef114678906f130c268c266535954f1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Previously, gen_idt's code had to be modified to get this information.
We now print it by default when building with V=1
Change-Id: I31bd6c5b851d6280ebcedaab97bd02b8331a2f24
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
From the GCC manual for -Og option, introduced in GCC
4.8:
Optimize debugging experience. -Og enables optimizations
that do not interfere with debugging. It should be the
optimization level of choice for the standard
edit-compile-debug cycle, offering a reasonable level of
optimization while maintaining fast compilation and a
good debugging experience
Change-Id: I65751cf3117bc2e6f70a7008b170126160cfa48c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Since sysgen copies kernel/microkernel/include/micro_private_types.h and
kernel/microkernel/include/kernel_main.h we need to make sure that
sysgen gets invoked if those files ever change. Otherwise we might have
stale versions.
Change-Id: Id84522e3af693f1323f73c9642d1884f0be4b7cf
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
USB Device core layer is a hardware independent interface between USB
device controller driver and USB device class drivers or customer
applications. It's a port of the LPCUSB device stack.
Change-Id: I9371ffab7034d20953fec0525e72fbe9e094c931
Signed-off-by: Adrian Bradianu <adrian.bradianu@windriver.com>
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
This reverts commit e697621371.
It is causing problems dependeing on what version of QEMU is
used, with the SDK QEMU the terminal has to be 'reset' after
running (the opposite behavior of the Nios 2 build).
Change-Id: I6756eb0cf8edf4faa36f3a5e1cf0e456f146e1d8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
For the application object files to get properly placed in the outdir
when the source files are outside of the zephyr tree we need to set
$srctree in kbuild to the parent dir of the application source code
rather than getting the default of $srctree being set to $ZEPHYR_BASE.
By doing this we are able to get the kbuild system to place the object
file results in the outdir rather than in the application source dir.
Jira: ZEP-369
Change-Id: I4d3ba67a4a38c15978d5bf7e1f0a912e9bf00f08
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Seperate building of the application code from the zephyr OS code. This
is in prep for both having a libzephyr.a for the OS and to fix where
the application object files get put when building out of tree.
Change-Id: I43f3b54d11f41aaf35350de7462c5cd556804092
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
There are situations that the host gcc is not able to generate x86
binaries, in those cases, the user should point HOSTCC to a binary able
to generate the correct type of binaries.
This also allows './scripts/sanitycheck' to be run in systems where the
build tools are prefixed by default.
Change-Id: Id1fc247f8a820e19bb3d4e8119634f8300e7ebac
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
You can now exit out of QEMU using Ctrl-C, and this resolves
some issues where the terminal could get messed up if QEMU
terminates abnormally.
Change-Id: I94ca66333bf9035e3627f28bbd2c152cf981a13f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This new target works much like 'make qemu' but fires up a local GDB
server on port 1234 and pauses execution
Change-Id: I87fd174c66dcc9f2f43b5b1204cc5c34f741622d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Translate the SOC name and part number into the ksdk device path and CPU
macro respectively. This will be used by future ksdk shim drivers and by
the ksdk itself.
Change-Id: I40e94441ee032bfbed7df834be8000d95be53250
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
At the moment libc gets linked, all unused functions get
stripped and the libqmsi gets linked but __assert_func is not
available.
Change-Id: I7fc2f8b9136f858023b3e983575869a2206ba9ce
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
For CMSIS we now have HAS_CMSIS which needs to be added to the
SoC definition.
Instead of changing the main Makefile we now include a sub-Makefile
with all related header and library paths that are hosted in
ext/
Move redifintion of LIB_INCLUDE_DIR later to get variables defined
in Makefile.toolchain.*
Change-Id: I9f90f90247c2a66b4565427b89d4e1d4dd5c9622
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Still WIP. Give statistics on memory/flash usage.
Run:
make BOARD=<board> ram_report
or
make BOARD=<board> rom_report
Change-Id: I6b0aee09b89275e12f1cde863d2c0f5b8dfd0409
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This is external source code maintained somewhere else. Put it
under ext/ for clarity and maintainability.
Change-Id: I9e7c9d0948a2ba893006e316dc21d9b1a9edfa93
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
By default, instead of spamming the build output with one warning per
file where __assert.h is included when CONFIG_ASSERT=y, only display a
warning at the end of the build.
Also limit the range of CONFIG_ASSERT_LEVEL between 0 and 2.
Change-Id: I95ffd1bcec9535de1afabc047814e5c6f5b9c2c1
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Cleanup main Makefile and remove all library related code to
lib/ to better support the increasing number of libraries and
to keep the main Makefile clean from library dependencies.
Jira: ZEP-308
Change-Id: Id83cf309020604b8eab8d80cad0021905d5b5f7a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
tinycrypt was built using the lib- scripts without any real benefit. We
also had a wrong placement of the Kconfig files under misc/ and a Kconfig
file for Crypto that was never used before.
Change-Id: I82d5902d92e7c06e10a95f418d9ead3cbcabcce4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
When building an application for a different BOARD, the .link file
was never updated causing issues with linking.
Also, make sure we restart the build process when the board has changed.
This guarantees that the file is recreated when the dependencies have
changed.
Jira: ZEP-239
Change-Id: Ided3a71c03fd8b2c6ab9c2bf8370104cd5071c08
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Avoids confusion with .gitignore rules, which were inadequate to
cover all the places where these files are found. At least in
VIM, these files are now syntax highlighted correctly.
Change-Id: I23810b0ed34129320cc2760e19ed1a610afe039e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We now have to supply location of libraries (libgcc, libc) and header
directories to the build system. This can be solved in the
Makefile.toolchain.* file for known toolchains but becomes a problem
when supporting 3rd party SDKs and cross compilers.
Linking with ld requires ld to know where all the artificats of the
compiler are. Use gcc instead to make use of the internal information
available in gcc about additional libraries and headers.
Jira: ZEP-241
Change-Id: I15a3b812467b7ae878226f7e5532d538d2720268
Signed-off-by: Anas Nashif <anas.nashif@intel.com>