| #
2825530b |
| 22-Feb-2024 |
Jerome Forissier <jerome.forissier@linaro.org> |
mk/lib.mk: add library to link line only when it does contain objects
This commit addresses a build issue when the output directory is not cleaned from a previous build. Here is a test case:
# Sta
mk/lib.mk: add library to link line only when it does contain objects
This commit addresses a build issue when the output directory is not cleaned from a previous build. Here is a test case:
# Start from a clean state $ rm -rf ./out # (1) Build for Arm, with unwinding enabled $ make -s -j$(nproc) ARCH=arm PLATFORM=vexpress-qemu_armv8a O=out CFG_UNWIND=y && echo OK OK # (2) Build for RISC-V, with unwinding enabled too $ make -s -j$(nproc) ARCH=riscv PLATFORM=virt O=out CFG_UNWIND=y && echo OK OK # (3) Build for Arm again but with unwinding disabled $ make -s -j$(nproc) ARCH=arm PLATFORM=vexpress-qemu_armv8a O=out CFG_UNWIND=n aarch64-linux-gnu-ld.bfd: skipping incompatible out/ldelf-lib/libunw/libunw.a when searching for -lunw aarch64-linux-gnu-ld.bfd: cannot find -lunw: No such file or directory make: *** [ldelf/link.mk:60: out/ldelf/ldelf.elf] Error 1 make: *** Waiting for unfinished jobs....
In step (3), the libunw.a file leftover from step (2) causes a problem because it is not generated again for the current ARCH (due to CFG_UNWIND=n, so there is effectively nothing to build). Yet it is unconditionally added to the link line by mk/lib.mk although CFG_UNWIND=n. Therefore change the logic in mk/lib.mk to deal with that.
Step (2) causes no error because due to CFG_UNWIND=y and due to dependencies (different source files, different cross compiler), the archive file is re-created.
Note that it is not OK to simply guard the inclusion of mk/lib.mk with CFG_UNWIND in core/core.mk and ldelf/ldelf.mk because we still want the library headers to be accessible (no conditionals on #include <...>).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
b489a618 |
| 25-Jan-2023 |
Jerome Forissier <jerome.forissier@linaro.org> |
mk/lib.mk: use full path to shared library in flags variable
To add link flags for a shared library, a makefile variable is used that is called lib-ldflags$(libuuid). That's incorrect because the UU
mk/lib.mk: use full path to shared library in flags variable
To add link flags for a shared library, a makefile variable is used that is called lib-ldflags$(libuuid). That's incorrect because the UUID is not enough to uniquely identify a shared library in the build. For example when both 32-bit and 64-bit user space is generated there are two versions of the shared library with the same UUID. It is not a problem at the moment because lib-ldflags$(libuuid) is used only for one target: ta_arm64, but fix this anyways so that the variable may be used for more complex cases.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
48685b6c |
| 16-Dec-2021 |
Jerome Forissier <jerome@forissier.org> |
arm64: bti: fail link phase if some objects do not support BTI
Adds the proper linker options (-z force-bti --fatal-warnings) to fail the link if some object files lack the BTI feature bit when BTI
arm64: bti: fail link phase if some objects do not support BTI
Adds the proper linker options (-z force-bti --fatal-warnings) to fail the link if some object files lack the BTI feature bit when BTI is requested (CFG_CORE_BTI=Y, CFG_TA_BTI=y). The options are added for tee.elf, ldelf.elf, in-tree TAs, in-tree user space shared libraries (CFG_ULIBS_SHARED=y) as well as for external TAs and shared libraries built with the dev kit.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Ruchika Gupta <ruchika.gupta@linaro.org>
show more ...
|
| #
b4faf480 |
| 22-Jul-2020 |
Dick Olsson <hi@senzilla.io> |
mk: core: ta: Configurable Python interpreter
Build systems that manage multiple different python interpreters need explicit control over which version of the interpreter to use. This patch enables
mk: core: ta: Configurable Python interpreter
Build systems that manage multiple different python interpreters need explicit control over which version of the interpreter to use. This patch enables one to override the default interpreter with the path to a specific one.
Signed-off-by: Dick Olsson <hi@senzilla.io> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| #
8001ec6d |
| 30-Jun-2020 |
Jerome Forissier <jerome@forissier.org> |
lib.mk: clang: link shared libraries with -z separate-loadable-segments
The same Clang 10 fix in commit 4d35ab6a0cef ("TA dev kit: clang: link shared libraries with -z separate-loadable-segments") i
lib.mk: clang: link shared libraries with -z separate-loadable-segments
The same Clang 10 fix in commit 4d35ab6a0cef ("TA dev kit: clang: link shared libraries with -z separate-loadable-segments") is needed for locally built user space libraries when CFG_ULIBS_SHARED=y.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
4e74e39a |
| 18-Mar-2020 |
Jerome Forissier <jerome@forissier.org> |
mk/lib.mk: cleanup shared library link command
The command used to link shared libraries when CFG_ULIBS_SHARED=y is slightly incorrect for two reasons:
1. The -L/-l arguments are passed before the
mk/lib.mk: cleanup shared library link command
The command used to link shared libraries when CFG_ULIBS_SHARED=y is slightly incorrect for two reasons:
1. The -L/-l arguments are passed before the object files, when they should normally be added after;
2. The shared libraries needed during the link are passed as files in addition to being supplied with -L/-l. This is redundant, and is a consequence of having the shared libraries in the prerequisites and using $^. Therefore, filter out the .so files.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
2de17fda |
| 23-Oct-2019 |
Sumit Garg <sumit.garg@linaro.org> |
TA dev kit: add support for TA encryption
Add CFG_ENCRYPT_TA as TA build time configuration option to enable encryption of TA using encryption key provided via TA_ENC_KEY build time option. The defa
TA dev kit: add support for TA encryption
Add CFG_ENCRYPT_TA as TA build time configuration option to enable encryption of TA using encryption key provided via TA_ENC_KEY build time option. The default value of TA_ENC_KEY is derived from 16 zero bytes default hardware unique key.
Also rename scripts/sign.py to scripts/sign_encrypt.py to reflect optional encryption support along with signing of TAs.
Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
13ff3d45 |
| 09-Aug-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
Fix signing libraries
Libraries are signed if OP-TEE is compiled with the non-default CFG_ULIBS_SHARED=y configuration option.
With 1cdd95a2a46d ("Support offline signing of TAs.") the sign.py scri
Fix signing libraries
Libraries are signed if OP-TEE is compiled with the non-default CFG_ULIBS_SHARED=y configuration option.
With 1cdd95a2a46d ("Support offline signing of TAs.") the sign.py script no longer supports the --version switch and instead gives an error like: SIGN ../out-os-qemu/ta_arm32-lib/libutee/527f1a47-b92c-4a74-95bd-72f19f4a6f74.ta usage: sign.py command [ arguments ]
command: sign Generate signed loadable TA image file. Takes arguments --uuid, --in, --out and --key. digest Generate loadable TA binary image digest for offline signing. Takes arguments --uuid, --in and --dig. stitch Generate loadable signed TA binary image file from TA raw image and its signature. Takes arguments --uuid, --in, --out, and --sig.
sign.py --help show available commands and arguments sign.py: error: argument command: invalid choice: '0' (choose from 'sign', 'digest', 'stitch', 'generate-digest', 'stitch-ta') mk/lib.mk:83: recipe for target '../out-os-qemu/ta_arm32-lib/libutee/527f1a47-b92c-4a74-95bd-72f19f4a6f74.ta' failed
With this patch the switch "--version 0" is removed when signing libraries.
Fixes: 1cdd95a2a46d ("Support offline signing of TAs.") Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
7509ff7c |
| 23-May-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
Add user mode ELF loader
Adds ldelf which loads user mode TAs while in user mode. The TA ELF file is loaded and relocated by ldelf before the TA can be executed.
Reviewed-by: Jerome Forissier <jero
Add user mode ELF loader
Adds ldelf which loads user mode TAs while in user mode. The TA ELF file is loaded and relocated by ldelf before the TA can be executed.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
735565db |
| 16-May-2019 |
Sumit Garg <sumit.garg@linaro.org> |
Rename CFG_ULIBS_GPROF to CFG_ULIBS_MCOUNT
CFG_ULIBS_GPROF builds the user mode libraries with -pg, which adds instrumentation to all functions in the form of a call to mcount(). This was historical
Rename CFG_ULIBS_GPROF to CFG_ULIBS_MCOUNT
CFG_ULIBS_GPROF builds the user mode libraries with -pg, which adds instrumentation to all functions in the form of a call to mcount(). This was historically used by gprof, but other tools can benefit from this instrumentation. Therefore, rename the config flag as well as a couple of source files to remove the reference to gprof.
Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
show more ...
|
| #
a3fdd56c |
| 23-May-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
Link user libraries with 4K page size
Set the linker flag max-page-size to 4K when linking shared user libraries. This is used to avoid unnecessary large holes in the virtual memory map between segm
Link user libraries with 4K page size
Set the linker flag max-page-size to 4K when linking shared user libraries. This is used to avoid unnecessary large holes in the virtual memory map between segments with different attributes.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
e59b134d |
| 29-May-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
mk/lib.mk: add support for producing shared user libraries
This commit adds the infrastructure to build libutils, libmpa/ libmbedtls etc. as shared objects (.so).
Signed-off-by: Jerome Forissier <j
mk/lib.mk: add support for producing shared user libraries
This commit adds the infrastructure to build libutils, libmpa/ libmbedtls etc. as shared objects (.so).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
b31756b3 |
| 15-Nov-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
lib.mk: centralize profiling flag (-pg)
Code cleanup, no functional change. This commit avoids the duplication of the -pg flag in the library makefiles.
Signed-off-by: Jerome Forissier <jerome.fori
lib.mk: centralize profiling flag (-pg)
Code cleanup, no functional change. This commit avoids the duplication of the -pg flag in the library makefiles.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
4709340b |
| 23-Sep-2015 |
Jerome Forissier <jerome.forissier@linaro.org> |
lib.mk: make sure archive file contains only specified objects
The recipe for archive (.a) files is updated so we won't try to append objects to an existing archive left over from a previous build.
lib.mk: make sure archive file contains only specified objects
The recipe for archive (.a) files is updated so we won't try to append objects to an existing archive left over from a previous build.
This fixes the following build error: $ make -s PLATFORM=hikey $ make -s PLATFORM=hikey CFG_ARM64_core=y \ CROSS_COMPILE_core=aarch64-linux-gnu- [...]libtomcrypt.a: error adding symbols: File in wrong format
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
show more ...
|
| #
0957bcc5 |
| 19-May-2015 |
Pascal Brand <pascal.brand@st.com> |
plat-stm: CFG_GENERIC_BOOT=y
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform) Tested-by: Pascal Brand <pascal.brand@linaro.org
plat-stm: CFG_GENERIC_BOOT=y
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform) Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU platform) Signed-off-by: Pascal Brand <pascal.brand@st.com>
show more ...
|
| #
62428631 |
| 29-Apr-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
build: add support for make -s
Adds support for make -s to get a really silent build. This is useful to get a shorter travis build log.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Rev
build: add support for make -s
Adds support for make -s to get a really silent build. This is useful to get a shorter travis build log.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
1b4eb4f5 |
| 02-Feb-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
Separate compiler for core and user TA
Enables compilation with different compilers for core and user TA.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.w
Separate compiler for core and user TA
Enables compilation with different compilers for core and user TA.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU, FVP) Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
show more ...
|
| #
fe52b1f5 |
| 06-Nov-2014 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: create conf.h from CFG_* Makefile variables
Simplify the use of makefile configuration variables from C code. With this patch, one can #include <generated/conf.h> instead of adding CPP flags d
core: create conf.h from CFG_* Makefile variables
Simplify the use of makefile configuration variables from C code. With this patch, one can #include <generated/conf.h> instead of adding CPP flags definitions to the .mk files.
- CFG_* variables that are set to 'y' are converted to: #define CFG_FOO 1 - Undefined variables, or variables set to 'n' remain undefined in conf.h - CFG_* variables with any other value are output unchanged
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
show more ...
|
| #
699f50a8 |
| 28-Oct-2014 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add support for $(lib-use-ld) and $(lib-ldflags)
When building a static library, set lib-use-ld := y to use $(LD) instead of $(AR). Link flags may be passed in $(lib-ldflags).
Signed-off-by: Jerome
Add support for $(lib-use-ld) and $(lib-ldflags)
When building a static library, set lib-use-ld := y to use $(LD) instead of $(AR). Link flags may be passed in $(lib-ldflags).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform)
show more ...
|
| #
73dc728d |
| 25-Sep-2014 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add support for per-directory/per-library/per-file includes, and per-library CPP flags
The new variables that can be used in sub.mk are:
1) For includes: incdirs-y, incdirs-lib-y, incdirs-<filena
Add support for per-directory/per-library/per-file includes, and per-library CPP flags
The new variables that can be used in sub.mk are:
1) For includes: incdirs-y, incdirs-lib-y, incdirs-<filename>-y
For example, suppose core/lib/libfoo/sub.mk contains the following:
# All source files declared in $(srcs-y) in this sub.mk will # have -Icore/lib/libfoo/include incdirs-y := include
# All source files for the current library $(libname) will be built # with -Icore/lib/libfoo/include/baz (even files that are in other # directories) incdirs-lib-y := include/baz
# In addition to the above, bar.c will be compiled with # -Icore/lib/libfoo/include/bar incdirs-bar.c-y := include/bar
2) For CPP flags: cppflags-lib-y
For example, to add -DLIBFOO to all the source files that belong to the same library, add this to any of the sub.mk files:
cppflags-lib-y := -DLIBFOO
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU virt platform)
show more ...
|
| #
4334e8d7 |
| 08-Sep-2014 |
Jerome Forissier <jerome.forissier@linaro.org> |
Makefile variables $(*-dir) should not have a trailing slash
As a general rule, Makefile variables that are directories should not have a trailing slash, and should be used as: $(some-dir)/some-file
Makefile variables $(*-dir) should not have a trailing slash
As a general rule, Makefile variables that are directories should not have a trailing slash, and should be used as: $(some-dir)/some-file rather than $(some-dir)some-file. This is more readable.
show more ...
|
| #
0047cb63 |
| 01-Sep-2014 |
Jerome Forissier <jerome.forissier@linaro.org> |
Cosmetic fixes for build output
By default, the OP-TEE build shows abbreviated output similar to the Linux kernel. This commit fixes a number of deviations/inconsistencies.
- Always print a command
Cosmetic fixes for build output
By default, the OP-TEE build shows abbreviated output similar to the Linux kernel. This commit fixes a number of deviations/inconsistencies.
- Always print a command in uppercase, followed by the target file. - Make sure commands and file paths are nicely aligned, with two leading spaces to make command output/errors better stand out. - Remove some duplicate slashes in file paths. We use the following rule: variables that hold directory names such as $(arch-dir) or $(platform-dir) always have a trailing slash. The 'subdirs' and 'incdirs' variables used in sub-makefiles are an exception because doing otherwise would needlessly clutter the sub-makefiles.
show more ...
|
| #
b0104773 |
| 12-Jun-2014 |
Pascal Brand <pascal.brand@st.com> |
Open-source the TEE Core
Signed-off-by: Pascal Brand <pascal.brand@st.com>
|