RK3368 GPU version Rogue M 1.28
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / rogue_m / build / linux / moduledefs / target_x86_64.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) -march=x86-64
43 MODULE_CXX := $(CXX) -march=x86-64
44
45 MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags) -march=x86-64
46 MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags) -march=x86-64
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 # Linker flags used to find system libraries.
54 MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \
55  -L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib \
56  -Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib \
57  -L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64 \
58  -Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64
59
60 # Add architecture-specific Android include flags
61 MODULE_INCLUDE_FLAGS := \
62  -isystem $(ANDROID_ROOT)/bionic/libc/arch-x86_64/include \
63  -isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-x86 \
64  -isystem $(ANDROID_ROOT)/bionic/libm/include/amd64 \
65  $(MODULE_INCLUDE_FLAGS)
66
67 MODULE_LDFLAGS += $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS)
68
69 MODULE_EXE_LDFLAGS := \
70  -Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker64 \
71  -lc -ldl -lcutils
72 MODULE_LIB_LDFLAGS := $(MODULE_EXE_LDFLAGS)
73
74 MODULE_EXE_CRTBEGIN := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtbegin_dynamic.o
75 MODULE_EXE_CRTEND := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtend_android.o
76
77 MODULE_LIB_CRTBEGIN := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtbegin_so.o
78 MODULE_LIB_CRTEND := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtend_so.o
79
80 MODULE_LIBGCC := $(LIBGCC)
81 else
82 # On Linux, we currently don't need to specify any flags to find the system
83 # libraries.
84 MODULE_SYSTEM_LIBRARY_DIR_FLAGS :=
85 endif
86
87 ifneq ($(BUILD),debug)
88 ifeq ($(USE_LTO),1)
89 MODULE_LDFLAGS := \
90  $(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \
91  $(MODULE_LDFLAGS)
92 endif
93 endif
94
95 MODULE_ARCH_BITNESS := 64
96
97 # Neutrino qcc requires "-Wc," prefix for compiler flags
98 ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
99 include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk
100 endif