Anchor the object search to the DML wrapper top-level Makefile directory. This allows source files in subdirectories to be properly discovered and compiled with the required FPU CFLAGS, fixing SSE compilation errors.
Signed-off-by: Prike Liang <[email protected]> --- drivers/gpu/drm/amd/display/dc/dml2_wrapper/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml2_wrapper/Makefile b/drivers/gpu/drm/amd/display/dc/dml2_wrapper/Makefile index f8a17d622c32..2c84233db00c 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2_wrapper/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dml2_wrapper/Makefile @@ -32,8 +32,9 @@ subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dc/dml2_wrapper/dml21_wrapper # Add FPU flags to all dml2_wrapper files by default, remove NO_FPU flags. # FPU flags step 1: Find all .c files in dal/dc/dml2_wrapper and it's subfolders -DML2_WRAPPER_ABS_PATH := $(FULL_AMD_DISPLAY_PATH)/dc/dml2_wrapper -DML2_WRAPPER_C_FILES := $(shell find $(DML2_WRAPPER_ABS_PATH) -name '*.c' -type f) +THIS_MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +DML2_WRAPPER_ABS_PATH := $(patsubst %/,%,$(dir $(THIS_MAKEFILE_PATH))) +DML2_WRAPPER_C_FILES := $(shell find $(DML2_WRAPPER_ABS_PATH) -name '*.c') # FPU flags step 2: Convert to .o and make paths relative to $(AMDDALPATH)/dc/dml2_wrapper/ DML2_WRAPPER_RELATIVE_O_FILES := $(patsubst $(DML2_WRAPPER_ABS_PATH)/%,dc/dml2_wrapper/%,$(patsubst %.c,%.o,$(DML2_WRAPPER_C_FILES))) -- 2.34.1
