From 5d6536b48fd56c0bd8743126d16e61a688db335e Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Tue, 9 Jul 2019 09:40:36 -0400 Subject: [PATCH] gpu: nvgpu: unit: libnvgpu-fifo for host makefiles channel and tsg units used to build object files from upper fifo directory. But this was causing build dependencies issues and stale .o files could be used. Fixed this by building a shared library for nvgpu-fifo for host makefiles. Jira NVGPU-3480 Change-Id: I32655c207f48baa5cde40846ae5a276c7c8fa6fd Signed-off-by: Thomas Fleury Reviewed-on: https://git-master.nvidia.com/r/2150370 GVS: Gerrit_Virtual_Submit Reviewed-by: Vedashree Vidwans Tested-by: Vedashree Vidwans Reviewed-by: Adeel Raza Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/Makefile | 2 +- userspace/Makefile.sources | 1 + userspace/units/fifo/Makefile | 27 +++++++++++++++++++++++++++ userspace/units/fifo/channel/Makefile | 9 ++++++++- userspace/units/fifo/tsg/Makefile | 8 +++++++- 5 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 userspace/units/fifo/Makefile diff --git a/userspace/Makefile b/userspace/Makefile index 42e7d1765..9515dc902 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -88,7 +88,7 @@ CFLAGS = -Wall -Wextra -ggdb -Werror -Wno-unused-parameter \ -Wmultichar -Wunused -Wmissing-braces -Wstrict-aliasing \ -Wsign-compare -Waddress -Wno-unused-local-typedefs -fPIC \ -Wno-maybe-uninitialized $(INCLUDES) $(CONFIGS) -LIB_PATHS = -L$(OUT) +LIB_PATHS = -L$(OUT) -L$(UNIT_OUT) LIBS = -lpthread -pthread -lgcov -ldl diff --git a/userspace/Makefile.sources b/userspace/Makefile.sources index 6647c336d..014914872 100644 --- a/userspace/Makefile.sources +++ b/userspace/Makefile.sources @@ -63,6 +63,7 @@ UNITS := \ $(UNIT_SRC)/mm/page_table_faults \ $(UNIT_SRC)/mm/nvgpu_mem \ $(UNIT_SRC)/mm/vm \ + $(UNIT_SRC)/fifo \ $(UNIT_SRC)/fifo/channel \ $(UNIT_SRC)/fifo/runlist \ $(UNIT_SRC)/fifo/tsg \ diff --git a/userspace/units/fifo/Makefile b/userspace/units/fifo/Makefile new file mode 100644 index 000000000..34ca4c543 --- /dev/null +++ b/userspace/units/fifo/Makefile @@ -0,0 +1,27 @@ +# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +.SUFFIXES: + +OBJS = nvgpu-fifo.o nvgpu-fifo-gv11b.o + +MODULE = nvgpu-fifo + +include ../Makefile.units \ No newline at end of file diff --git a/userspace/units/fifo/channel/Makefile b/userspace/units/fifo/channel/Makefile index e2e23bbc4..d1a46e80b 100644 --- a/userspace/units/fifo/channel/Makefile +++ b/userspace/units/fifo/channel/Makefile @@ -20,7 +20,14 @@ .SUFFIXES: -OBJS = nvgpu-channel.o ../nvgpu-fifo.o ../nvgpu-fifo-gv11b.o +OBJS = nvgpu-channel.o MODULE = nvgpu-channel +LIB_PATHS += -lnvgpu-fifo include ../../Makefile.units + +lib$(MODULE).so: fifo + +fifo: + $(MAKE) -C .. + diff --git a/userspace/units/fifo/tsg/Makefile b/userspace/units/fifo/tsg/Makefile index e7d093bdf..096232cc2 100644 --- a/userspace/units/fifo/tsg/Makefile +++ b/userspace/units/fifo/tsg/Makefile @@ -20,7 +20,13 @@ .SUFFIXES: -OBJS = nvgpu-tsg.o ../nvgpu-fifo.o ../nvgpu-fifo-gv11b.o +OBJS = nvgpu-tsg.o MODULE = nvgpu-tsg +LIB_PATHS += -lnvgpu-fifo include ../../Makefile.units + +lib$(MODULE).so: fifo + +fifo: + $(MAKE) -C ..