From b97a322edae86bbfb37ebb53beaa6fbc2a9df9bd Mon Sep 17 00:00:00 2001 From: Nicolas Benech Date: Wed, 16 Jan 2019 10:57:46 -0500 Subject: [PATCH] gpu: nvgpu: Add missing Makefile definitions A previous change added more common files to the POSIX build and added flags to the on-target POSIX build. Those definitions were missing from the host POSIX build resulting in build failures. JIRA NVGPU-1734 Change-Id: I3edbe681a475df45c83eae828900c2612f9357b1 Signed-off-by: Nicolas Benech Reviewed-on: https://git-master.nvidia.com/r/1996565 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/Makefile | 13 +++++-------- userspace/Makefile.configs | 24 +++++++++++++++++++----- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/userspace/Makefile b/userspace/Makefile index 2dd8afc2a..164befaed 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -51,13 +51,14 @@ INCLUDES= \ -I$(TWD)/../include/uapi \ -I$(TWD)/include -CONFIGS=-D__NVGPU_POSIX__ +# Linuxy configs. We want these so that we can mirror builds from the actual +# Linux kernel. +include Makefile.configs # Compiler, c-flags, etc. # CC = clang CC = gcc -CFLAGS = -Wall -ggdb -Werror -fPIC $(INCLUDES) $(CONFIGS) CFLAGS = -Wall -Wextra -ggdb -Werror -Wno-unused-parameter \ -Wno-missing-field-initializers -Wformat -Wchar-subscripts \ -Wparentheses -Wtrigraphs -Wpointer-arith -Wmissing-declarations \ @@ -72,10 +73,6 @@ LIBS = -lpthread -pthread -lgcov -ldl # Source files. We expect $(OBJS) and $(HEADERS) to get filled in here. include Makefile.sources -# Linuxy configs. We want these so that we can mirror builds from the actual -# Linux kernel. -include Makefile.configs - all: $(OUT)/nvgpu_unit $(UNITS) # Convenience targets. @@ -105,7 +102,7 @@ $(NVGPU_OUT)/%.o : $(NVGPU_SRC)/%.c $(HEADERS) @if [ ! -d $(dir $@) ] ; then \ mkdir -p $(dir $@) ; \ fi - $(CC) --coverage $(CFLAGS) $(configs) -c -o $@ $< + $(CC) --coverage $(CFLAGS) -c -o $@ $< # Build target for unit test files. These are not part of the libnvgpu-drv.so. # These comprise the unit test framework. @@ -113,7 +110,7 @@ $(CORE_OUT)/%.o : $(CORE_SRC)/%.c $(CORE_HEADERS) @if [ ! -d $(dir $@) ] ; then \ mkdir -p $(dir $@) ; \ fi - $(CC) --coverage $(CFLAGS) $(configs) -c -o $@ $< + $(CC) --coverage $(CFLAGS) -c -o $@ $< # Certain variables should be exported to the unit test module builds. export TWD INCLUDES CONFIGS UNIT_SRC UNIT_OUT diff --git a/userspace/Makefile.configs b/userspace/Makefile.configs index d7e807af3..26e3c88b4 100644 --- a/userspace/Makefile.configs +++ b/userspace/Makefile.configs @@ -5,11 +5,25 @@ # that we potientially will want enabled in testing. # -configs := - # Enabled configs. -# None right now! +CONFIGS := \ + -D__NVGPU_POSIX__ \ + -DCONFIG_TEGRA_19x_GPU \ + -DCONFIG_TEGRA_GK20A_NVHOST \ + -DCONFIG_GK20A_CYCLE_STATS \ + -DCONFIG_TEGRA_T19X_GRHOST \ + -DCONFIG_NVGPU_SUPPORT_TURING \ + -DCONFIG_TEGRA_GK20A_PMU=1 \ + -DCONFIG_TEGRA_ACR=1 \ + -DCONFIG_TEGRA_GR_VIRTUALIZATION\ + -DNVCPU_IS_AARCH64=1 \ + -DCONFIG_TEGRA_IOVMM=0 \ + -DCONFIG_ARCH_TEGRA_18x_SOC=1 \ + -DCONFIG_GK20A_VIDMEM=1 \ + -DCONFIG_PCI_MSI \ + -DCONFIG_SUPPORT_PMU_PSTATE + # Uncomment these to enable the config. -# configs += -DCONFIG_NVGPU_TRACK_MEM_USAGE=y -# configs += -DCONFIG_GK20A_VIDMEM +# CONFIGS += -DCONFIG_NVGPU_TRACK_MEM_USAGE=y +# CONFIGS += -DCONFIG_GK20A_VIDMEM