Skip to content

Commit

Permalink
ta: remove CPPFLAGS
Browse files Browse the repository at this point in the history
Setting CPPFLAGS in TA makefiles does not work with Buildroot (the
value is ignored and replaced with some Buildroot-defined default).

Here are the relevant parts of the Buildroot makefiles:

 build/br-ext/package/optee_examples_ext/optee_examples_ext.mk-11-     @$(foreach f,$(wildcard $(@d)/*/ta/Makefile), \
 build/br-ext/package/optee_examples_ext/optee_examples_ext.mk-12-             echo Building $f && \
 build/br-ext/package/optee_examples_ext/optee_examples_ext.mk-13-                     $(MAKE) CROSS_COMPILE="$(shell echo $(BR2_PACKAGE_OPTEE_EXAMPLES_EXT_CROSS_COMPILE))" \
 build/br-ext/package/optee_examples_ext/optee_examples_ext.mk-14-                     O=out TA_DEV_KIT_DIR=$(OPTEE_EXAMPLES_EXT_SDK) \
 build/br-ext/package/optee_examples_ext/optee_examples_ext.mk:15:                     $(TARGET_CONFIGURE_OPTS) -C $(dir $f) all &&) true

 buildroot/package/Makefile.in:262:TARGET_CONFIGURE_OPTS = \
 buildroot/package/Makefile.in:292:	CPPFLAGS="$(TARGET_CPPFLAGS)" \

 buildroot/package/Makefile.in:161:TARGET_CPPFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64

Therefore the TAs end up being built with:

 make CPPFLAGS="-D_LARGEFILE_SOURCE ..."

...which is why the values in ta/*/Makefile are ignored.

Since we use CPPFLAGS only to set the value of CFG_TEE_TA_LOG_LEVEL and
since this is taken care of elsewhere (by the TA dev kit in ta/ta.mk),
there is no reason to keep the CPPFLAGS.

Note: if one needs to set TA flags in the Makefile, one reliable way is
to set CPPFLAGS_ta_arm32 and/or CPPFLAGS_ta_arm64.

Signed-off-by: Jerome Forissier <[email protected]>
Reviewed-by: Joakim Bech <[email protected]>
  • Loading branch information
jforissier committed Jul 30, 2020
1 parent a66caa4 commit c6eb00a
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion acipher/ta/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CFG_TEE_TA_LOG_LEVEL ?= 4
CPPFLAGS += -DCFG_TEE_TA_LOG_LEVEL=$(CFG_TEE_TA_LOG_LEVEL)

# The UUID for the Trusted Application
BINARY=a734eed9-d6a1-4244-aa50-7c99719e7b7b
Expand Down
1 change: 0 additions & 1 deletion aes/ta/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CFG_TEE_TA_LOG_LEVEL ?= 4
CPPFLAGS += -DCFG_TEE_TA_LOG_LEVEL=$(CFG_TEE_TA_LOG_LEVEL)

# The UUID for the Trusted Application
BINARY=5dbac793-f574-4871-8ad3-04331ec17f24
Expand Down
1 change: 0 additions & 1 deletion hello_world/ta/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CFG_TEE_TA_LOG_LEVEL ?= 4
CPPFLAGS += -DCFG_TEE_TA_LOG_LEVEL=$(CFG_TEE_TA_LOG_LEVEL)

# The UUID for the Trusted Application
BINARY=8aaaf200-2450-11e4-abe2-0002a5d5c51b
Expand Down
1 change: 0 additions & 1 deletion hotp/ta/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CFG_TEE_TA_LOG_LEVEL ?= 3
CPPFLAGS += -DCFG_TEE_TA_LOG_LEVEL=$(CFG_TEE_TA_LOG_LEVEL)

# The UUID for the Trusted Application
BINARY=484d4143-2d53-4841-3120-4a6f636b6542
Expand Down
1 change: 0 additions & 1 deletion random/ta/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CFG_TEE_TA_LOG_LEVEL ?= 4
CPPFLAGS += -DCFG_TEE_TA_LOG_LEVEL=$(CFG_TEE_TA_LOG_LEVEL)

# The UUID for the Trusted Application
BINARY=b6c53aba-9669-4668-a7f2-205629d00f86
Expand Down
1 change: 0 additions & 1 deletion secure_storage/ta/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CFG_TEE_TA_LOG_LEVEL ?= 2
CPPFLAGS += -DCFG_TEE_TA_LOG_LEVEL=$(CFG_TEE_TA_LOG_LEVEL)

# The UUID for the Trusted Application
BINARY=f4e750bb-1437-4fbf-8785-8d3580c34994
Expand Down

0 comments on commit c6eb00a

Please sign in to comment.