diff --git a/Makefile.umbrella.tmk b/Makefile.umbrella.tmk index e43bf3428..c574adcbb 100644 --- a/Makefile.umbrella.tmk +++ b/Makefile.umbrella.tmk @@ -32,6 +32,18 @@ NV_REPOSITORY_COMPONENTS := ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_INTEGRITY),1) + +ifeq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1) +ifeq ($(NV_BUILD_CONFIGURATION_IS_SAFETY),1) +# On QNX, the unit tests are built only for safety profile. +build_nvgpu_ut := 1 +endif +else +# On L4T, the unit tests are built with safety profile forced. +build_nvgpu_ut := 1 +endif + +ifeq ($(build_nvgpu_ut),1) NV_REPOSITORY_COMPONENTS := drivers/gpu/nvgpu NV_REPOSITORY_COMPONENTS += userspace NV_REPOSITORY_COMPONENTS += userspace/units/posix/bitops @@ -148,6 +160,7 @@ NV_REPOSITORY_COMPONENTS += userspace/units/sync NV_REPOSITORY_COMPONENTS += userspace/units/mock-iospace NV_REPOSITORY_COMPONENTS += userspace/units/ecc endif +endif # Local Variables: # indent-tabs-mode: t diff --git a/drivers/gpu/nvgpu/Makefile.tmk b/drivers/gpu/nvgpu/Makefile.tmk index 4ea5ea64b..fef42393c 100644 --- a/drivers/gpu/nvgpu/Makefile.tmk +++ b/drivers/gpu/nvgpu/Makefile.tmk @@ -51,14 +51,14 @@ NV_COMPONENT_INCLUDES := \ $(NVGPU_NEXT_SOURCE)/../../../include ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1) NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += pthread +NVGPU_FORCE_SAFETY_PROFILE := 1 +NVGPU_FORCE_DEBUG_PROFILE := 1 endif NV_COMPONENT_CFLAGS += \ -D__NVGPU_POSIX__ \ -DCONFIG_NVGPU_SUPPORT_TURING \ -D__NVGPU_UNIT_TEST__ -NVGPU_FORCE_SAFETY_PROFILE := 1 -NVGPU_FORCE_DEBUG_PROFILE := 1 -include $(NV_COMPONENT_DIR)/Makefile.shared.configs NV_COMPONENT_CFLAGS += $(NVGPU_COMMON_CFLAGS) diff --git a/userspace/Makefile b/userspace/Makefile index dfc297a4a..4ce634961 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -70,15 +70,9 @@ CONFIGS := -D__NVGPU_POSIX__ \ -DNVGPU_UNITTEST_FAULT_INJECTION_ENABLEMENT \ -D__NVGPU_UNIT_TEST__ -# 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 - +# safety-debug profile is used by default NVGPU_FORCE_SAFETY_PROFILE := 1 +NVGPU_FORCE_DEBUG_PROFILE := 1 include $(NVGPU_SRC)/Makefile.shared.configs CONFIGS+=$(NVGPU_COMMON_CFLAGS) diff --git a/userspace/Makefile.tmk b/userspace/Makefile.tmk index c848ede93..264edcc82 100644 --- a/userspace/Makefile.tmk +++ b/userspace/Makefile.tmk @@ -137,14 +137,14 @@ NV_COMPONENT_INCLUDES := \ ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1) NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += pthread NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += dl +NVGPU_FORCE_SAFETY_PROFILE := 1 +NVGPU_FORCE_DEBUG_PROFILE := 1 endif NV_COMPONENT_CFLAGS += \ -D__NVGPU_POSIX__ \ -DNVGPU_UNITTEST_FAULT_INJECTION_ENABLEMENT -NVGPU_FORCE_SAFETY_PROFILE := 1 -NVGPU_FORCE_DEBUG_PROFILE := 1 -include ../drivers/gpu/nvgpu/Makefile.shared.configs NV_COMPONENT_CFLAGS += $(NVGPU_COMMON_CFLAGS) diff --git a/userspace/units/Makefile.units.common.tmk b/userspace/units/Makefile.units.common.tmk index f48776d72..3c3c1b35d 100644 --- a/userspace/units/Makefile.units.common.tmk +++ b/userspace/units/Makefile.units.common.tmk @@ -56,8 +56,11 @@ endif NV_COMPONENT_CFLAGS += -D__NVGPU_UNIT_TEST__ NV_COMPONENT_CFLAGS += -DNVGPU_UNITTEST_FAULT_INJECTION_ENABLEMENT +ifneq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1) NVGPU_FORCE_SAFETY_PROFILE := 1 NVGPU_FORCE_DEBUG_PROFILE := 1 +endif + -include $(NV_SOURCE)/kernel/nvgpu/drivers/gpu/nvgpu/Makefile.shared.configs NV_COMPONENT_CFLAGS += $(NVGPU_COMMON_CFLAGS)