RK3368 GPU version Rogue M 1.28
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / rogue_m / build / linux / moduledefs / target_aarch64.mk
1 ########################################################################### ###
2 #@File
3 #@Copyright     Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4 #@License       Dual MIT/GPLv2
5
6 # The contents of this file are subject to the MIT license as set out below.
7
8 # Permission is hereby granted, free of charge, to any person obtaining a copy
9 # of this software and associated documentation files (the "Software"), to deal
10 # in the Software without restriction, including without limitation the rights
11 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 # copies of the Software, and to permit persons to whom the Software is
13 # furnished to do so, subject to the following conditions:
14
15 # The above copyright notice and this permission notice shall be included in
16 # all copies or substantial portions of the Software.
17
18 # Alternatively, the contents of this file may be used under the terms of
19 # the GNU General Public License Version 2 ("GPL") in which case the provisions
20 # of GPL are applicable instead of those above.
21
22 # If you wish to allow use of your version of this file only under the terms of
23 # GPL, and not to allow others to use your version of this file under the terms
24 # of the MIT license, indicate your decision by deleting the provisions above
25 # and replace them with the notice and other provisions required by GPL as set
26 # out in the file called "GPL-COPYING" included in this distribution. If you do
27 # not delete the provisions above, a recipient may use your version of this file
28 # under the terms of either the MIT license or GPL.
29
30 # This License is also included in this distribution in the file called
31 # "MIT-COPYING".
32
33 # EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
34 # PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
35 # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
36 # PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
37 # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
38 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
39 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40 ### ###########################################################################
41
42 MODULE_CC := $(CC)
43 MODULE_CXX := $(CXX)
44
45 MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags)
46 MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags)
47 MODULE_LDFLAGS := $(ALL_LDFLAGS) $($(THIS_MODULE)_ldflags) -L$(MODULE_OUT) -Xlinker -rpath-link=$(MODULE_OUT)
48
49 # Since this is a target module, add system-specific include flags.
50 MODULE_INCLUDE_FLAGS := $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS)
51
52 ifneq ($(SUPPORT_ANDROID_PLATFORM),)
53 _obj := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj
54
55 # Linker flags used to find system libraries.
56 MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \
57  -L$(_obj)/lib \
58  -Xlinker -rpath-link=$(_obj)/lib \
59  -L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64 \
60  -Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64
61
62 # Add architecture-specific Android include flags
63 MODULE_INCLUDE_FLAGS := \
64  -isystem $(ANDROID_ROOT)/bionic/libc/arch-arm64/include \
65  -isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-arm64 \
66  -isystem $(ANDROID_ROOT)/bionic/libm/include/arm64 \
67  $(MODULE_INCLUDE_FLAGS)
68
69 MODULE_LDFLAGS += $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS)
70
71 MODULE_EXE_LDFLAGS := \
72  -Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker64 \
73  -lc -ldl -lcutils
74 MODULE_LIB_LDFLAGS := $(MODULE_EXE_LDFLAGS)
75
76 MODULE_EXE_CRTBEGIN := $(_obj)/lib/crtbegin_dynamic.o
77 MODULE_EXE_CRTEND := $(_obj)/lib/crtend_android.o
78
79 MODULE_LIB_CRTBEGIN := $(_obj)/lib/crtbegin_so.o
80 MODULE_LIB_CRTEND := $(_obj)/lib/crtend_so.o
81
82 MODULE_LIBGCC := $(LIBGCC)
83 endif
84
85 ifneq ($(BUILD),debug)
86 ifeq ($(USE_LTO),1)
87 MODULE_LDFLAGS := \
88  $(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \
89  $(MODULE_LDFLAGS)
90 endif
91 endif
92
93 MODULE_ARCH_BITNESS := 64
94
95 # Neutrino qcc requires "-Wc," prefix for compiler flags
96 ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
97 include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk
98 endif