diff --git a/drivers/gpu/nvgpu/Makefile.shared.configs b/drivers/gpu/nvgpu/Makefile.shared.configs index 599a43266..b4b57f206 100644 --- a/drivers/gpu/nvgpu/Makefile.shared.configs +++ b/drivers/gpu/nvgpu/Makefile.shared.configs @@ -106,7 +106,7 @@ NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_COMPRESSION # Flags enabled for only the regular build profile. # ifneq ($(profile),safety) -# Enable logging for non-safety builds +# Enable logging for non-safety and safety-debug builds CONFIG_NVGPU_LOGGING := 1 NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_LOGGING diff --git a/userspace/Makefile b/userspace/Makefile index 119b0d38c..e90303b05 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -65,8 +65,15 @@ CONFIGS := -D__NVGPU_POSIX__ \ -DNVGPU_UNITTEST_FAULT_INJECTION_ENABLEMENT \ -D__NVGPU_UNIT_TEST__ -NVGPU_FORCE_SAFETY_PROFILE := 1 +# For target "libnvgpu", safety profile should be used +# safety-debug profile is used otherwise +ifeq ( ,$(findstring libnvgpu, '$(MAKECMDGOALS)')) NVGPU_FORCE_DEBUG_PROFILE := 1 +else +NVGPU_FORCE_DEBUG_PROFILE := 0 +endif + +NVGPU_FORCE_SAFETY_PROFILE := 1 include $(NVGPU_SRC)/Makefile.shared.configs CONFIGS+=$(NVGPU_COMMON_CFLAGS)