Skip to content

Commit

Permalink
tee-supplicant: fix build with kernel < 4.16
Browse files Browse the repository at this point in the history
Commit 3ac968e moved linux/tee.h from
libteec/include to libteec/src resulting in the following build failure
with any kernel < 4.16 (i.e before
torvalds/linux@033ddf1):

/home/buildroot/autobuild/instance-3/output-1/build/optee-client-4.0.0/tee-supplicant/src/tee_supplicant.c: In function 'register_local_shm':
/home/buildroot/autobuild/instance-3/output-1/build/optee-client-4.0.0/tee-supplicant/src/tee_supplicant.c:356:44: error: storage size of 'data' isn't known
  356 |         struct tee_ioctl_shm_register_data data;
      |                                            ^~~~

To fix this build failure, update CMakeLists.txt and Makefile of
tee-supplicant to add libteec/src to the include directories.

Fixes: 3ac968e ("Makefile, cmake: move teec related headers")

Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Jan 8, 2024
1 parent 98dc4f4 commit d5e05e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion tee-supplicant/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ endif()
################################################################################
# Public and private header and library dependencies
################################################################################
target_include_directories(${PROJECT_NAME} PRIVATE src)
target_include_directories(${PROJECT_NAME}
PRIVATE src
PRIVATE ../libteec/src
)

target_link_libraries(${PROJECT_NAME}
PRIVATE teec
Expand Down
2 changes: 1 addition & 1 deletion tee-supplicant/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ TEES_OBJ_DIR := $(OUT_DIR)
TEES_OBJS := $(patsubst %.c,$(TEES_OBJ_DIR)/%.o, $(TEES_SRCS))
TEES_INCLUDES := ${CURDIR}/../libteec/include \
${CURDIR}/src \
${CURDIR}/../libteec/include \
${CURDIR}/../libteec/src \

TEES_CFLAGS := $(addprefix -I, $(TEES_INCLUDES)) $(CFLAGS) \
-DDEBUGLEVEL_$(CFG_TEE_SUPP_LOG_LEVEL) \
Expand Down
2 changes: 1 addition & 1 deletion tee-supplicant/tee_supplicant_android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ifeq ($(CFG_FTRACE_SUPPORT),y)
LOCAL_CFLAGS += -DCFG_FTRACE_SUPPORT
endif

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../libteec/include \
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../libteec/src \
$(LOCAL_PATH)/../libteec/include \
$(LOCAL_PATH)/src

Expand Down

0 comments on commit d5e05e1

Please sign in to comment.