Merge changes I9bc7b609,Ie56dc965,Ic57d46bf,I3f2ab549,I3ad715fa, ... into integration

* changes:
  refactor(build): initialise `arch-features` closer to where it is needed
  refactor(build): define the W and DEBUG flags in the standard way
  refactor(build): put the cross referencing of options together
  fix: use LDLIBS instead of LDFLAGS for library search paths
  fix(build): remove redundant variables
  fix(intel): fix variable may be used uninitialized error
diff --git a/Makefile b/Makefile
index 88c7b69..4bc7053 100644
--- a/Makefile
+++ b/Makefile
@@ -137,11 +137,6 @@
 	target32-directive	= 	-target armv8a-none-eabi
 endif #(ARM_ARCH_MAJOR)
 
-################################################################################
-# Get Architecture Feature Modifiers
-################################################################################
-arch-features		=	${ARM_ARCH_FEATURE}
-
 ifneq ($(filter %-clang,$($(ARCH)-cc-id)),)
 	ifeq ($($(ARCH)-cc-id),arm-clang)
 		TF_CFLAGS_aarch32	:=	-target arm-arm-none-eabi
@@ -159,7 +154,6 @@
 endif #(clang)
 
 # Process Debug flag
-$(eval $(call add_define,DEBUG))
 ifneq (${DEBUG}, 0)
 	BUILD_TYPE	:=	debug
 	TF_CFLAGS	+=	-g -gdwarf-4
@@ -183,8 +177,6 @@
 	TF_CFLAGS_aarch32	+=	-marm
 else ifeq (${AARCH32_INSTRUCTION_SET},T32)
 	TF_CFLAGS_aarch32	+=	-mthumb
-else
-        $(error Error: Unknown AArch32 instruction set ${AARCH32_INSTRUCTION_SET})
 endif #(AARCH32_INSTRUCTION_SET)
 
 TF_CFLAGS_aarch32	+=	-mno-unaligned-access
@@ -545,17 +537,22 @@
 # Pauth support. As it's not secure, it must be reimplemented for real platforms
 	BL_COMMON_SOURCES	+=	lib/extensions/pauth/pauth.c
 endif
+#
+ifneq (${ENABLE_FEAT_PAUTH_LR},0)
+# Currently, FEAT_PAUTH_LR is only supported by arm/clang compilers
+# TODO implement for GCC when support is added
+ifeq ($($(ARCH)-cc-id),arm-clang)
+	arch-features	:= $(arch-features)+pauth-lr
+else
+	$(error Error: ENABLE_FEAT_PAUTH_LR not supported for GCC compiler)
+endif
+endif
 
 ################################################################################
 # RME dependent flags configuration, Enable optional features for RME.
 ################################################################################
 # FEAT_RME
 ifeq (${ENABLE_RME},1)
-	# RME requires AARCH64
-	ifneq (${ARCH},aarch64)
-                $(error ENABLE_RME requires AArch64)
-	endif
-
 	# RME requires el2 context to be saved for now.
 	CTX_INCLUDE_EL2_REGS := 1
 	CTX_INCLUDE_AARCH32_REGS := 0
@@ -573,47 +570,10 @@
 # Include rmmd Makefile if RME is enabled
 ################################################################################
 ifneq (${ENABLE_RME},0)
-	ifneq (${ARCH},aarch64)
-                $(error ENABLE_RME requires AArch64)
-	endif
-	ifeq ($(SPMC_AT_EL3),1)
-                $(error SPMC_AT_EL3 and ENABLE_RME cannot both be enabled.)
-	endif
-
-	ifneq (${SPD}, none)
-		ifneq (${SPD}, spmd)
-                        $(error ENABLE_RME is incompatible with SPD=${SPD}. Use SPD=spmd)
-		endif
-	endif
 include services/std_svc/rmmd/rmmd.mk
 $(warning "RME is an experimental feature")
 endif
 
-ifeq (${CTX_INCLUDE_EL2_REGS}, 1)
-	ifeq (${SPD},none)
-		ifeq (${ENABLE_RME},0)
-                        $(error CTX_INCLUDE_EL2_REGS is available only when SPD \
-                        or RME is enabled)
-		endif
-	endif
-endif
-
-################################################################################
-# Verify FEAT_RME, FEAT_SCTLR2 and FEAT_TCR2 are enabled if FEAT_MEC is enabled.
-################################################################################
-
-ifneq (${ENABLE_FEAT_MEC},0)
-    ifeq (${ENABLE_RME},0)
-        $(error FEAT_RME must be enabled when FEAT_MEC is enabled.)
-    endif
-    ifeq (${ENABLE_FEAT_TCR2},0)
-        $(error FEAT_TCR2 must be enabled when FEAT_MEC is enabled.)
-    endif
-    ifeq (${ENABLE_FEAT_SCTLR2},0)
-        $(error FEAT_SCTLR2 must be enabled when FEAT_MEC is enabled.)
-    endif
-endif
-
 ################################################################################
 # Make 128-Bit sysreg read/writes availabe when FEAT_D128 is enabled.
 ################################################################################
@@ -746,58 +706,7 @@
 ################################################################################
 # Check incompatible options and dependencies
 ################################################################################
-
-# Handle all invalid build configurations with SPMD usage.
-ifeq (${ENABLE_SPMD_LP}, 1)
-ifneq (${SPD},spmd)
-	$(error Error: ENABLE_SPMD_LP requires SPD=spmd.)
-endif
-ifeq ($(SPMC_AT_EL3),1)
-	$(error SPMC at EL3 not supported when enabling SPMD Logical partitions.)
-endif
-endif
-
-ifneq (${SPD},none)
-ifeq (${ARCH},aarch32)
-	$(error "Error: SPD is incompatible with AArch32.")
-endif
-ifdef EL3_PAYLOAD_BASE
-	$(warning "SPD and EL3_PAYLOAD_BASE are incompatible build options.")
-	$(warning "The SPD and its BL32 companion will be present but ignored.")
-endif
-ifeq (${SPD},spmd)
-ifeq ($(SPMD_SPM_AT_SEL2),1)
-	ifeq ($(SPMC_AT_EL3),1)
-		$(error SPM cannot be enabled in both S-EL2 and EL3.)
-	endif
-	ifeq ($(CTX_INCLUDE_SVE_REGS),1)
-		$(error SVE context management not needed with Hafnium SPMC.)
-	endif
-endif
-
-ifeq ($(SPMC_AT_EL3_SEL0_SP),1)
-	ifneq ($(SPMC_AT_EL3),1)
-		$(error SEL0 SP cannot be enabled without SPMC at EL3)
-	endif
-endif
-endif #(SPD=spmd)
-endif #(SPD!=none)
-
-# USE_DEBUGFS experimental feature recommended only in debug builds
-ifeq (${USE_DEBUGFS},1)
-        ifeq (${DEBUG},1)
-                $(warning DEBUGFS experimental feature is enabled.)
-        else
-                $(warning DEBUGFS experimental, recommended in DEBUG builds ONLY)
-        endif
-endif #(USE_DEBUGFS)
-
-# USE_SPINLOCK_CAS requires AArch64 build
-ifeq (${USE_SPINLOCK_CAS},1)
-        ifneq (${ARCH},aarch64)
-               $(error USE_SPINLOCK_CAS requires AArch64)
-        endif
-endif #(USE_SPINLOCK_CAS)
+include ${MAKE_HELPERS_DIRECTORY}constraints.mk
 
 # The cert_create tool cannot generate certificates individually, so we use the
 # target 'certificates' to create them all
@@ -814,65 +723,6 @@
 	FWU_FIP_DEPS += enctool
 endif #(DECRYPTION_SUPPORT)
 
-ifdef EL3_PAYLOAD_BASE
-	ifdef PRELOADED_BL33_BASE
-                $(warning "PRELOADED_BL33_BASE and EL3_PAYLOAD_BASE are \
-		incompatible build options. EL3_PAYLOAD_BASE has priority.")
-	endif
-	ifneq (${GENERATE_COT},0)
-                $(error "GENERATE_COT and EL3_PAYLOAD_BASE are incompatible \
-                build options.")
-	endif
-	ifneq (${TRUSTED_BOARD_BOOT},0)
-                $(error "TRUSTED_BOARD_BOOT and EL3_PAYLOAD_BASE are \
-                incompatible \ build options.")
-	endif
-endif #(EL3_PAYLOAD_BASE)
-
-ifeq (${NEED_BL33},yes)
-	ifdef EL3_PAYLOAD_BASE
-                $(warning "BL33 image is not needed when option \
-                BL33_PAYLOAD_BASE is used and won't be added to the FIP file.")
-	endif
-	ifdef PRELOADED_BL33_BASE
-                $(warning "BL33 image is not needed when option \
-                PRELOADED_BL33_BASE is used and won't be added to the FIP file.")
-	endif
-endif #(NEED_BL33)
-
-# When building for systems with hardware-assisted coherency, there's no need to
-# use USE_COHERENT_MEM. Require that USE_COHERENT_MEM must be set to 0 too.
-ifeq ($(HW_ASSISTED_COHERENCY)-$(USE_COHERENT_MEM),1-1)
-        $(error USE_COHERENT_MEM cannot be enabled with HW_ASSISTED_COHERENCY)
-endif
-
-#For now, BL2_IN_XIP_MEM is only supported when RESET_TO_BL2 is 1.
-ifeq ($(RESET_TO_BL2)-$(BL2_IN_XIP_MEM),0-1)
-        $(error "BL2_IN_XIP_MEM is only supported when RESET_TO_BL2 is enabled")
-endif
-
-# RAS_EXTENSION is deprecated, provide alternate build options
-ifeq ($(RAS_EXTENSION),1)
-        $(error "RAS_EXTENSION is now deprecated, please use ENABLE_FEAT_RAS \
-        and HANDLE_EA_EL3_FIRST_NS instead")
-endif
-
-
-# When FAULT_INJECTION_SUPPORT is used, require that FEAT_RAS is enabled
-ifeq ($(FAULT_INJECTION_SUPPORT),1)
-	ifeq ($(ENABLE_FEAT_RAS),0)
-                $(error For FAULT_INJECTION_SUPPORT, ENABLE_FEAT_RAS must not be 0)
-	endif
-endif #(FAULT_INJECTION_SUPPORT)
-
-# DYN_DISABLE_AUTH can be set only when TRUSTED_BOARD_BOOT=1
-ifeq ($(DYN_DISABLE_AUTH), 1)
-	ifeq (${TRUSTED_BOARD_BOOT}, 0)
-                $(error "TRUSTED_BOARD_BOOT must be enabled for DYN_DISABLE_AUTH \
-                to be set.")
-	endif
-endif #(DYN_DISABLE_AUTH)
-
 ifeq ($(MEASURED_BOOT)-$(TRUSTED_BOARD_BOOT),1-1)
 # Support authentication verification and hash calculation
 	CRYPTO_SUPPORT := 3
@@ -893,231 +743,6 @@
 CRYPTO_LIB := $(BUILD_PLAT)/lib/libmbedtls.a
 endif
 
-# SDEI_IN_FCONF is only supported when SDEI_SUPPORT is enabled.
-ifeq ($(SDEI_SUPPORT)-$(SDEI_IN_FCONF),0-1)
-        $(error "SDEI_IN_FCONF is only supported when SDEI_SUPPORT is enabled")
-endif
-
-# If pointer authentication is used in the firmware, make sure that all the
-# registers associated to it are also saved and restored.
-# Not doing it would leak the value of the keys used by EL3 to EL1 and S-EL1.
-ifneq ($(ENABLE_PAUTH),0)
-	ifeq ($(CTX_INCLUDE_PAUTH_REGS),0)
-                $(error Pointer Authentication requires CTX_INCLUDE_PAUTH_REGS to be enabled)
-	endif
-endif #(ENABLE_PAUTH)
-
-ifneq ($(CTX_INCLUDE_PAUTH_REGS),0)
-	ifneq (${ARCH},aarch64)
-                $(error CTX_INCLUDE_PAUTH_REGS requires AArch64)
-	endif
-endif #(CTX_INCLUDE_PAUTH_REGS)
-
-# Check ENABLE_FEAT_PAUTH_LR
-ifneq (${ENABLE_FEAT_PAUTH_LR},0)
-
-# Make sure PAUTH is enabled
-ifeq (${ENABLE_PAUTH},0)
-	$(error Error: PAUTH_LR cannot be used without PAUTH (see BRANCH_PROTECTION))
-endif
-
-# Make sure SCTLR2 is enabled
-ifeq (${ENABLE_FEAT_SCTLR2},0)
-	$(error Error: PAUTH_LR cannot be used without ENABLE_FEAT_SCTLR2)
-endif
-
-# FEAT_PAUTH_LR is only supported in aarch64 state
-ifneq (${ARCH},aarch64)
-	$(error ENABLE_FEAT_PAUTH_LR requires AArch64)
-endif
-
-# Currently, FEAT_PAUTH_LR is only supported by arm/clang compilers
-# TODO implement for GCC when support is added
-ifeq ($($(ARCH)-cc-id),arm-clang)
-	arch-features	:= $(arch-features)+pauth-lr
-else
-	$(error Error: ENABLE_FEAT_PAUTH_LR not supported for GCC compiler)
-endif
-
-endif # ${ENABLE_FEAT_PAUTH_LR}
-
-ifeq ($(FEATURE_DETECTION),1)
-        $(info FEATURE_DETECTION is an experimental feature)
-endif #(FEATURE_DETECTION)
-
-ifneq ($(ENABLE_SME2_FOR_NS), 0)
-	ifeq (${ENABLE_SME_FOR_NS}, 0)
-                $(warning "ENABLE_SME2_FOR_NS requires ENABLE_SME_FOR_NS also \
-                to be set")
-                $(warning "Forced ENABLE_SME_FOR_NS=1")
-		override ENABLE_SME_FOR_NS	:= 1
-	endif
-endif #(ENABLE_SME2_FOR_NS)
-
-ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1)
-	ifeq (${ALLOW_RO_XLAT_TABLES}, 1)
-                $(error "ALLOW_RO_XLAT_TABLES requires translation tables \
-                library v2")
-	endif
-endif #(ARM_XLAT_TABLES_LIB_V1)
-
-ifneq (${DECRYPTION_SUPPORT},none)
-	ifeq (${TRUSTED_BOARD_BOOT}, 0)
-                $(error TRUSTED_BOARD_BOOT must be enabled for DECRYPTION_SUPPORT \
-                to be set)
-	endif
-endif #(DECRYPTION_SUPPORT)
-
-# Ensure that no Aarch64-only features are enabled in Aarch32 build
-ifeq (${ARCH},aarch32)
-
-	# SME/SVE only supported on AArch64
-	ifneq (${ENABLE_SME_FOR_NS},0)
-                $(error "ENABLE_SME_FOR_NS cannot be used with ARCH=aarch32")
-	endif
-
-	ifeq (${ENABLE_SVE_FOR_NS},1)
-		# Warning instead of error due to CI dependency on this
-                $(error "ENABLE_SVE_FOR_NS cannot be used with ARCH=aarch32")
-	endif
-
-	# BRBE is not supported in AArch32
-	ifeq (${ENABLE_BRBE_FOR_NS},1)
-                $(error "ENABLE_BRBE_FOR_NS cannot be used with ARCH=aarch32")
-	endif
-
-	# FEAT_RNG_TRAP is not supported in AArch32
-	ifneq (${ENABLE_FEAT_RNG_TRAP},0)
-                $(error "ENABLE_FEAT_RNG_TRAP cannot be used with ARCH=aarch32")
-	endif
-
-	ifneq (${ENABLE_FEAT_FPMR},0)
-                $(error "ENABLE_FEAT_FPMR cannot be used with ARCH=aarch32")
-	endif
-
-	ifeq (${ARCH_FEATURE_AVAILABILITY},1)
-                $(error "ARCH_FEATURE_AVAILABILITY cannot be used with ARCH=aarch32")
-	endif
-	# FEAT_MOPS is only supported on AArch64
-	ifneq (${ENABLE_FEAT_MOPS},0)
-		$(error "ENABLE_FEAT_MOPS cannot be used with ARCH=aarch32")
-	endif
-	ifneq (${ENABLE_FEAT_GCIE},0)
-                $(error "ENABLE_FEAT_GCIE cannot be used with ARCH=aarch32")
-	endif
-endif #(ARCH=aarch32)
-
-ifneq (${ENABLE_FEAT_FPMR},0)
-	ifeq (${ENABLE_FEAT_FGT},0)
-                $(error "ENABLE_FEAT_FPMR requires ENABLE_FEAT_FGT")
-	endif
-	ifeq (${ENABLE_FEAT_HCX},0)
-                $(error "ENABLE_FEAT_FPMR requires ENABLE_FEAT_HCX")
-	endif
-endif #(ENABLE_FEAT_FPMR)
-
-ifneq (${ENABLE_SME_FOR_NS},0)
-	ifeq (${ENABLE_SVE_FOR_NS},0)
-                $(error "ENABLE_SME_FOR_NS requires ENABLE_SVE_FOR_NS")
-	endif
-endif #(ENABLE_SME_FOR_NS)
-
-# Secure SME/SVE requires the non-secure component as well
-ifeq (${ENABLE_SME_FOR_SWD},1)
-	ifeq (${ENABLE_SME_FOR_NS},0)
-                $(error "ENABLE_SME_FOR_SWD requires ENABLE_SME_FOR_NS")
-	endif
-	ifeq (${ENABLE_SVE_FOR_SWD},0)
-                $(error "ENABLE_SME_FOR_SWD requires ENABLE_SVE_FOR_SWD")
-	endif
-endif #(ENABLE_SME_FOR_SWD)
-
-# Enabling SVE for SWD requires enabling SVE for NWD due to ENABLE_FEAT
-# mechanism.
-ifeq (${ENABLE_SVE_FOR_SWD},1)
-    ifeq (${ENABLE_SVE_FOR_NS},0)
-        $(error "ENABLE_SVE_FOR_SWD requires ENABLE_SVE_FOR_NS")
-    endif
-endif
-
-# Enabling FEAT_MOPS requires access to hcrx_el2 registers which is
-# available only when FEAT_HCX is enabled.
-ifneq (${ENABLE_FEAT_MOPS},0)
-	ifeq (${ENABLE_FEAT_HCX},0)
-		$(error "ENABLE_FEAT_MOPS requires ENABLE_FEAT_HCX")
-	endif
-endif
-
-# Enabling SVE for both the worlds typically requires the context
-# management of SVE registers. The only exception being SPMC at S-EL2.
-ifeq (${ENABLE_SVE_FOR_SWD}, 1)
-    ifneq (${ENABLE_SVE_FOR_NS}, 0)
-        ifeq (${CTX_INCLUDE_SVE_REGS}-$(SPMD_SPM_AT_SEL2),0-0)
-            $(warning "ENABLE_SVE_FOR_SWD and ENABLE_SVE_FOR_NS together require CTX_INCLUDE_SVE_REGS")
-        endif
-    endif
-endif
-
-# Enabling SVE in either world while enabling CTX_INCLUDE_FPREGS requires
-# CTX_INCLUDE_SVE_REGS to be enabled due to architectural dependency between FP
-# and SVE registers.
-ifeq (${CTX_INCLUDE_FPREGS}, 1)
-    ifneq (${ENABLE_SVE_FOR_NS},0)
-        ifeq (${CTX_INCLUDE_SVE_REGS},0)
-	    # Warning instead of error due to CI dependency on this
-            $(warning "CTX_INCLUDE_FPREGS and ENABLE_SVE_FOR_NS together require CTX_INCLUDE_SVE_REGS")
-            $(warning "Forced ENABLE_SVE_FOR_NS=0")
-	    override ENABLE_SVE_FOR_NS	:= 0
-        endif
-    endif
-endif #(CTX_INCLUDE_FPREGS)
-
-# SVE context management is only required if secure world has access to SVE/FP
-# functionality.
-ifeq (${CTX_INCLUDE_SVE_REGS},1)
-    ifeq (${ENABLE_SVE_FOR_SWD},0)
-        $(error "CTX_INCLUDE_SVE_REGS requires ENABLE_SVE_FOR_SWD to also be enabled")
-    endif
-endif
-
-# SME cannot be used with CTX_INCLUDE_FPREGS since SPM does its own context
-# management including FPU registers.
-ifeq (${CTX_INCLUDE_FPREGS},1)
-    ifneq (${ENABLE_SME_FOR_NS},0)
-        $(error "ENABLE_SME_FOR_NS cannot be used with CTX_INCLUDE_FPREGS")
-    endif
-endif #(CTX_INCLUDE_FPREGS)
-
-ifeq ($(DRTM_SUPPORT),1)
-        $(info DRTM_SUPPORT is an experimental feature)
-endif
-
-ifeq (${HOB_LIST},1)
-        $(warning HOB_LIST is an experimental feature)
-endif
-
-ifeq (${TRANSFER_LIST},1)
-        $(info TRANSFER_LIST is an experimental feature)
-endif
-
-ifeq (${ENABLE_RME},1)
-	ifneq (${SEPARATE_CODE_AND_RODATA},1)
-                $(error `ENABLE_RME=1` requires `SEPARATE_CODE_AND_RODATA=1`)
-	endif
-endif
-
-ifeq ($(PSA_CRYPTO),1)
-        $(info PSA_CRYPTO is an experimental feature)
-endif
-
-ifeq ($(DICE_PROTECTION_ENVIRONMENT),1)
-        $(info DICE_PROTECTION_ENVIRONMENT is an experimental feature)
-endif
-
-ifeq (${LFA_SUPPORT},1)
-        $(warning LFA_SUPPORT is an experimental feature)
-endif #(LFA_SUPPORT)
-
 ################################################################################
 # Process platform overrideable behaviour
 ################################################################################
@@ -1382,6 +1007,7 @@
 	ENABLE_FEAT_TWED \
 	SVE_VECTOR_LEN \
 	IMPDEF_SYSREG_TRAP \
+	W \
 )))
 
 ifdef KEY_SIZE
@@ -1413,6 +1039,7 @@
 	EL3_EXCEPTION_HANDLING \
 	CTX_INCLUDE_EL2_REGS \
 	CTX_INCLUDE_NEVE_REGS \
+	DEBUG \
 	DECRYPTION_SUPPORT_${DECRYPTION_SUPPORT} \
 	DISABLE_MTPMU \
 	ENABLE_FEAT_AMU \
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk
index aa16751..e913abd 100644
--- a/make_helpers/build_macros.mk
+++ b/make_helpers/build_macros.mk
@@ -331,10 +331,10 @@
 $(eval OBJ := $(1)/$(patsubst %.c,%.o,$(notdir $(2))))
 $(eval DEP := $(patsubst %.o,%.d,$(OBJ)))
 
-$(eval BL_DEFINES := IMAGE_$(4) $($(4)_DEFINES) $(PLAT_BL_COMMON_DEFINES))
-$(eval BL_INCLUDE_DIRS := $($(4)_INCLUDE_DIRS) $(PLAT_BL_COMMON_INCLUDE_DIRS))
-$(eval BL_CPPFLAGS := $($(4)_CPPFLAGS) $(addprefix -D,$(BL_DEFINES)) $(addprefix -I,$(BL_INCLUDE_DIRS)) $(PLAT_BL_COMMON_CPPFLAGS))
-$(eval BL_CFLAGS := $($(4)_CFLAGS) $(PLAT_BL_COMMON_CFLAGS))
+$(eval BL_DEFINES := IMAGE_$(4) $($(4)_DEFINES))
+$(eval BL_INCLUDE_DIRS := $($(4)_INCLUDE_DIRS))
+$(eval BL_CPPFLAGS := $($(4)_CPPFLAGS) $(addprefix -D,$(BL_DEFINES)) $(addprefix -I,$(BL_INCLUDE_DIRS)))
+$(eval BL_CFLAGS := $($(4)_CFLAGS))
 
 $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $$$$(@D)/
 	$$(s)echo "  CC      $$<"
@@ -355,10 +355,10 @@
 $(eval OBJ := $(1)/$(patsubst %.S,%.o,$(notdir $(2))))
 $(eval DEP := $(patsubst %.o,%.d,$(OBJ)))
 
-$(eval BL_DEFINES := IMAGE_$(4) $($(4)_DEFINES) $(PLAT_BL_COMMON_DEFINES))
-$(eval BL_INCLUDE_DIRS := $($(4)_INCLUDE_DIRS) $(PLAT_BL_COMMON_INCLUDE_DIRS))
-$(eval BL_CPPFLAGS := $($(4)_CPPFLAGS) $(addprefix -D,$(BL_DEFINES)) $(addprefix -I,$(BL_INCLUDE_DIRS)) $(PLAT_BL_COMMON_CPPFLAGS))
-$(eval BL_ASFLAGS := $($(4)_ASFLAGS) $(PLAT_BL_COMMON_ASFLAGS))
+$(eval BL_DEFINES := IMAGE_$(4) $($(4)_DEFINES))
+$(eval BL_INCLUDE_DIRS := $($(4)_INCLUDE_DIRS))
+$(eval BL_CPPFLAGS := $($(4)_CPPFLAGS) $(addprefix -D,$(BL_DEFINES)) $(addprefix -I,$(BL_INCLUDE_DIRS)))
+$(eval BL_ASFLAGS := $($(4)_ASFLAGS))
 
 $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $$$$(@D)/
 	$$(s)echo "  AS      $$<"
@@ -378,9 +378,9 @@
 
 $(eval DEP := $(1).d)
 
-$(eval BL_DEFINES := IMAGE_$(4) $($(4)_DEFINES) $(PLAT_BL_COMMON_DEFINES))
-$(eval BL_INCLUDE_DIRS := $($(4)_INCLUDE_DIRS) $(PLAT_BL_COMMON_INCLUDE_DIRS))
-$(eval BL_CPPFLAGS := $($(4)_CPPFLAGS) $(addprefix -D,$(BL_DEFINES)) $(addprefix -I,$(BL_INCLUDE_DIRS)) $(PLAT_BL_COMMON_CPPFLAGS))
+$(eval BL_DEFINES := IMAGE_$(4) $($(4)_DEFINES))
+$(eval BL_INCLUDE_DIRS := $($(4)_INCLUDE_DIRS))
+$(eval BL_CPPFLAGS := $($(4)_CPPFLAGS) $(addprefix -D,$(BL_DEFINES)) $(addprefix -I,$(BL_INCLUDE_DIRS)))
 
 $(1): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | $$$$(@D)/
 	$$(s)echo "  PP      $$<"
diff --git a/make_helpers/constraints.mk b/make_helpers/constraints.mk
new file mode 100644
index 0000000..9e2e221
--- /dev/null
+++ b/make_helpers/constraints.mk
@@ -0,0 +1,385 @@
+#
+# Copyright (c) 2025, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+ifneq ($(AARCH32_INSTRUCTION_SET),$(filter $(AARCH32_INSTRUCTION_SET),A32 T32))
+         $(error Error: Unknown AArch32 instruction set ${AARCH32_INSTRUCTION_SET})
+endif
+
+ifneq (${ENABLE_RME},0)
+	ifneq (${ARCH},aarch64)
+                $(error ENABLE_RME requires AArch64)
+	endif
+	ifeq ($(SPMC_AT_EL3),1)
+                $(error SPMC_AT_EL3 and ENABLE_RME cannot both be enabled.)
+	endif
+
+	ifneq (${SPD}, none)
+		ifneq (${SPD}, spmd)
+                        $(error ENABLE_RME is incompatible with SPD=${SPD}. Use SPD=spmd)
+		endif
+	endif
+endif
+
+ifeq (${CTX_INCLUDE_EL2_REGS}, 1)
+	ifeq (${SPD},none)
+		ifeq (${ENABLE_RME},0)
+                        $(error CTX_INCLUDE_EL2_REGS is available only when SPD \
+                        or RME is enabled)
+		endif
+	endif
+endif
+
+################################################################################
+# Verify FEAT_RME, FEAT_SCTLR2 and FEAT_TCR2 are enabled if FEAT_MEC is enabled.
+################################################################################
+
+ifneq (${ENABLE_FEAT_MEC},0)
+    ifeq (${ENABLE_RME},0)
+        $(error FEAT_RME must be enabled when FEAT_MEC is enabled.)
+    endif
+    ifeq (${ENABLE_FEAT_TCR2},0)
+        $(error FEAT_TCR2 must be enabled when FEAT_MEC is enabled.)
+    endif
+    ifeq (${ENABLE_FEAT_SCTLR2},0)
+        $(error FEAT_SCTLR2 must be enabled when FEAT_MEC is enabled.)
+    endif
+endif
+
+# Handle all invalid build configurations with SPMD usage.
+ifeq (${ENABLE_SPMD_LP}, 1)
+ifneq (${SPD},spmd)
+	$(error Error: ENABLE_SPMD_LP requires SPD=spmd.)
+endif
+ifeq ($(SPMC_AT_EL3),1)
+	$(error SPMC at EL3 not supported when enabling SPMD Logical partitions.)
+endif
+endif
+
+ifneq (${SPD},none)
+ifeq (${ARCH},aarch32)
+	$(error "Error: SPD is incompatible with AArch32.")
+endif
+ifdef EL3_PAYLOAD_BASE
+	$(warning "SPD and EL3_PAYLOAD_BASE are incompatible build options.")
+	$(warning "The SPD and its BL32 companion will be present but ignored.")
+endif
+ifeq (${SPD},spmd)
+ifeq ($(SPMD_SPM_AT_SEL2),1)
+	ifeq ($(SPMC_AT_EL3),1)
+		$(error SPM cannot be enabled in both S-EL2 and EL3.)
+	endif
+	ifeq ($(CTX_INCLUDE_SVE_REGS),1)
+		$(error SVE context management not needed with Hafnium SPMC.)
+	endif
+endif
+
+ifeq ($(SPMC_AT_EL3_SEL0_SP),1)
+	ifneq ($(SPMC_AT_EL3),1)
+		$(error SEL0 SP cannot be enabled without SPMC at EL3)
+	endif
+endif
+endif #(SPD=spmd)
+endif #(SPD!=none)
+
+# USE_DEBUGFS experimental feature recommended only in debug builds
+ifeq (${USE_DEBUGFS},1)
+        ifeq (${DEBUG},1)
+                $(warning DEBUGFS experimental feature is enabled.)
+        else
+                $(warning DEBUGFS experimental, recommended in DEBUG builds ONLY)
+        endif
+endif #(USE_DEBUGFS)
+
+# USE_SPINLOCK_CAS requires AArch64 build
+ifeq (${USE_SPINLOCK_CAS},1)
+        ifneq (${ARCH},aarch64)
+               $(error USE_SPINLOCK_CAS requires AArch64)
+        endif
+endif #(USE_SPINLOCK_CAS)
+
+ifdef EL3_PAYLOAD_BASE
+	ifdef PRELOADED_BL33_BASE
+                $(warning "PRELOADED_BL33_BASE and EL3_PAYLOAD_BASE are \
+		incompatible build options. EL3_PAYLOAD_BASE has priority.")
+	endif
+	ifneq (${GENERATE_COT},0)
+                $(error "GENERATE_COT and EL3_PAYLOAD_BASE are incompatible \
+                build options.")
+	endif
+	ifneq (${TRUSTED_BOARD_BOOT},0)
+                $(error "TRUSTED_BOARD_BOOT and EL3_PAYLOAD_BASE are \
+                incompatible \ build options.")
+	endif
+endif #(EL3_PAYLOAD_BASE)
+
+ifeq (${NEED_BL33},yes)
+	ifdef EL3_PAYLOAD_BASE
+                $(warning "BL33 image is not needed when option \
+                BL33_PAYLOAD_BASE is used and won't be added to the FIP file.")
+	endif
+	ifdef PRELOADED_BL33_BASE
+                $(warning "BL33 image is not needed when option \
+                PRELOADED_BL33_BASE is used and won't be added to the FIP file.")
+	endif
+endif #(NEED_BL33)
+
+# When building for systems with hardware-assisted coherency, there's no need to
+# use USE_COHERENT_MEM. Require that USE_COHERENT_MEM must be set to 0 too.
+ifeq ($(HW_ASSISTED_COHERENCY)-$(USE_COHERENT_MEM),1-1)
+        $(error USE_COHERENT_MEM cannot be enabled with HW_ASSISTED_COHERENCY)
+endif
+
+#For now, BL2_IN_XIP_MEM is only supported when RESET_TO_BL2 is 1.
+ifeq ($(RESET_TO_BL2)-$(BL2_IN_XIP_MEM),0-1)
+        $(error "BL2_IN_XIP_MEM is only supported when RESET_TO_BL2 is enabled")
+endif
+
+# RAS_EXTENSION is deprecated, provide alternate build options
+ifeq ($(RAS_EXTENSION),1)
+        $(error "RAS_EXTENSION is now deprecated, please use ENABLE_FEAT_RAS \
+        and HANDLE_EA_EL3_FIRST_NS instead")
+endif
+
+
+# When FAULT_INJECTION_SUPPORT is used, require that FEAT_RAS is enabled
+ifeq ($(FAULT_INJECTION_SUPPORT),1)
+	ifeq ($(ENABLE_FEAT_RAS),0)
+                $(error For FAULT_INJECTION_SUPPORT, ENABLE_FEAT_RAS must not be 0)
+	endif
+endif #(FAULT_INJECTION_SUPPORT)
+
+# DYN_DISABLE_AUTH can be set only when TRUSTED_BOARD_BOOT=1
+ifeq ($(DYN_DISABLE_AUTH), 1)
+	ifeq (${TRUSTED_BOARD_BOOT}, 0)
+                $(error "TRUSTED_BOARD_BOOT must be enabled for DYN_DISABLE_AUTH \
+                to be set.")
+	endif
+endif #(DYN_DISABLE_AUTH)
+
+# SDEI_IN_FCONF is only supported when SDEI_SUPPORT is enabled.
+ifeq ($(SDEI_SUPPORT)-$(SDEI_IN_FCONF),0-1)
+        $(error "SDEI_IN_FCONF is only supported when SDEI_SUPPORT is enabled")
+endif
+
+# If pointer authentication is used in the firmware, make sure that all the
+# registers associated to it are also saved and restored.
+# Not doing it would leak the value of the keys used by EL3 to EL1 and S-EL1.
+ifneq ($(ENABLE_PAUTH),0)
+	ifeq ($(CTX_INCLUDE_PAUTH_REGS),0)
+                $(error Pointer Authentication requires CTX_INCLUDE_PAUTH_REGS to be enabled)
+	endif
+endif #(ENABLE_PAUTH)
+
+ifneq ($(CTX_INCLUDE_PAUTH_REGS),0)
+	ifneq (${ARCH},aarch64)
+                $(error CTX_INCLUDE_PAUTH_REGS requires AArch64)
+	endif
+endif #(CTX_INCLUDE_PAUTH_REGS)
+
+# Check ENABLE_FEAT_PAUTH_LR
+ifneq (${ENABLE_FEAT_PAUTH_LR},0)
+
+# Make sure PAUTH is enabled
+ifeq (${ENABLE_PAUTH},0)
+	$(error Error: PAUTH_LR cannot be used without PAUTH (see BRANCH_PROTECTION))
+endif
+
+# Make sure SCTLR2 is enabled
+ifeq (${ENABLE_FEAT_SCTLR2},0)
+	$(error Error: PAUTH_LR cannot be used without ENABLE_FEAT_SCTLR2)
+endif
+
+# FEAT_PAUTH_LR is only supported in aarch64 state
+ifneq (${ARCH},aarch64)
+	$(error ENABLE_FEAT_PAUTH_LR requires AArch64)
+endif
+
+# Currently, FEAT_PAUTH_LR is only supported by arm/clang compilers
+# TODO implement for GCC when support is added
+ifeq ($($(ARCH)-cc-id),arm-clang)
+	arch-features	:= $(arch-features)+pauth-lr
+else
+	$(error Error: ENABLE_FEAT_PAUTH_LR not supported for GCC compiler)
+endif
+
+endif # ${ENABLE_FEAT_PAUTH_LR}
+
+ifeq ($(FEATURE_DETECTION),1)
+        $(info FEATURE_DETECTION is an experimental feature)
+endif #(FEATURE_DETECTION)
+
+ifneq ($(ENABLE_SME2_FOR_NS), 0)
+	ifeq (${ENABLE_SME_FOR_NS}, 0)
+                $(warning "ENABLE_SME2_FOR_NS requires ENABLE_SME_FOR_NS also \
+                to be set")
+                $(warning "Forced ENABLE_SME_FOR_NS=1")
+		override ENABLE_SME_FOR_NS	:= 1
+	endif
+endif #(ENABLE_SME2_FOR_NS)
+
+ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1)
+	ifeq (${ALLOW_RO_XLAT_TABLES}, 1)
+                $(error "ALLOW_RO_XLAT_TABLES requires translation tables \
+                library v2")
+	endif
+endif #(ARM_XLAT_TABLES_LIB_V1)
+
+ifneq (${DECRYPTION_SUPPORT},none)
+	ifeq (${TRUSTED_BOARD_BOOT}, 0)
+                $(error TRUSTED_BOARD_BOOT must be enabled for DECRYPTION_SUPPORT \
+                to be set)
+	endif
+endif #(DECRYPTION_SUPPORT)
+
+# Ensure that no Aarch64-only features are enabled in Aarch32 build
+ifeq (${ARCH},aarch32)
+
+	# SME/SVE only supported on AArch64
+	ifneq (${ENABLE_SME_FOR_NS},0)
+                $(error "ENABLE_SME_FOR_NS cannot be used with ARCH=aarch32")
+	endif
+
+	ifeq (${ENABLE_SVE_FOR_NS},1)
+		# Warning instead of error due to CI dependency on this
+                $(error "ENABLE_SVE_FOR_NS cannot be used with ARCH=aarch32")
+	endif
+
+	# BRBE is not supported in AArch32
+	ifeq (${ENABLE_BRBE_FOR_NS},1)
+                $(error "ENABLE_BRBE_FOR_NS cannot be used with ARCH=aarch32")
+	endif
+
+	# FEAT_RNG_TRAP is not supported in AArch32
+	ifneq (${ENABLE_FEAT_RNG_TRAP},0)
+                $(error "ENABLE_FEAT_RNG_TRAP cannot be used with ARCH=aarch32")
+	endif
+
+	ifneq (${ENABLE_FEAT_FPMR},0)
+                $(error "ENABLE_FEAT_FPMR cannot be used with ARCH=aarch32")
+	endif
+
+	ifeq (${ARCH_FEATURE_AVAILABILITY},1)
+                $(error "ARCH_FEATURE_AVAILABILITY cannot be used with ARCH=aarch32")
+	endif
+	# FEAT_MOPS is only supported on AArch64
+	ifneq (${ENABLE_FEAT_MOPS},0)
+		$(error "ENABLE_FEAT_MOPS cannot be used with ARCH=aarch32")
+	endif
+	ifneq (${ENABLE_FEAT_GCIE},0)
+                $(error "ENABLE_FEAT_GCIE cannot be used with ARCH=aarch32")
+	endif
+endif #(ARCH=aarch32)
+
+ifneq (${ENABLE_FEAT_FPMR},0)
+	ifeq (${ENABLE_FEAT_FGT},0)
+                $(error "ENABLE_FEAT_FPMR requires ENABLE_FEAT_FGT")
+	endif
+	ifeq (${ENABLE_FEAT_HCX},0)
+                $(error "ENABLE_FEAT_FPMR requires ENABLE_FEAT_HCX")
+	endif
+endif #(ENABLE_FEAT_FPMR)
+
+ifneq (${ENABLE_SME_FOR_NS},0)
+	ifeq (${ENABLE_SVE_FOR_NS},0)
+                $(error "ENABLE_SME_FOR_NS requires ENABLE_SVE_FOR_NS")
+	endif
+endif #(ENABLE_SME_FOR_NS)
+
+# Secure SME/SVE requires the non-secure component as well
+ifeq (${ENABLE_SME_FOR_SWD},1)
+	ifeq (${ENABLE_SME_FOR_NS},0)
+                $(error "ENABLE_SME_FOR_SWD requires ENABLE_SME_FOR_NS")
+	endif
+	ifeq (${ENABLE_SVE_FOR_SWD},0)
+                $(error "ENABLE_SME_FOR_SWD requires ENABLE_SVE_FOR_SWD")
+	endif
+endif #(ENABLE_SME_FOR_SWD)
+
+# Enabling SVE for SWD requires enabling SVE for NWD due to ENABLE_FEAT
+# mechanism.
+ifeq (${ENABLE_SVE_FOR_SWD},1)
+    ifeq (${ENABLE_SVE_FOR_NS},0)
+        $(error "ENABLE_SVE_FOR_SWD requires ENABLE_SVE_FOR_NS")
+    endif
+endif
+
+# Enabling FEAT_MOPS requires access to hcrx_el2 registers which is
+# available only when FEAT_HCX is enabled.
+ifneq (${ENABLE_FEAT_MOPS},0)
+	ifeq (${ENABLE_FEAT_HCX},0)
+		$(error "ENABLE_FEAT_MOPS requires ENABLE_FEAT_HCX")
+	endif
+endif
+
+# Enabling SVE for both the worlds typically requires the context
+# management of SVE registers. The only exception being SPMC at S-EL2.
+ifeq (${ENABLE_SVE_FOR_SWD}, 1)
+    ifneq (${ENABLE_SVE_FOR_NS}, 0)
+        ifeq (${CTX_INCLUDE_SVE_REGS}-$(SPMD_SPM_AT_SEL2),0-0)
+            $(warning "ENABLE_SVE_FOR_SWD and ENABLE_SVE_FOR_NS together require CTX_INCLUDE_SVE_REGS")
+        endif
+    endif
+endif
+
+# Enabling SVE in either world while enabling CTX_INCLUDE_FPREGS requires
+# CTX_INCLUDE_SVE_REGS to be enabled due to architectural dependency between FP
+# and SVE registers.
+ifeq (${CTX_INCLUDE_FPREGS}, 1)
+    ifneq (${ENABLE_SVE_FOR_NS},0)
+        ifeq (${CTX_INCLUDE_SVE_REGS},0)
+	    # Warning instead of error due to CI dependency on this
+            $(warning "CTX_INCLUDE_FPREGS and ENABLE_SVE_FOR_NS together require CTX_INCLUDE_SVE_REGS")
+            $(warning "Forced ENABLE_SVE_FOR_NS=0")
+	    override ENABLE_SVE_FOR_NS	:= 0
+        endif
+    endif
+endif #(CTX_INCLUDE_FPREGS)
+
+# SVE context management is only required if secure world has access to SVE/FP
+# functionality.
+ifeq (${CTX_INCLUDE_SVE_REGS},1)
+    ifeq (${ENABLE_SVE_FOR_SWD},0)
+        $(error "CTX_INCLUDE_SVE_REGS requires ENABLE_SVE_FOR_SWD to also be enabled")
+    endif
+endif
+
+# SME cannot be used with CTX_INCLUDE_FPREGS since SPM does its own context
+# management including FPU registers.
+ifeq (${CTX_INCLUDE_FPREGS},1)
+    ifneq (${ENABLE_SME_FOR_NS},0)
+        $(error "ENABLE_SME_FOR_NS cannot be used with CTX_INCLUDE_FPREGS")
+    endif
+endif #(CTX_INCLUDE_FPREGS)
+
+ifeq ($(DRTM_SUPPORT),1)
+        $(info DRTM_SUPPORT is an experimental feature)
+endif
+
+ifeq (${HOB_LIST},1)
+        $(warning HOB_LIST is an experimental feature)
+endif
+
+ifeq (${TRANSFER_LIST},1)
+        $(info TRANSFER_LIST is an experimental feature)
+endif
+
+ifeq (${ENABLE_RME},1)
+	ifneq (${SEPARATE_CODE_AND_RODATA},1)
+                $(error `ENABLE_RME=1` requires `SEPARATE_CODE_AND_RODATA=1`)
+	endif
+endif
+
+ifeq ($(PSA_CRYPTO),1)
+        $(info PSA_CRYPTO is an experimental feature)
+endif
+
+ifeq ($(DICE_PROTECTION_ENVIRONMENT),1)
+        $(info DICE_PROTECTION_ENVIRONMENT is an experimental feature)
+endif
+
+ifeq (${LFA_SUPPORT},1)
+        $(warning LFA_SUPPORT is an experimental feature)
+endif #(LFA_SUPPORT)
diff --git a/make_helpers/defaults.mk b/make_helpers/defaults.mk
index b9df27e..516d9b4 100644
--- a/make_helpers/defaults.mk
+++ b/make_helpers/defaults.mk
@@ -10,6 +10,9 @@
 # poised to handle dependencies, as all build variables would have a default
 # value by then.
 
+# Warning level to give to the compiler
+W				:= 0
+
 # Use T32 by default
 AARCH32_INSTRUCTION_SET		:= T32
 
diff --git a/make_helpers/march.mk b/make_helpers/march.mk
index 8e73116..1a6e852 100644
--- a/make_helpers/march.mk
+++ b/make_helpers/march.mk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2023-2024, Arm Limited. All rights reserved.
+# Copyright (c) 2023-2025, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -82,6 +82,11 @@
 
 march-directive := -march=${provided-march}
 
+################################################################################
+# Get Architecture Feature Modifiers
+################################################################################
+arch-features		=	${ARM_ARCH_FEATURE}
+
 # Set the compiler's architecture feature modifiers
 ifneq ($(arch-features), none)
 	# Strip "none+" from arch-features
diff --git a/plat/arm/common/arm_common.mk b/plat/arm/common/arm_common.mk
index 6c2b1ba..e76f03b 100644
--- a/plat/arm/common/arm_common.mk
+++ b/plat/arm/common/arm_common.mk
@@ -515,14 +515,14 @@
 endif
 
 ifneq ($(COTDTPATH),)
-        cot-dt-defines = IMAGE_BL2 $(BL2_DEFINES) $(PLAT_BL_COMMON_DEFINES)
-        cot-dt-include-dirs = $(BL2_INCLUDE_DIRS) $(PLAT_BL_COMMON_INCLUDE_DIRS)
+        cot-dt-defines = IMAGE_BL2 $(BL2_DEFINES)
+        cot-dt-include-dirs = $(BL2_INCLUDE_DIRS)
 
         cot-dt-cpp-flags  = $(cot-dt-defines:%=-D%)
         cot-dt-cpp-flags += $(cot-dt-include-dirs:%=-I%)
 
-        cot-dt-cpp-flags += $(BL2_CPPFLAGS) $(PLAT_BL_COMMON_CPPFLAGS)
-        cot-dt-cpp-flags += $(CPPFLAGS) $(BL_CPPFLAGS) $(TF_CFLAGS_$(ARCH))
+        cot-dt-cpp-flags += $(BL2_CPPFLAGS)
+        cot-dt-cpp-flags += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH))
         cot-dt-cpp-flags += -c -x assembler-with-cpp -E -P -o $@ $<
 
         $(BUILD_PLAT)/$(COTDTPATH:.dtsi=.dts): $(COTDTPATH) | $$(@D)/
diff --git a/plat/intel/soc/common/socfpga_sip_svc.c b/plat/intel/soc/common/socfpga_sip_svc.c
index ff19e23..cbb366e 100644
--- a/plat/intel/soc/common/socfpga_sip_svc.c
+++ b/plat/intel/soc/common/socfpga_sip_svc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019-2023, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2019-2025, Arm Limited and Contributors. All rights reserved.
  * Copyright (c) 2019-2023, Intel Corporation. All rights reserved.
  * Copyright (c) 2024-2025, Altera Corporation. All rights reserved.
  *
@@ -1941,7 +1941,7 @@
 	uint32_t seu_respbuf[3];
 	int status = INTEL_SIP_SMC_STATUS_OK;
 	int mbox_status;
-	unsigned int len_in_resp;
+	unsigned int len_in_resp = 0;
 	u_register_t x5, x6, x7;
 
 	switch (smc_fid) {
diff --git a/plat/mediatek/mt8196/platform.mk b/plat/mediatek/mt8196/platform.mk
index e98ec4b..f473b8f 100644
--- a/plat/mediatek/mt8196/platform.mk
+++ b/plat/mediatek/mt8196/platform.mk
@@ -67,8 +67,7 @@
 MODULES-$(CONFIG_MTK_MTCMOS) += $(MTK_PLAT)/drivers/mtcmos
 
 ifneq ($(MTKLIB_PATH),)
-LDFLAGS += -L $(dir $(MTKLIB_PATH))
-LDLIBS += -Wl,--whole-archive -l$(patsubst lib%.a,%,$(notdir $(MTKLIB_PATH))) -Wl,--no-whole-archive
+LDLIBS += -Wl,--whole-archive $(MTKLIB_PATH) -Wl,--no-whole-archive
 endif
 
 PLAT_BL_COMMON_SOURCES := common/desc_image_load.c \
diff --git a/plat/qti/qcs615/platform.mk b/plat/qti/qcs615/platform.mk
index a3136cb..ff4489a 100644
--- a/plat/qti/qcs615/platform.mk
+++ b/plat/qti/qcs615/platform.mk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2024-2025, Arm Limited and Contributors. All rights reserved.
 # Copyright (c) 2024, The Linux Foundation. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
@@ -136,7 +136,6 @@
 BL31_SOURCES	+=	plat/qti/qtiseclib/src/qtiseclib_interface_stub.c
 else
 # use library provided by QTISECLIB_PATH
-LDFLAGS += -L $(dir $(QTISECLIB_PATH))
-LDLIBS += -l$(patsubst lib%.a,%,$(notdir $(QTISECLIB_PATH)))
+LDLIBS += $(QTISECLIB_PATH)
 endif
 
diff --git a/plat/qti/sc7180/platform.mk b/plat/qti/sc7180/platform.mk
index b576649..adbaea5 100644
--- a/plat/qti/sc7180/platform.mk
+++ b/plat/qti/sc7180/platform.mk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
+# Copyright (c) 2017-2025, Arm Limited and Contributors. All rights reserved.
 # Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
@@ -120,7 +120,6 @@
 BL31_SOURCES	+=	plat/qti/qtiseclib/src/qtiseclib_interface_stub.c
 else
 # use library provided by QTISECLIB_PATH
-LDFLAGS += -L $(dir $(QTISECLIB_PATH))
-LDLIBS += -l$(patsubst lib%.a,%,$(notdir $(QTISECLIB_PATH)))
+LDLIBS += $(QTISECLIB_PATH)
 endif