summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew F. Davis2018-02-14 11:59:52 -0600
committerAndrew F. Davis2018-03-13 10:39:56 -0500
commitc82d194b93d36baf4772503e7ff8b8d6d9a1cc4b (patch)
treea403207522485634edc10a2399e9c1fa6454c6b0
parent86d145b73c81ad8580d243d11dacd310dec7a9f4 (diff)
downloaddevice-ti-proprietary-open-c82d194b93d36baf4772503e7ff8b8d6d9a1cc4b.tar.gz
device-ti-proprietary-open-c82d194b93d36baf4772503e7ff8b8d6d9a1cc4b.tar.xz
device-ti-proprietary-open-c82d194b93d36baf4772503e7ff8b8d6d9a1cc4b.zip
jacinto6: Update SGX KM source to DDK 1.17
Signed-off-by: Andrew F. Davis <afd@ti.com>
-rw-r--r--jacinto6/sgx/Android.mk2
-rw-r--r--jacinto6/sgx_src/Android.mk2
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/_objects.mk121
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/bits.mk5
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk41
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/commands.mk119
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch.mk107
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk149
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk56
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk103
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/install.sh.tpl315
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk13
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk117
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk15
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compiler.mk240
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-eabi.mk2
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-linux-androideabi.mk2
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/mips64el-linux-android.mk29
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk196
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/defs.mk79
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/jz4780_android/Makefile62
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/Makefile.template8
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/kbuild.mk34
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_module.mk18
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/host_x86_64.mk57
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/target_armv7-a.mk130
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/target_mips32r6el.mk134
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/target_neutral.mk45
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs_common.mk164
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_android/Makefile25
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/pvrversion.mk53
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/scripts.mk364
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/shared_library.mk210
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/sunxi_android/Makefile8
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk125
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/dbgdrvif.h3
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/img_defs.h5
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/img_types.h93
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/kernel_types.h136
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/pdumpdefs.h3
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/pvr_sync_user.h12
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/pvrversion.h14
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/services.h96
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/servicesext.h19
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/sgxapi_km.h21
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/sgxscript.h11
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/Kbuild.mk2
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/Linux.mk2
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw_linux.c5
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/Linux.mk8
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge.h879
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge_km.h13
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/include/servicesint.h9
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/include/sgx_bridge.h264
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/include/sgx_mkif_km.h11
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/include/sgxinfo.h32
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.c144
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/sgx/bridged_sgx_bridge.c63
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/buffer_manager.c2
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/deviceclass.c54
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/devicemem.c63
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pdump_common.c6
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c19
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/queue.c84
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/ra.c3
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/mmu.c41
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxinfokm.h17
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxinit.c17
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxkick.c86
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxtransfer.c72
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxutils.c2
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/Kbuild.mk12
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/dma_fence_sync_native_server.c94
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/dmabuf.c289
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/dmabuf.h49
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/linkage.h3
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mm.c22
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mmap.c16
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c17
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.c2
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.h6
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c78
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/proc.c7
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_bridge_k.c244
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_counting_timeline.c158
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_counting_timeline.h25
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_drm.c20
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_drm.h1
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_fence.c1681
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_fence.h252
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_linux_fence.c520
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_linux_fence.h14
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_sw_fence.c141
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_sw_fence.h17
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_sync.c417
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_sync.h197
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_sync_common.c379
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_sync_common.h90
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_sync_dma_fence.c812
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_uaccess.h3
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvrsrv_sync_server.h29
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/systrace.c194
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/systrace.h2
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/include/osfunc.h10
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/include/queue.h2
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/include/syscommon.h3
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/omap/sysconfig.h8
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/omap/sysinfo.h4
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/sgx_jz4780/oemfuncs.h97
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/sgx_jz4780/sysconfig.c949
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/sgx_jz4780/sysconfig.h80
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/sgx_jz4780/sysinfo.h54
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/sgx_jz4780/syslocal.h160
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/sgx_jz4780/sysutils.c398
-rw-r--r--jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/common/dbgdriv.c71
115 files changed, 10754 insertions, 2334 deletions
diff --git a/jacinto6/sgx/Android.mk b/jacinto6/sgx/Android.mk
index bfb50e3..9c6aa1b 100644
--- a/jacinto6/sgx/Android.mk
+++ b/jacinto6/sgx/Android.mk
@@ -28,7 +28,7 @@ LOCAL_PATH := $$(img-sgx.untarred_bin)
28include $$(BUILD_SYSTEM)/base_rules.mk 28include $$(BUILD_SYSTEM)/base_rules.mk
29$$(LOCAL_BUILT_MODULE) : PRIVATE_SRC := $$(img-sgx.untarred_bin)/$1 29$$(LOCAL_BUILT_MODULE) : PRIVATE_SRC := $$(img-sgx.untarred_bin)/$1
30$$(LOCAL_BUILT_MODULE) : $$(img-sgx.untarred_timestamp) | $$(ACP) 30$$(LOCAL_BUILT_MODULE) : $$(img-sgx.untarred_timestamp) | $$(ACP)
31 $(eval FIXED_SRC := $$(img-sgx.untarred_bin)/$(subst $(TARGET_BOARD_PLATFORM),jacinto6,$1)) 31 $(eval FIXED_SRC := $$(img-sgx.untarred_bin)/$1)
32 @echo "Copy $$@ <- $(FIXED_SRC)" 32 @echo "Copy $$@ <- $(FIXED_SRC)"
33 @mkdir -p $(dir $$@) 33 @mkdir -p $(dir $$@)
34 $$(hide) $$(ACP) -fp $(FIXED_SRC) $$@ 34 $$(hide) $$(ACP) -fp $(FIXED_SRC) $$@
diff --git a/jacinto6/sgx_src/Android.mk b/jacinto6/sgx_src/Android.mk
index 663404c..b5c011d 100644
--- a/jacinto6/sgx_src/Android.mk
+++ b/jacinto6/sgx_src/Android.mk
@@ -36,7 +36,7 @@ $(PVRSRVKM): $(local-build)/Makefile $(KERNELDIR)/.version
36 ANDROID_ROOT=$(ANDROID_BUILD_TOP) \ 36 ANDROID_ROOT=$(ANDROID_BUILD_TOP) \
37 PLATFORM_RELEASE="8.0" \ 37 PLATFORM_RELEASE="8.0" \
38 OUT=$(ANDROID_BUILD_TOP)/$(out-intermediates) 38 OUT=$(ANDROID_BUILD_TOP)/$(out-intermediates)
39 @$(ACP) -fp $(ANDROID_BUILD_TOP)/$(out-intermediates)/target/$(MODULE_TARGET) $@ 39 @$(ACP) -fp $(ANDROID_BUILD_TOP)/$(out-intermediates)/target_armv7-a/$(MODULE_TARGET) $@
40 @echo "Finished building $@" 40 @echo "Finished building $@"
41 41
42GEN := $(out-intermediates)/$(MODULE_TARGET) 42GEN := $(out-intermediates)/$(MODULE_TARGET)
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/_objects.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/_objects.mk
new file mode 100644
index 0000000..82da9d6
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/_objects.mk
@@ -0,0 +1,121 @@
1########################################################################### ###
2#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
3#@License Dual MIT/GPLv2
4#
5# The contents of this file are subject to the MIT license as set out below.
6#
7# Permission is hereby granted, free of charge, to any person obtaining a copy
8# of this software and associated documentation files (the "Software"), to deal
9# in the Software without restriction, including without limitation the rights
10# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11# copies of the Software, and to permit persons to whom the Software is
12# furnished to do so, subject to the following conditions:
13#
14# The above copyright notice and this permission notice shall be included in
15# all copies or substantial portions of the Software.
16#
17# Alternatively, the contents of this file may be used under the terms of
18# the GNU General Public License Version 2 ("GPL") in which case the provisions
19# of GPL are applicable instead of those above.
20#
21# If you wish to allow use of your version of this file only under the terms of
22# GPL, and not to allow others to use your version of this file under the terms
23# of the MIT license, indicate your decision by deleting the provisions above
24# and replace them with the notice and other provisions required by GPL as set
25# out in the file called "GPL-COPYING" included in this distribution. If you do
26# not delete the provisions above, a recipient may use your version of this file
27# under the terms of either the MIT license or GPL.
28#
29# This License is also included in this distribution in the file called
30# "MIT-COPYING".
31#
32# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
33# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
34# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
35# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
36# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
37# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
38# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39#@Description Common processing for all modules that compile code.
40### ###########################################################################
41
42# Filter for source types
43MODULE_C_SOURCES := $(filter %.c,$(MODULE_SOURCES))
44MODULE_CXX_SOURCES := $(filter %.cpp,$(MODULE_SOURCES))
45
46MODULE_UNRECOGNISED_SOURCES := $(filter-out %.c %.cpp, $(MODULE_SOURCES))
47
48ifneq ($(strip $(MODULE_UNRECOGNISED_SOURCES)),)
49$(error In makefile $(THIS_MAKEFILE): Module $(THIS_MODULE) specified source files with unrecognised suffixes: $(MODULE_UNRECOGNISED_SOURCES))
50endif
51
52# Objects built from MODULE_SOURCES
53# Objects built from MODULE_C_SOURCES and MODULE_CXX_SOURCES
54MODULE_C_OBJECTS := $(addprefix $(MODULE_INTERMEDIATES_DIR)/,$(foreach _cobj,$(MODULE_C_SOURCES:.c=.o),$(notdir $(_cobj))))
55MODULE_CXX_OBJECTS := $(addprefix $(MODULE_INTERMEDIATES_DIR)/,$(foreach _cxxobj,$(MODULE_CXX_SOURCES:.cpp=.o),$(notdir $(_cxxobj))))
56
57# MODULE_GENERATED_DEPENDENCIES are generated as a side effect of running the
58# rules below, but if we wanted to generate .d files for things that GCC
59# couldn't handle, we could add a rule with $(MODULE_GENERATED_DEPENDENCIES)
60# as a target
61MODULE_GENERATED_DEPENDENCIES := $(MODULE_C_OBJECTS:.o=.d) $(MODULE_CXX_OBJECTS:.o=.d)
62-include $(MODULE_GENERATED_DEPENDENCIES)
63
64MODULE_DEPENDS := $(addprefix $(MODULE_OUT)/,$($(THIS_MODULE)_depends))
65MODULE_DEPENDS += $(addprefix $(GENERATED_CODE_OUT)/,$($(THIS_MODULE)_genheaders))
66
67# Add any MODULE_OUT relative include flags here
68MODULE_INCLUDE_FLAGS += $(addprefix -I $(MODULE_OUT)/, $($(THIS_MODULE)_includes_relative))
69
70define rule-for-objects-o-from-one-c
71$(1): MODULE_CC := $$(MODULE_CC)
72$(1): MODULE_CFLAGS := $$(MODULE_CFLAGS)
73$(1): MODULE_HOST_CFLAGS := $$(MODULE_HOST_CFLAGS)
74$(1): MODULE_INCLUDE_FLAGS := $$(MODULE_INCLUDE_FLAGS)
75$(1): MODULE_ALLOWED_CFLAGS := $$(MODULE_ALLOWED_CFLAGS)
76$(1): THIS_MODULE := $$(THIS_MODULE)
77ifneq ($(PKG_CONFIG_ENV_VAR),)
78$(1): export PKG_CONFIG_TOP_BUILD_DIR := $(abspath $(MODULE_OUT))
79$(1): export $(PKG_CONFIG_ENV_VAR) := $(abspath $(MODULE_OUT)/pkgconfig)
80endif
81$(1): export PKG_CONFIG_SYSROOT_DIR := $(PKG_CONFIG_SYSROOT_DIR)
82$(1): $$(MODULE_DEPENDS) $$(THIS_MAKEFILE)
83$(1): | $$(MODULE_INTERMEDIATES_DIR)
84$(1): $(2)
85 @: $(if $(MODULE_CHECK_CFLAGS),
86 $(if $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cflags)),\
87 $(error $(THIS_MODULE): LTO-incompatible cflag(s) used: \
88 $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cflags)))))
89 $$(check-src)
90ifeq ($(MODULE_HOST_BUILD),true)
91 $$(host-o-from-one-c)
92else
93 $$(target-o-from-one-c)
94endif
95endef
96
97# This rule is used to compile C++ source files
98define rule-for-objects-o-from-one-cxx
99$(1): MODULE_CXX := $$(MODULE_CXX)
100$(1): MODULE_CXXFLAGS := $$(MODULE_CXXFLAGS)
101$(1): MODULE_HOST_CXXFLAGS := $$(MODULE_HOST_CXXFLAGS)
102$(1): MODULE_INCLUDE_FLAGS := $$(MODULE_INCLUDE_FLAGS)
103$(1): MODULE_ALLOWED_CFLAGS := $$(MODULE_ALLOWED_CFLAGS)
104$(1): THIS_MODULE := $$(THIS_MODULE)
105ifneq ($(PKG_CONFIG_ENV_VAR),)
106$(1): export PKG_CONFIG_TOP_BUILD_DIR := $(abspath $(MODULE_OUT))
107$(1): export $(PKG_CONFIG_ENV_VAR) := $(abspath $(MODULE_OUT)/pkgconfig)
108endif
109$(1): $$(MODULE_DEPENDS) $$(THIS_MAKEFILE)
110$(1): | $$(MODULE_INTERMEDIATES_DIR)
111$(1): $(2)
112 @: $(if $(MODULE_CHECK_CFLAGS),
113 $(if $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cxxflags)),\
114 $(error $(THIS_MODULE): LTO-incompatible cxxflag(s) used: \
115 $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cxxflags)))))
116ifeq ($(MODULE_HOST_BUILD),true)
117 $$(host-o-from-one-cxx)
118else
119 $$(target-o-from-one-cxx)
120endif
121endef
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/bits.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/bits.mk
index d04aa7b..b6bcbbc 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/bits.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/bits.mk
@@ -50,8 +50,9 @@ $(foreach _module_to_find,$(patsubst whereis-%,%,$(filter whereis-%,$(MAKECMDGOA
50endif 50endif
51 51
52ifneq ($(filter whatis-%,$(MAKECMDGOALS)),) 52ifneq ($(filter whatis-%,$(MAKECMDGOALS)),)
53whatis-$(RELATIVE_OUT)/target/%: ; 53whatis-$(HOST_OUT)/%: ;
54whatis-$(RELATIVE_OUT)/host/%: ; 54whatis-$(TARGET_PRIMARY_OUT)/%: ;
55whatis-$(TARGET_NEUTRAL_OUT)/%: ;
55$(foreach _file_to_find,$(patsubst whatis-%,%,$(filter whatis-%,$(MAKECMDGOALS))),$(info $(strip $(foreach _m,$(ALL_MODULES),$(if $(filter $(_file_to_find),$(INTERNAL_TARGETS_FOR_$(_m))),$(_file_to_find) is in $(_m) which is defined in $(INTERNAL_MAKEFILE_FOR_MODULE_$(_m)),))))) 56$(foreach _file_to_find,$(patsubst whatis-%,%,$(filter whatis-%,$(MAKECMDGOALS))),$(info $(strip $(foreach _m,$(ALL_MODULES),$(if $(filter $(_file_to_find),$(INTERNAL_TARGETS_FOR_$(_m))),$(_file_to_find) is in $(_m) which is defined in $(INTERNAL_MAKEFILE_FOR_MODULE_$(_m)),)))))
56endif 57endif
57 58
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk
index f20ee5b..4d4afa6 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk
@@ -46,6 +46,9 @@
46# COMMON_CFLAGS or COMMON_USER_FLAGS. These flags are shared between 46# COMMON_CFLAGS or COMMON_USER_FLAGS. These flags are shared between
47# host and target, which might use compilers with different capabilities. 47# host and target, which might use compilers with different capabilities.
48 48
49# ANOTHER NOTE: All flags here must be architecture-independent (i.e. no
50# -march or toolchain include paths)
51
49# These flags are used for kernel, User C and User C++ 52# These flags are used for kernel, User C and User C++
50# 53#
51COMMON_FLAGS := -W -Wall 54COMMON_FLAGS := -W -Wall
@@ -54,7 +57,7 @@ COMMON_FLAGS := -W -Wall
54# 57#
55COMMON_CFLAGS := $(COMMON_FLAGS) \ 58COMMON_CFLAGS := $(COMMON_FLAGS) \
56 -Wdeclaration-after-statement -Wno-format-zero-length \ 59 -Wdeclaration-after-statement -Wno-format-zero-length \
57 -Wstrict-prototypes 60 -Wmissing-prototypes -Wstrict-prototypes
58 61
59# User C and User C++ optimization control. Does not affect kernel. 62# User C and User C++ optimization control. Does not affect kernel.
60# 63#
@@ -76,7 +79,7 @@ COMMON_USER_FLAGS += -fno-strict-aliasing
76# We always enable debugging. Either the release binaries are stripped 79# We always enable debugging. Either the release binaries are stripped
77# and the symbols put in the symbolpackage, or we're building debug. 80# and the symbols put in the symbolpackage, or we're building debug.
78# 81#
79COMMON_USER_FLAGS += -g $(ANDROID_FPGA_FORCE_32BIT) 82COMMON_USER_FLAGS += -g
80 83
81# User C and User C++ warning flags 84# User C and User C++ warning flags
82# 85#
@@ -164,6 +167,7 @@ KBUILD_FLAGS := \
164# androideabi toolchain adds `pic` by default, disable it 167# androideabi toolchain adds `pic` by default, disable it
165# for kernel module build 168# for kernel module build
166KBUILD_FLAGS += -fno-pic 169KBUILD_FLAGS += -fno-pic
170KBUILD_FLAGS += -fstack-protector-strong
167 171
168TESTED_KBUILD_FLAGS := \ 172TESTED_KBUILD_FLAGS := \
169 $(call kernel-cc-option,-Wmissing-include-dirs) \ 173 $(call kernel-cc-option,-Wmissing-include-dirs) \
@@ -171,6 +175,7 @@ TESTED_KBUILD_FLAGS := \
171 $(call kernel-cc-option,-Wno-pointer-arith) \ 175 $(call kernel-cc-option,-Wno-pointer-arith) \
172 $(call kernel-cc-option,-Wno-aggregate-return) \ 176 $(call kernel-cc-option,-Wno-aggregate-return) \
173 $(call kernel-cc-option,-Wno-unused-but-set-variable) \ 177 $(call kernel-cc-option,-Wno-unused-but-set-variable) \
178 $(call kernel-cc-option,-Wno-ignored-qualifiers) \
174 $(call kernel-cc-option,-Wno-old-style-declaration) \ 179 $(call kernel-cc-option,-Wno-old-style-declaration) \
175 $(call kernel-cc-optional-warning,-Wbad-function-cast) \ 180 $(call kernel-cc-optional-warning,-Wbad-function-cast) \
176 $(call kernel-cc-optional-warning,-Wcast-qual) \ 181 $(call kernel-cc-optional-warning,-Wcast-qual) \
@@ -233,25 +238,18 @@ ALL_KBUILD_CFLAGS := $(COMMON_CFLAGS) $(KBUILD_FLAGS) $(TESTED_KBUILD_FLAGS)
233# For the same reason (Darwin 'ld') don't bother checking for text 238# For the same reason (Darwin 'ld') don't bother checking for text
234# relocations in host binaries. 239# relocations in host binaries.
235# 240#
236ALL_HOST_LDFLAGS := -L$(HOST_OUT) 241ALL_HOST_LDFLAGS :=
237ALL_LDFLAGS := \ 242ALL_LDFLAGS := -Wl,--warn-shared-textrel
238 -Wl,--warn-shared-textrel \
239 -L$(TARGET_OUT) -Xlinker -rpath-link=$(TARGET_OUT)
240
241ifneq ($(strip $(TOOLCHAIN)),)
242ALL_LDFLAGS += -L$(TOOLCHAIN)/lib -Xlinker -rpath-link=$(TOOLCHAIN)/lib
243endif
244 243
245ifneq ($(strip $(TOOLCHAIN2)),) 244ALL_LDFLAGS += $(SYS_LDFLAGS)
246ALL_LDFLAGS += -L$(TOOLCHAIN2)/lib -Xlinker -rpath-link=$(TOOLCHAIN2)/lib
247endif
248 245
249ifneq ($(strip $(LINKER_RPATH)),) 246# Optional security hardening features.
250ALL_LDFLAGS += $(addprefix -Xlinker -rpath=,$(LINKER_RPATH)) 247ifneq ($(FORTIFY),)
248ALL_CFLAGS += -fstack-protector -Wa,--noexecstack -D_FORTIFY_SOURCE=2
249ALL_CXXFLAGS += -fstack-protector -Wa,--noexecstack -D_FORTIFY_SOURCE=2
250ALL_LDFLAGS += -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
251endif 251endif
252 252
253ALL_LDFLAGS += $(SYS_LDFLAGS)
254
255# This variable contains a list of all modules built by kbuild 253# This variable contains a list of all modules built by kbuild
256ALL_KBUILD_MODULES := 254ALL_KBUILD_MODULES :=
257 255
@@ -259,4 +257,11 @@ ALL_KBUILD_MODULES :=
259ALL_CXX_MODULES := 257ALL_CXX_MODULES :=
260 258
261# Toolchain triple for cross environment 259# Toolchain triple for cross environment
262CROSS_TRIPLE := $(patsubst %-,%,$(CROSS_COMPILE)) 260CROSS_TRIPLE := $(patsubst %-,%,$(notdir $(CROSS_COMPILE)))
261
262ifneq ($(TOOLCHAIN),)
263$(warning **********************************************)
264$(warning The TOOLCHAIN option has been removed, but)
265$(warning you have it set (via $(origin TOOLCHAIN)))
266$(warning **********************************************)
267endif
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/commands.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/commands.mk
index ab7a0e9..d4876c9 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/commands.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/commands.mk
@@ -49,79 +49,79 @@
49 49
50define host-o-from-one-c 50define host-o-from-one-c
51$(if $(V),,@echo " HOST_CC " $(call relative-to-top,$<)) 51$(if $(V),,@echo " HOST_CC " $(call relative-to-top,$<))
52$(HOST_CC) -MD -c $(MODULE_HOST_CFLAGS) $(MODULE_INCLUDE_FLAGS) \ 52$(MODULE_CC) -MD -c $(MODULE_HOST_CFLAGS) $(MODULE_INCLUDE_FLAGS) \
53 -include $(CONFIG_H) $< -o $@ 53 -include $(CONFIG_H) $< -o $@
54endef 54endef
55 55
56define target-o-from-one-c 56define target-o-from-one-c
57$(if $(V),,@echo " CC " $(call relative-to-top,$<)) 57$(if $(V),,@echo " CC " $(call relative-to-top,$<))
58$(CC) -MD -c $(MODULE_CFLAGS) $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) \ 58$(MODULE_CC) -MD -c $(MODULE_CFLAGS) $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) \
59 -include $(CONFIG_H) $< -o $@ 59 -include $(CONFIG_H) $< -o $@
60endef 60endef
61 61
62define host-o-from-one-cxx 62define host-o-from-one-cxx
63$(if $(V),,@echo " HOST_CXX" $(call relative-to-top,$<)) 63$(if $(V),,@echo " HOST_CXX" $(call relative-to-top,$<))
64$(HOST_CXX) -MD -c $(MODULE_HOST_CXXFLAGS) $(MODULE_INCLUDE_FLAGS) \ 64$(MODULE_CXX) -MD -c $(MODULE_HOST_CXXFLAGS) $(MODULE_INCLUDE_FLAGS) \
65 -include $(CONFIG_H) $< -o $@ 65 -include $(CONFIG_H) $< -o $@
66endef 66endef
67 67
68define target-o-from-one-cxx 68define target-o-from-one-cxx
69$(if $(V),,@echo " CXX " $(call relative-to-top,$<)) 69$(if $(V),,@echo " CXX " $(call relative-to-top,$<))
70$(CXX) -MD -c $(MODULE_CXXFLAGS) $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) \ 70$(MODULE_CXX) -MD -c $(MODULE_CXXFLAGS) $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) \
71 -include $(CONFIG_H) $< -o $@ 71 -include $(CONFIG_H) $< -o $@
72endef 72endef
73 73
74define host-executable-from-o 74define host-executable-from-o
75$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@)) 75$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
76$(HOST_CC) $(MODULE_HOST_LDFLAGS) \ 76$(MODULE_CC) $(MODULE_HOST_LDFLAGS) \
77 -o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \ 77 -o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \
78 $(MODULE_LIBRARY_FLAGS) 78 $(MODULE_LIBRARY_FLAGS)
79endef 79endef
80 80
81define host-executable-cxx-from-o 81define host-executable-cxx-from-o
82$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@)) 82$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
83$(HOST_CXX) $(MODULE_HOST_LDFLAGS) \ 83$(MODULE_CXX) $(MODULE_HOST_LDFLAGS) \
84 -o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \ 84 -o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \
85 $(MODULE_LIBRARY_FLAGS) 85 $(MODULE_LIBRARY_FLAGS)
86endef 86endef
87 87
88define target-executable-from-o 88define target-executable-from-o
89$(if $(V),,@echo " LD " $(call relative-to-top,$@)) 89$(if $(V),,@echo " LD " $(call relative-to-top,$@))
90$(CC) \ 90$(MODULE_CC) \
91 $(SYS_EXE_LDFLAGS) $(SYS_COMMON_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ 91 $(MODULE_EXE_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
92 $(SYS_EXE_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(SYS_EXE_CRTEND) \ 92 $(MODULE_EXE_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_EXE_CRTEND) \
93 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(LIBGCC) 93 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
94endef 94endef
95 95
96define target-executable-cxx-from-o 96define target-executable-cxx-from-o
97$(if $(V),,@echo " LD " $(call relative-to-top,$@)) 97$(if $(V),,@echo " LD " $(call relative-to-top,$@))
98$(CXX) \ 98$(MODULE_CXX) \
99 $(SYS_EXE_LDFLAGS_CXX) $(SYS_EXE_LDFLAGS) $(SYS_COMMON_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ 99 $(MODULE_EXE_LDFLAGS_CXX) $(MODULE_LDFLAGS) -o $@ \
100 $(SYS_EXE_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(SYS_EXE_CRTEND) \ 100 $(MODULE_EXE_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_EXE_CRTEND) \
101 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(LIBGCC) 101 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
102endef 102endef
103 103
104define target-shared-library-from-o 104define target-shared-library-from-o
105$(if $(V),,@echo " LD " $(call relative-to-top,$@)) 105$(if $(V),,@echo " LD " $(call relative-to-top,$@))
106$(CC) -shared -Wl,-Bsymbolic \ 106$(MODULE_CC) -shared -Wl,-Bsymbolic \
107 $(SYS_LIB_LDFLAGS) $(SYS_COMMON_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ 107 $(MODULE_LIB_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
108 $(SYS_LIB_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(SYS_LIB_CRTEND) \ 108 $(MODULE_LIB_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIB_CRTEND) \
109 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(LIBGCC) 109 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
110endef 110endef
111 111
112# If there were any C++ source files in a shared library, we use this recipe, 112# If there were any C++ source files in a shared library, we use this recipe,
113# which runs the C++ compiler to link the final library 113# which runs the C++ compiler to link the final library
114define target-shared-library-cxx-from-o 114define target-shared-library-cxx-from-o
115$(if $(V),,@echo " LD " $(call relative-to-top,$@)) 115$(if $(V),,@echo " LD " $(call relative-to-top,$@))
116$(CXX) -shared -Wl,-Bsymbolic \ 116$(MODULE_CXX) -shared -Wl,-Bsymbolic \
117 $(SYS_LIB_LDFLAGS_CXX) $(SYS_LIB_LDFLAGS) $(SYS_COMMON_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ 117 $(MODULE_LIB_LDFLAGS_CXX) $(MODULE_LDFLAGS) -o $@ \
118 $(SYS_LIB_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(SYS_LIB_CRTEND) \ 118 $(MODULE_LIB_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIB_CRTEND) \
119 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(LIBGCC) 119 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
120endef 120endef
121 121
122define host-shared-library-from-o 122define host-shared-library-from-o
123$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@)) 123$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
124$(HOST_CC) -shared -Wl,-Bsymbolic \ 124$(MODULE_CC) -shared -Wl,-Bsymbolic \
125 $(MODULE_HOST_LDFLAGS) -o $@ \ 125 $(MODULE_HOST_LDFLAGS) -o $@ \
126 $(sort $(MODULE_ALL_OBJECTS)) \ 126 $(sort $(MODULE_ALL_OBJECTS)) \
127 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) 127 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS)
@@ -131,7 +131,7 @@ endef
131# which runs the C++ compiler to link the final library 131# which runs the C++ compiler to link the final library
132define host-shared-library-cxx-from-o 132define host-shared-library-cxx-from-o
133$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@)) 133$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
134$(HOST_CXX) -shared -Wl,-Bsymbolic \ 134$(MODULE_CXX) -shared -Wl,-Bsymbolic \
135 $(MODULE_HOST_LDFLAGS) -o $@ \ 135 $(MODULE_HOST_LDFLAGS) -o $@ \
136 $(sort $(MODULE_ALL_OBJECTS)) \ 136 $(sort $(MODULE_ALL_OBJECTS)) \
137 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) 137 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS)
@@ -194,7 +194,10 @@ endef
194 194
195BISON ?= bison 195BISON ?= bison
196CC ?= gcc 196CC ?= gcc
197CC_SECONDARY ?= $(CC)
198CROSS_COMPILE_SECONDARY ?= $(CROSS_COMPILE)
197CXX ?= g++ 199CXX ?= g++
200CXX_SECONDARY ?= $(CXX)
198HOST_CC ?= gcc 201HOST_CC ?= gcc
199HOST_CXX ?= g++ 202HOST_CXX ?= g++
200JAR ?= jar 203JAR ?= jar
@@ -216,26 +219,68 @@ override CC_CHECK := $(if $(V),,@)$(MAKE_TOP)/tools/cc-check.sh
216# is reflected in the use of -target. For GCC this is always encoded into 219# is reflected in the use of -target. For GCC this is always encoded into
217# the binary. If CROSS_COMPILE is not set we can skip this. 220# the binary. If CROSS_COMPILE is not set we can skip this.
218# 221#
219ifneq ($(CROSS_COMPILE),) 222# If we're doing a build with multiple target architectures, we might need
220ifeq ($(cc-is-clang),true) 223# two separate compilers to build binaries for each architecture. In this
221override CC := $(if $(V),,@)$(CCACHE) $(CC) \ 224# case, CROSS_COMPILE and CROSS_COMPILE_SECONDARY are the cross compiler
222 -target $(patsubst %-,%,$(CROSS_COMPILE)) \ 225# prefix for the two compilers - $(CC) and $(CC_SECONDARY).
223 -B$(dir $(shell which $(CROSS_COMPILE)gcc)) 226#
224override CXX := $(if $(V),,@)$(CCACHE) $(CXX) \ 227# Set the secondary compiler first before we overwrite $(CC).
225 -target $(patsubst %-,%,$(CROSS_COMPILE)) \ 228#
226 -B$(dir $(shell which $(CROSS_COMPILE)gcc)) 229
227else 230ifneq ($(CROSS_COMPILE_SECONDARY),)
228override CC := $(if $(V),,@)$(CCACHE) $(CROSS_COMPILE)$(CC) 231 ifeq ($(cc-is-clang),true)
229override CXX := $(if $(V),,@)$(CCACHE) $(CROSS_COMPILE)$(CXX) 232 override CC_SECONDARY := \
233 $(CC_SECONDARY) \
234 -target $(patsubst %-,%,$(CROSS_COMPILE_SECONDARY)) \
235 -B$(dir $(shell which $(CROSS_COMPILE_SECONDARY)gcc))
236 override CXX_SECONDARY := \
237 $(CXX_SECONDARY) \
238 -target $(patsubst %-,%,$(CROSS_COMPILE_SECONDARY)) \
239 -B$(dir $(shell which $(CROSS_COMPILE_SECONDARY)gcc))
240 else
241 ifeq ($(origin CC_SECONDARY),file)
242 override CC_SECONDARY := $(CROSS_COMPILE_SECONDARY)$(CC_SECONDARY)
243 endif
244 ifeq ($(origin CXX_SECONDARY),file)
245 override CXX_SECONDARY := $(CROSS_COMPILE_SECONDARY)$(CXX_SECONDARY)
246 endif
247 endif
230endif 248endif
249
250# Apply compiler wrappers and V=1 handling
251override CC_SECONDARY := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CC_SECONDARY)
252override CXX_SECONDARY := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CXX_SECONDARY)
253
254ifneq ($(CROSS_COMPILE),)
255 ifeq ($(cc-is-clang),true)
256 override CC := \
257 $(CC) \
258 -target $(patsubst %-,%,$(CROSS_COMPILE)) \
259 -B$(dir $(shell which $(CROSS_COMPILE)gcc))
260 override CXX := \
261 $(CXX) \
262 -target $(patsubst %-,%,$(CROSS_COMPILE)) \
263 -B$(dir $(shell which $(CROSS_COMPILE)gcc))
264 else
265 ifeq ($(origin CC),file)
266 override CC := $(CROSS_COMPILE)$(CC)
267 endif
268 ifeq ($(origin CXX),file)
269 override CXX := $(CROSS_COMPILE)$(CXX)
270 endif
271 endif
231else 272else
232override CC := $(if $(V),,@)$(CCACHE) $(CC) 273 $(if $(CROSS_COMPILE_SECONDARY),$(error CROSS_COMPILE_SECONDARY is set but CROSS_COMPILE is empty))
233override CXX := $(if $(V),,@)$(CCACHE) $(CXX)
234endif 274endif
235 275
276# Apply compiler wrappers and V=1 handling
277override CC := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CC)
278override CXX := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CXX)
279
236override AR := $(if $(V),,@)$(CROSS_COMPILE)ar 280override AR := $(if $(V),,@)$(CROSS_COMPILE)ar
237override BISON := $(if $(V),,@)$(BISON) 281override BISON := $(if $(V),,@)$(BISON)
238override BZIP2 := $(if $(V),,@)bzip2 -9 282override BZIP2 := $(if $(V),,@)bzip2 -9
283override CAT := $(if $(V),,@)cat
239override CP := $(if $(V),,@)cp 284override CP := $(if $(V),,@)cp
240override ECHO := $(if $(V),,@)echo 285override ECHO := $(if $(V),,@)echo
241override FLEX := $(if $(V),,@)flex 286override FLEX := $(if $(V),,@)flex
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch.mk
new file mode 100644
index 0000000..7b41576
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch.mk
@@ -0,0 +1,107 @@
1########################################################################### ###
2#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
3#@License Dual MIT/GPLv2
4#
5# The contents of this file are subject to the MIT license as set out below.
6#
7# Permission is hereby granted, free of charge, to any person obtaining a copy
8# of this software and associated documentation files (the "Software"), to deal
9# in the Software without restriction, including without limitation the rights
10# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11# copies of the Software, and to permit persons to whom the Software is
12# furnished to do so, subject to the following conditions:
13#
14# The above copyright notice and this permission notice shall be included in
15# all copies or substantial portions of the Software.
16#
17# Alternatively, the contents of this file may be used under the terms of
18# the GNU General Public License Version 2 ("GPL") in which case the provisions
19# of GPL are applicable instead of those above.
20#
21# If you wish to allow use of your version of this file only under the terms of
22# GPL, and not to allow others to use your version of this file under the terms
23# of the MIT license, indicate your decision by deleting the provisions above
24# and replace them with the notice and other provisions required by GPL as set
25# out in the file called "GPL-COPYING" included in this distribution. If you do
26# not delete the provisions above, a recipient may use your version of this file
27# under the terms of either the MIT license or GPL.
28#
29# This License is also included in this distribution in the file called
30# "MIT-COPYING".
31#
32# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
33# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
34# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
35# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
36# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
37# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
38# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39### ###########################################################################
40
41include ../common/android/platform_version.mk
42
43# Now we have included the platform_version.mk file, we know we have a
44# correctly configured OUT_DIR and can probe it to figure out our
45# architecture.
46
47$(eval $(subst #,$(newline),$(shell cat $(BUILD_PROP) | \
48 grep '^ro.product.cpu.abilist=\|^ro.product.cpu.abilist32=' | \
49 sed -e 's,ro.product.cpu.abilist=,JNI_CPU_ABI=,' \
50 -e 's,ro.product.cpu.abilist32=,JNI_CPU_ABI_2ND=,' | \
51 tr ',' ' ' | tr '\n' '#')))
52
53# If ARCH is set, use that to remap to an "Android" ARCH..
54ANDROID_ARCH := $(filter arm arm64 x86 x86_64,$(ARCH))
55
56# x86 is special and has another legacy ARCH name which is remapped
57ifeq ($(ARCH),i386)
58TARGET_ARCH := x86
59endif
60
61ifeq ($(ANDROID_ARCH),)
62# ..otherwise, try to use the ABI list to figure it out.
63# We check 64-bit variants before 32, as a 64-build may be backwards compatible,
64# so the abilist contain both 64- and 32-bit variants
65ifneq ($(filter arm64-v8a,$(JNI_CPU_ABI)),)
66TARGET_ARCH=arm64
67else ifneq ($(filter armeabi-v7a armeabi,$(JNI_CPU_ABI)),)
68TARGET_ARCH=arm
69else ifneq ($(filter mips64,$(JNI_CPU_ABI)),)
70TARGET_ARCH=mips64
71else ifneq ($(filter mips,$(JNI_CPU_ABI)),)
72TARGET_ARCH=mips
73else ifneq ($(filter x86_64,$(JNI_CPU_ABI)),)
74TARGET_ARCH=x86_64
75else ifneq ($(filter x86,$(JNI_CPU_ABI)),)
76TARGET_ARCH=x86
77else
78$(error ARCH not set and JNI_CPU_ABI=$(JNI_CPU_ABI) was not remappable)
79endif
80else
81TARGET_ARCH := $(ANDROID_ARCH)
82endif
83
84JNI_CPU_ABI := $(word 1,$(JNI_CPU_ABI))
85JNI_CPU_ABI_2ND := $(word 1,$(JNI_CPU_ABI_2ND))
86
87include ../common/android/arch_common.mk
88
89ifneq ($(filter arm arm64 mips mips64,$(TARGET_ARCH)),)
90LDM_PLATFORM ?= 1
91endif
92
93ifneq ($(filter x86 x86_64,$(TARGET_ARCH)),)
94LDM_PCI ?= 1
95endif
96
97ifneq ($(filter x86 x86_64,$(TARGET_ARCH)),)
98KERNEL_CROSS_COMPILE ?= undef
99endif
100
101ifneq ($(filter arm64 mips64 x86_64,$(TARGET_ARCH)),)
102ifeq ($(MULTIARCH),)
103$(warning *** 64-bit architecture detected. Enabling MULTIARCH=1.)
104$(warning *** If you want a 64-bit only build, use MULTIARCH=64only.)
105export MULTIARCH := 1
106endif
107endif
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk
index bf3fe11..2cd272e 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk
@@ -38,72 +38,121 @@
38# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 38# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39### ########################################################################### 39### ###########################################################################
40 40
41ifeq ($(USE_CLANG),1)
42export CC := $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/bin/clang
43export CXX := $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/bin/clang++
44endif
45
46# FIXME: We need to run this early because config/core.mk hasn't been
47# included yet. Use the same variable names as in that makefile.
48#
49_CC := $(if $(filter default,$(origin CC)),gcc,$(CC))
50_CLANG := $(shell ../tools/cc-check.sh --clang --cc $(_CC))
51
52SYS_CFLAGS := \ 41SYS_CFLAGS := \
53 -fno-short-enums \ 42 -fno-short-enums \
54 -funwind-tables \ 43 -funwind-tables \
55 -D__linux__ 44 -D__linux__
56SYS_INCLUDES := \
57 -isystem $(ANDROID_ROOT)/bionic/libc/arch-$(ANDROID_ARCH)/include \
58 -isystem $(ANDROID_ROOT)/bionic/libc/include \
59 -isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi \
60 -isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-$(ANDROID_ARCH) \
61 -isystem $(ANDROID_ROOT)/bionic/libm/include \
62 -isystem $(ANDROID_ROOT)/bionic/libm/include/$(ANDROID_ARCH) \
63 -isystem $(ANDROID_ROOT)/bionic/libthread_db/include \
64 -isystem $(ANDROID_ROOT)/external/libunwind/include \
65 -isystem $(ANDROID_ROOT)/frameworks/base/include \
66 -isystem $(ANDROID_ROOT)/hardware/libhardware/include \
67 -isystem $(ANDROID_ROOT)/hardware/libhardware_legacy/include \
68 -isystem $(ANDROID_ROOT)/system/core/include \
69 -isystem $(ANDROID_ROOT)/system/core/libsync/include \
70 -isystem $(ANDROID_ROOT)/system/media/camera/include \
71 -isystem $(ANDROID_ROOT)/external/libdrm \
72 -isystem $(ANDROID_ROOT)/external/libdrm/include/drm
73
74ifneq ($(wildcard $(ANDROID_ROOT)/external/boringssl/src/include),)
75SYS_INCLUDES += \
76 -isystem $(ANDROID_ROOT)/external/boringssl/src/include
77else
78SYS_INCLUDES += \
79 -isystem $(ANDROID_ROOT)/external/openssl/include
80endif
81 45
82# Obsolete libc includes 46SYS_INCLUDES :=
83SYS_INCLUDES += \ 47
84 -isystem $(ANDROID_ROOT)/bionic/libc/kernel/common \ 48ifneq ($(TARGET_PLATFORM),)
85 -isystem $(ANDROID_ROOT)/bionic/libc/kernel/arch-$(ANDROID_ARCH) 49
50 # Support for building with the Android NDK >= r15b.
51 # The NDK provides only the most basic includes and libraries.
52
53 SYS_INCLUDES += \
54 -isystem $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-$(TARGET_ARCH)/usr/include \
55 -isystem $(NDK_SYSROOT)/usr/include/drm \
56 -isystem $(NDK_SYSROOT)/usr/include
57
58else # !TARGET_PLATFORM
59
60 # These libraries are not coming from the NDK now, so we need to include them
61 # from the ANDROID_ROOT source tree.
62
63 SYS_INCLUDES += \
64 -isystem $(ANDROID_ROOT)/bionic/libc/include \
65 -isystem $(ANDROID_ROOT)/bionic/libc/kernel/android/uapi \
66 -isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi \
67 -isystem $(ANDROID_ROOT)/bionic/libm/include \
68 -isystem $(ANDROID_ROOT)/external/libdrm/include/drm \
69 -isystem $(ANDROID_ROOT)/external/zlib/src \
70 -isystem $(ANDROID_ROOT)/frameworks/native/include
71
72 ifeq ($(is_future_version),1)
73 SYS_INCLUDES += \
74 -isystem $(ANDROID_ROOT)/libnativehelper/include_jni
75 else ifeq ($(is_aosp_master),1)
76 SYS_INCLUDES += \
77 -isystem $(ANDROID_ROOT)/libnativehelper/include_jni
78 else
79 SYS_INCLUDES += \
80 -isystem $(ANDROID_ROOT)/libnativehelper/include/nativehelper
81 endif
82
83endif # !TARGET_PLATFORM
84
85 # These components aren't in the NDK. They *are* in the VNDK. If this is an
86 # NDK or non-NDK build, but not a VNDK build, include the needed bits from
87 # the ANDROID_ROOT source tree. We put libsync first because the NDK copy
88 # of the sync headers have been stripped in an unsupported way.
89
90 SYS_INCLUDES := \
91 -isystem $(ANDROID_ROOT)/system/core/libsync/include \
92 $(SYS_INCLUDES) \
93 -isystem $(ANDROID_ROOT)/external/libdrm \
94 -isystem $(ANDROID_ROOT)/external/libpng \
95 -isystem $(ANDROID_ROOT)/external/libunwind/include \
96 -isystem $(ANDROID_ROOT)/hardware/libhardware/include \
97 -isystem $(ANDROID_ROOT)/system/media/camera/include
98
99 # boringssl replaced openssl from Marshmallow
100 ifeq ($(is_at_least_marshmallow),1)
101 SYS_INCLUDES += \
102 -isystem $(ANDROID_ROOT)/external/boringssl/src/include
103 else
104 SYS_INCLUDES += \
105 -isystem $(ANDROID_ROOT)/external/openssl/include
106 endif
107
108 # libjpeg-turbo replaced libjpeg from Nougat
109 ifeq ($(is_at_least_nougat),1)
110 SYS_INCLUDES += \
111 -isystem $(ANDROID_ROOT)/external/libjpeg-turbo
112 else
113 SYS_INCLUDES += \
114 -isystem $(ANDROID_ROOT)/external/jpeg
115 endif
116
117 # Handle upstream includes refactoring
118 ifeq ($(is_at_least_oreo),1)
119 SYS_INCLUDES += \
120 -isystem $(ANDROID_ROOT)/frameworks/native/libs/nativewindow/include \
121 -isystem $(ANDROID_ROOT)/system/core/libbacktrace/include \
122 -isystem $(ANDROID_ROOT)/system/core/libsystem/include \
123 -isystem $(ANDROID_ROOT)/system/core/libutils/include
124 ifeq ($(NDK_ROOT),)
125 SYS_INCLUDES += \
126 -isystem $(ANDROID_ROOT)/frameworks/native/libs/arect/include \
127 -isystem $(ANDROID_ROOT)/system/core/liblog/include
128 endif
129 else
130 SYS_INCLUDES += \
131 -isystem $(ANDROID_ROOT)/frameworks/base/include \
132 -isystem $(ANDROID_ROOT)/system/core/include
133 endif
86 134
87# This is comparing PVR_BUILD_DIR to see if it is omap and adding 135# This is comparing PVR_BUILD_DIR to see if it is omap and adding
88# includes required for it's HWC 136# includes required for it's HWC.
89ifeq ($(notdir $(abspath .)),omap_android) 137ifeq ($(notdir $(abspath .)),omap_android)
90SYS_INCLUDES += \ 138SYS_INCLUDES += \
91 -isystem $(ANDROID_ROOT)/hardware/ti/omap4xxx/kernel-headers \ 139 -isystem $(ANDROID_ROOT)/hardware/ti/omap4xxx/kernel-headers \
92 -isystem $(ANDROID_ROOT)/hardware/ti/omap4xxx/ion 140 -isystem $(ANDROID_ROOT)/hardware/ti/omap4xxx/ion
93endif 141endif
94 142
95ifeq ($(_CLANG),true) 143# Always include the NDK compatibility directory, because it allows us to
96SYS_INCLUDES := \ 144# compile in inline versions of simple functions to eliminate dependencies,
97 -nostdinc $(SYS_INCLUDES) \ 145# and we can also constrain the available APIs. Do this last, so we can
98 -isystem $(ANDROID_ROOT)/external/clang/lib/include 146# make sure it is always first on the include list.
99endif
100 147
101SYS_EXE_LDFLAGS := \ 148SYS_INCLUDES := -isystem eurasiacon/android/ndk $(SYS_INCLUDES)
102 -Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker \
103 -lc -ldl -lcutils
104 149
105SYS_LIB_LDFLAGS := $(SYS_EXE_LDFLAGS) 150# Android enables build-id sections to allow mapping binaries to debug
151# information for symbol resolution
152SYS_LDFLAGS += -Wl,--build-id=md5
106 153
107SYS_EXE_LDFLAGS_CXX := -lstdc++ 154SYS_EXE_LDFLAGS_CXX := -lstdc++
108 155
109SYS_LIB_LDFLAGS_CXX := $(SYS_EXE_LDFLAGS_CXX) 156SYS_LIB_LDFLAGS_CXX := $(SYS_EXE_LDFLAGS_CXX)
157
158OPTIM := -O2
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk
index b8b97e2..5cb8d84 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk
@@ -39,12 +39,6 @@
39### ########################################################################### 39### ###########################################################################
40 40
41 41
42# On versions of Android prior to L, remap the use of libc++ to a combination
43# of stlport and libstdc++. Not every module written in C++ in the DDK needs
44# the STL, but linking it should be harmless (and most modules do need it).
45ifneq ($(is_at_least_lollipop),1)
46endif
47
48 42
49$(eval $(call BothConfigC,ANDROID,)) 43$(eval $(call BothConfigC,ANDROID,))
50 44
@@ -52,11 +46,15 @@ $(eval $(call BothConfigC,ANDROID,))
52 46
53$(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_ANDROID_SYSTRACE,)) 47$(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_ANDROID_SYSTRACE,))
54 48
49$(eval $(call TunableBothConfigMake,SUPPORT_ANDROID_PLATFORM,))
55$(eval $(call TunableBothConfigMake,SUPPORT_PVRSRV_ANDROID_SYSTRACE,)) 50$(eval $(call TunableBothConfigMake,SUPPORT_PVRSRV_ANDROID_SYSTRACE,))
56 51
57$(eval $(call TunableBothConfigMake,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,)) 52$(eval $(call TunableBothConfigMake,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,))
58$(eval $(call TunableBothConfigC,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,)) 53$(eval $(call TunableBothConfigC,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,))
59 54
55$(eval $(call TunableBothConfigMake,PVR_ANDROID_NATIVE_WINDOW_HAS_FENCE,))
56$(eval $(call TunableBothConfigC,PVR_ANDROID_NATIVE_WINDOW_HAS_FENCE,))
57
60ifeq ($(NO_HARDWARE),1) 58ifeq ($(NO_HARDWARE),1)
61 override PVR_ANDROID_COMPOSERHAL := null 59 override PVR_ANDROID_COMPOSERHAL := null
62endif 60endif
@@ -68,4 +66,50 @@ ifneq ($(PVR_ANDROID_COMPOSERHAL),drm)
68endif 66endif
69 67
70 68
69# Most development systems will have at least one copy of java, but some may
70# have more. If the build system detected that a specific 'forced' version
71# of java should be used, and the user didn't override JAVAC, try to set it
72# up here. We'll use JAVA_HOME if it's set, falling back to PATH if it is
73# not.
74ifeq ($(JAVAC),)
75 # If JAVA_HOME is unset, implement some assumed paths taken from Android's
76 # build/envsetup.sh script (these are intentionally Ubuntu centric).
77 ifeq ($(JAVA_HOME),)
78 ifeq ($(LEGACY_USE_JAVA7),1)
79 JAVA_HOME ?= /usr/lib/jvm/java-7-openjdk-amd64
80 else
81 JAVA_HOME ?= /usr/lib/jvm/java-8-openjdk-amd64
82 endif
83 ifeq ($(wildcard $(JAVA_HOME)),)
84 JAVA_HOME :=
85 endif
86 endif
87
88 ifeq ($(JAVA_HOME),)
89 JAVA ?= java
90 JAVAC ?= javac
91 else
92 JAVA := $(JAVA_HOME)/bin/java
93 JAVAC := $(JAVA_HOME)/bin/javac
94 ifeq ($(wildcard $(JAVAC)),)
95 $(error JAVA_HOME does not point to a valid java installation)
96 endif
97 endif
98
99 # Test the configured JDK for validity
100 ifeq ($(LEGACY_USE_JAVA6),1)
101 ifeq ($(shell $(JAVA) -version 2>&1 | grep -qe 'Java(TM).*1\.6\.0' && echo 1 || echo 0),0)
102 $(error '$(JAVA) -version' was not for Oracle JDK 6)
103 endif
104 else ifeq ($(LEGACY_USE_JAVA7),1)
105 ifeq ($(shell $(JAVA) -version 2>&1 | grep -qe 'OpenJDK.*7u' && echo 1 || echo 0),0)
106 $(error '$(JAVA) -version' was not for OpenJDK 7)
107 endif
108 else
109 ifeq ($(shell $(JAVA) -version 2>&1 | grep -qe 'OpenJDK.*1\.8\.' && echo 1 || echo 0),0)
110 $(error '$(JAVA) -version' was not for OpenJDK 8)
111 endif
112 endif
113endif
114
71include ../common/ion.mk 115include ../common/ion.mk
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
index ba37064..bc92a6f 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
@@ -38,8 +38,6 @@
38# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 38# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39### ########################################################################### 39### ###########################################################################
40 40
41include ../common/android/platform_version.mk
42
43# Basic support option tuning for Android 41# Basic support option tuning for Android
44# 42#
45SUPPORT_ANDROID_PLATFORM := 1 43SUPPORT_ANDROID_PLATFORM := 1
@@ -72,10 +70,6 @@ OPK_DEFAULT := libpvrANDROID_WSEGL.so
72# 70#
73KERNEL_COMPONENTS := srvkm 71KERNEL_COMPONENTS := srvkm
74 72
75# Kernel modules are always installed here under Android
76#
77PVRSRV_MODULE_BASEDIR := /system/modules/
78
79# Use the new PVR_DPF implementation to allow lower message levels 73# Use the new PVR_DPF implementation to allow lower message levels
80# to be stripped from production drivers 74# to be stripped from production drivers
81# 75#
@@ -102,6 +96,12 @@ SUPPORT_LARGE_GENERAL_HEAP := 1
102# 96#
103PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 5400 97PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 5400
104 98
99##############################################################################
100# Enable source fortification by default
101#
102FORTIFY ?= 1
103
104##############################################################################
105# Unless overridden by the user, assume the RenderScript Compute API level 105# Unless overridden by the user, assume the RenderScript Compute API level
106# matches that of the SDK API_LEVEL. 106# matches that of the SDK API_LEVEL.
107# 107#
@@ -126,36 +126,35 @@ UNITTEST_INCLUDES := \
126 $(ANDROID_ROOT)/frameworks/native/opengl/include \ 126 $(ANDROID_ROOT)/frameworks/native/opengl/include \
127 $(ANDROID_ROOT)/libnativehelper/include/nativehelper 127 $(ANDROID_ROOT)/libnativehelper/include/nativehelper
128 128
129# But it doesn't have OpenVG headers
130#
131UNITTEST_INCLUDES += eurasiacon/unittests/include 129UNITTEST_INCLUDES += eurasiacon/unittests/include
132 130
133############################################################################## 131##############################################################################
134# Future versions moved proprietary libraries to a vendor directory 132# Future versions moved proprietary libraries to a vendor directory
135# 133#
136SHLIB_DESTDIR := /system/vendor/lib 134ifeq ($(wildcard $(TARGET_ROOT)/product/$(TARGET_DEVICE)/vendor),)
137DEMO_DESTDIR := /system/vendor/bin 135PVRSRV_MODULE_BASEDIR := /system/lib/modules/
138 136BIN_DESTDIR := /system/vendor/bin
139# EGL libraries go in a special place 137APP_DESTDIR := /data/app
140# 138else
141EGL_DESTDIR := $(SHLIB_DESTDIR)/egl 139PVR_ANDROID_FORCE_APP_NATIVE_UNPACKED := 1
140PVRSRV_MODULE_BASEDIR := /vendor/lib/modules/
141BIN_DESTDIR := /vendor/bin
142APP_DESTDIR := /vendor/app
143endif
142 144
143############################################################################## 145##############################################################################
144# In K and older, augment the libstdc++ includes with stlport includes. Any 146# Android doesn't use these install script variables. They're still in place
145# part of the C++ library not implemented by stlport will be handled by 147# because the Linux install scripts use them.
146# linking in libstdc++ too (see extra_config.mk).
147# 148#
148# On L and newer, don't use stlport OR libstdc++ at all; just use libc++. 149SHLIB_DESTDIR := not-used
150EGL_DESTDIR := not-used
151
152# Must give our EGL/GLES libraries a globally unique name
149# 153#
154EGL_BASENAME_SUFFIX := _POWERVR_SGX$(SGXCORE)_$(SGX_CORE_REV)
155
150SYS_CXXFLAGS := -fuse-cxa-atexit $(SYS_CFLAGS) 156SYS_CXXFLAGS := -fuse-cxa-atexit $(SYS_CFLAGS)
151ifeq ($(is_at_least_lollipop),1) 157SYS_INCLUDES += -isystem $(LIBCXX_INCLUDE_PATH)
152SYS_INCLUDES += \
153 -isystem $(ANDROID_ROOT)/external/libcxx/include
154else
155SYS_INCLUDES += \
156 -isystem $(ANDROID_ROOT)/bionic \
157 -isystem $(ANDROID_ROOT)/external/stlport/stlport
158endif
159 158
160############################################################################## 159##############################################################################
161# Support the OES_EGL_image_external extensions in the client drivers. 160# Support the OES_EGL_image_external extensions in the client drivers.
@@ -177,32 +176,28 @@ EGL_EXTENSION_ANDROID_RECORDABLE := 1
177EGL_EXTENSION_ANDROID_BLOB_CACHE := 1 176EGL_EXTENSION_ANDROID_BLOB_CACHE := 1
178 177
179############################################################################## 178##############################################################################
180# JB added a new corkscrew API for userland backtracing.
181#
182ifeq ($(is_at_least_lollipop),0)
183PVR_ANDROID_HAS_CORKSCREW_API := 1
184endif
185
186##############################################################################
187# JB MR1 introduces cross-process syncs associated with a fd. 179# JB MR1 introduces cross-process syncs associated with a fd.
188# This requires a new enough kernel version to have the base/sync driver. 180# This requires a new enough kernel version to have the base/sync driver.
189# 181#
190EGL_EXTENSION_ANDROID_NATIVE_FENCE_SYNC ?= 1 182EGL_EXTENSION_ANDROID_NATIVE_FENCE_SYNC ?= 1
191PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC ?= 1
192 183
193############################################################################## 184##############################################################################
194# Versions of Android between Cupcake and KitKat MR1 required Java 6. 185# Kernel 4.9 introduces new sync framework for cross-process sync
195# 186#
196ifeq ($(is_at_least_lollipop),0) 187ifneq ($(strip $(KERNELDIR)),)
197LEGACY_USE_JAVA6 ?= 1 188include ../kernel_version.mk
189ifeq ($(call kernel-version-at-least,4,9,27),true)
190PVR_ANDROID_NATIVE_WINDOW_HAS_FENCE ?= 1
191else
192PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC ?= 1
193endif
198endif 194endif
199 195
200############################################################################## 196##############################################################################
201# Versions of Android between ICS and KitKat MR1 used ion .heap_mask instead 197# Versions of Android prior to Nougat required Java 7 (OpenJDK).
202# of .heap_id_mask.
203# 198#
204ifeq ($(is_at_least_lollipop),0) 199ifeq ($(is_at_least_nougat),0)
205PVR_ANDROID_HAS_ION_FIELD_HEAP_MASK := 1 200LEGACY_USE_JAVA7 ?= 1
206endif 201endif
207 202
208############################################################################## 203##############################################################################
@@ -214,20 +209,12 @@ PVR_ANDROID_BCC_MULTIARCH_SUPPORT := 1
214endif 209endif
215 210
216############################################################################## 211##############################################################################
217# Lollipop annotates the cursor allocation with USAGE_CURSOR to enable it to 212# Versions of Android prior to Nougat required .apk files to be processed with
218# be accelerated with special cursor hardware (rather than wasting an 213# zipalign. Using this tool on Nougat or greater will corrupt the .apk file,
219# overlay). This flag stops the DDK from blocking the allocation. 214# as alignment is already done by signapk.jar, so we must disable it.
220# 215#
221ifeq ($(is_at_least_lollipop),1) 216ifeq ($(is_at_least_nougat),0)
222PVR_ANDROID_HAS_GRALLOC_USAGE_CURSOR := 1 217LEGACY_USE_ZIPALIGN ?= 1
223endif
224
225##############################################################################
226# Lollipop changed the camera HAL metadata specification to require that
227# CONTROL_MAX_REGIONS specifies 3 integers (instead of 1).
228#
229ifeq ($(is_at_least_lollipop),1)
230PVR_ANDROID_CAMERA_CONTROL_MAX_REGIONS_HAS_THREE := 1
231endif 218endif
232 219
233############################################################################## 220##############################################################################
@@ -252,6 +239,14 @@ ifeq ($(is_at_least_marshmallow),1)
252PVR_ANDROID_HAS_GRALLOC_USAGE_RENDERSCRIPT := 1 239PVR_ANDROID_HAS_GRALLOC_USAGE_RENDERSCRIPT := 1
253endif 240endif
254 241
242# On Android O, the <sync/sync.h> file was moved to <android/sync.h> for
243# DDK use. A symlink was left for legacy reasons, but it conflicts with
244# the NDK. Tell the driver to avoid using the symlink compatibility.
245#
246ifeq ($(is_at_least_oreo),1)
247override PVR_ANDROID_HAS_ANDROID_SYNC_H := 1
248endif
249
255# Placeholder for future version handling 250# Placeholder for future version handling
256# 251#
257ifeq ($(is_future_version),1) 252ifeq ($(is_future_version),1)
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/install.sh.tpl b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/install.sh.tpl
new file mode 100644
index 0000000..bc9fa24
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/install.sh.tpl
@@ -0,0 +1,315 @@
1#!/bin/bash
2############################################################################ ###
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# Help on how to invoke
42#
43function usage {
44 echo "usage: $0 [options...]"
45 echo ""
46 echo "Options: -v Verbose mode."
47 echo " -n Dry-run mode."
48 echo " -u Uninstall-only mode."
49 echo " --root <path> Use <path> as the root of the install file system."
50 echo " (Overrides the DISCIMAGE environment variable.)"
51 exit 1
52}
53
54WD=`pwd`
55SCRIPT_ROOT=`dirname $0`
56cd $SCRIPT_ROOT
57
58PVRVERSION=[PVRVERSION]
59PVRBUILD=[PVRBUILD]
60PRIMARY_ARCH="[PRIMARY_ARCH]"
61ARCHITECTURES="[ARCHITECTURES]"
62
63APP_DESTDIR=[APP_DESTDIR]
64BIN_DESTDIR=[BIN_DESTDIR]
65DATA_DESTDIR=[BIN_DESTDIR]
66
67# Exit with an error messages.
68# $1=blurb
69#
70function bail {
71 if [ ! -z "$1" ]; then
72 echo "$1" >&2
73 fi
74
75 echo "" >&2
76 echo "Installation failed" >&2
77 exit 1
78}
79
80# Copy all the required files into their appropriate places on the local machine.
81function install_locally {
82 # Define functions required for local installs
83
84 # basic installation function
85 # $1=fromfile, $2=destfilename, $3=blurb, $4=chmod-flags, $5=chown-flags
86 #
87 function install_file {
88 if [ -z "$DDK_INSTALL_LOG" ]; then
89 bail "INTERNAL ERROR: Invoking install without setting logfile name"
90 fi
91 DESTFILE=${DISCIMAGE}$2
92 DESTDIR=`dirname $DESTFILE`
93
94 if [ ! -e $1 ]; then
95 [ -n "$VERBOSE" ] && echo "skipping file $1 -> $2"
96 return
97 fi
98
99 # Destination directory - make sure it's there and writable
100 #
101 if [ -d "${DESTDIR}" ]; then
102 if [ ! -w "${DESTDIR}" ]; then
103 bail "${DESTDIR} is not writable."
104 fi
105 else
106 $DOIT mkdir -p ${DESTDIR} || bail "Couldn't mkdir -p ${DESTDIR}"
107 [ -n "$VERBOSE" ] && echo "Created directory `dirname $2`"
108 fi
109
110 # Delete the original so that permissions don't persist.
111 #
112 $DOIT rm -f $DESTFILE
113
114 $DOIT cp -f $1 $DESTFILE || bail "Couldn't copy $1 to $DESTFILE"
115 $DOIT chmod $4 ${DESTFILE}
116
117 echo "$3 `basename $1` -> $2"
118 $DOIT echo "file $2" >> $DDK_INSTALL_LOG
119 }
120
121 # If we install to an empty $DISCIMAGE, then we need to create some
122 # dummy directories, even if they contain no files, otherwise 'adb
123 # sync' may fail. (It allows '/vendor' to not exist currently.)
124 [ ! -d ${DISCIMAGE}/data ] && mkdir ${DISCIMAGE}/data
125 [ ! -d ${DISCIMAGE}/system ] && mkdir ${DISCIMAGE}/system
126
127 for arch in $ARCHITECTURES; do
128 if [ ! -d $arch ]; then
129 echo "Missing architecture $arch"
130 if [ "$arch" = "$PRIMARY_ARCH" ]; then
131 echo "Primary architecture is missing, aborting!"
132 exit 1
133 else
134 continue
135 fi
136 fi
137
138 BASE_DESTDIR=`dirname ${BIN_DESTDIR}`
139 case $arch in
140 target*64* )
141 SHLIB_DESTDIR=${BASE_DESTDIR}/lib64
142 ;;
143 *)
144 SHLIB_DESTDIR=${BASE_DESTDIR}/lib
145 esac
146 EGL_DESTDIR=${SHLIB_DESTDIR}/egl
147
148 pushd $arch > /dev/null
149 # Install UM components
150 if [ -f install_um.sh ]; then
151 DDK_INSTALL_LOG=$UMLOG
152 echo "Installing User components for architecture $arch"
153 $DOIT echo "version $PVRVERSION" > $DDK_INSTALL_LOG
154 source install_um.sh
155 echo
156 fi
157 popd > /dev/null
158 done
159
160 pushd $PRIMARY_ARCH > /dev/null
161 # Install KM components
162 if [ -f install_km.sh ]; then
163 DDK_INSTALL_LOG=$KMLOG
164 echo "Installing Kernel components for architecture $PRIMARY_ARCH"
165 $DOIT echo "version $PVRVERSION" > $DDK_INSTALL_LOG
166 source install_km.sh
167 echo
168 fi
169 popd > /dev/null
170
171 # Create an OLDLOG so old versions of the driver can uninstall.
172 $DOIT echo "version $PVRVERSION" > $OLDLOG
173 if [ -f $KMLOG ]; then
174 tail -n +2 $KMLOG >> $OLDLOG
175 fi
176 if [ -f $UMLOG ]; then
177 tail -n +2 $UMLOG >> $OLDLOG
178 fi
179
180 # Make sure new logs are newer than $OLDLOG
181 touch -m -d "last sunday" $OLDLOG
182}
183
184# Read the appropriate install log and delete anything therein.
185function uninstall_locally {
186 # Function to uninstall something.
187 function do_uninstall {
188 LOG=$1
189
190 if [ ! -f $LOG ]; then
191 echo "Nothing to un-install."
192 return;
193 fi
194
195 BAD=0
196 VERSION=""
197 while read type data; do
198 case $type in
199 version)
200 echo "Uninstalling existing version $data"
201 VERSION="$data"
202 ;;
203 link|file)
204 if [ -z "$VERSION" ]; then
205 BAD=1;
206 echo "No version record at head of $LOG"
207 elif ! $DOIT rm -f ${DISCIMAGE}${data}; then
208 BAD=1;
209 else
210 [ -n "$VERBOSE" ] && echo "Deleted $type $data"
211 fi
212 ;;
213 tree)
214 ;;
215 esac
216 done < $1;
217
218 if [ $BAD = 0 ]; then
219 echo "Uninstallation completed."
220 $DOIT rm -f $LOG
221 else
222 echo "Uninstallation failed!!!"
223 fi
224 }
225
226 if [ -z "$OLDLOG" -o -z "$KMLOG" -o -z "$UMLOG" ]; then
227 bail "INTERNAL ERROR: Invoking uninstall without setting logfile name"
228 fi
229
230 # Uninstall anything installed using the old-style install scripts.
231 LEGACY_LOG=0
232 if [ -f $OLDLOG ]; then
233 if [ -f $KMLOG -a $KMLOG -nt $OLDLOG ]; then
234 # Last install was new scheme.
235 rm $OLDLOG
236 elif [ -f $UMLOG -a $UMLOG -nt $OLDLOG ]; then
237 # Last install was new scheme.
238 rm $OLDLOG
239 else
240 echo "Uninstalling all components from legacy log."
241 do_uninstall $OLDLOG
242 LEGACY_LOG=1
243 echo
244 fi
245 fi
246
247 if [ $LEGACY_LOG = 0 ]; then
248 # Uninstall KM components if we are doing a KM install.
249 if [ -f install_km.sh -a -f $KMLOG ]; then
250 echo "Uninstalling Kernel components"
251 do_uninstall $KMLOG
252 echo
253 fi
254 # Uninstall UM components if we are doing a UM install.
255 if [ -f install_um.sh -a -f $UMLOG ]; then
256 echo "Uninstalling User components"
257 do_uninstall $UMLOG
258 echo
259 fi
260 fi
261}
262
263# Work out if there are any special instructions.
264#
265while [ "$1" ]; do
266 case "$1" in
267 -v|--verbose)
268 VERBOSE=v
269 ;;
270 -r|--root)
271 DISCIMAGE=$2
272 shift;
273 ;;
274 -u|--uninstall)
275 UNINSTALL_ONLY=y
276 ;;
277 -n)
278 DOIT=echo
279 ;;
280 -h | --help | *)
281 usage
282 ;;
283 esac
284 shift
285done
286
287if [ ! -z "$DISCIMAGE" ]; then
288
289 if [ ! -d "$DISCIMAGE" ]; then
290 bail "$0: $DISCIMAGE does not exist."
291 fi
292
293 echo
294 if [ $DISCIMAGE == "/" ]; then
295 echo "Installing PowerVR '$PVRVERSION ($PVRBUILD)' locally"
296 else
297 echo "Installing PowerVR '$PVRVERSION ($PVRBUILD)' on $DISCIMAGE"
298 fi
299 echo
300 echo "File system installation root is $DISCIMAGE"
301 echo
302
303 OLDLOG=$DISCIMAGE/powervr_ddk_install.log
304 KMLOG=$DISCIMAGE/powervr_ddk_install_km.log
305 UMLOG=$DISCIMAGE/powervr_ddk_install_um.log
306
307 uninstall_locally
308
309 if [ "$UNINSTALL_ONLY" != "y" ]; then
310 install_locally
311 fi
312
313else
314 bail "DISCIMAGE must be set for installation to be possible."
315fi
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk
index 4309c72..4debd7c 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk
@@ -46,12 +46,13 @@ HOST_ARCH ?= x86
46OUT_DIR ?= $(ANDROID_ROOT)/out 46OUT_DIR ?= $(ANDROID_ROOT)/out
47 47
48ifeq ($(TARGET_BUILD_TYPE),debug) 48ifeq ($(TARGET_BUILD_TYPE),debug)
49TARGET_ROOT := $(OUT_DIR)/debug/target 49TARGET_ROOT := $(ANDROID_ROOT)/out/debug/target
50else 50else
51TARGET_ROOT := $(OUT_DIR)/target 51TARGET_ROOT := $(ANDROID_ROOT)/out/target
52endif 52endif
53 53
54TOOLCHAIN ?= $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj 54ifeq ($(NDK_ROOT),)
55TOOLCHAIN2 ?= $(TARGET_ROOT)/product/$(TARGET_DEVICE)/system 55LIBCXX_INCLUDE_PATH := $(ANDROID_ROOT)/external/libcxx/include
56 56else
57LIBGCC := $(shell $(CROSS_COMPILE)gcc -m32 -print-libgcc-file-name 2>/dev/null) 57LIBCXX_INCLUDE_PATH := $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/include
58endif
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk
index b99d976..0a91f6b 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk
@@ -41,25 +41,25 @@
41# If there's no build.prop file in the expected location, bail out. Tell the 41# If there's no build.prop file in the expected location, bail out. Tell the
42# user which file we were trying to read in case TARGET_DEVICE was not set. 42# user which file we were trying to read in case TARGET_DEVICE was not set.
43# 43#
44#BUILD_PROP := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/build.prop 44BUILD_PROP := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/vendor/build.prop
45#ifeq ($(wildcard $(BUILD_PROP)),) 45ifeq ($(wildcard $(BUILD_PROP)),)
46#$(warning *** Could not determine Android version. Did you set ANDROID_ROOT,\ 46$(warning *** Could not determine Android version. Did you set ANDROID_ROOT,\
47#OUT_DIR and TARGET_DEVICE in your environment correctly?) 47OUT_DIR and TARGET_DEVICE in your environment correctly?)
48#$(error Error reading $(BUILD_PROP)) 48$(error Error reading $(BUILD_PROP))
49#endif 49endif
50 50
51# Extract version.release and version.codename from the build.prop file. 51# Extract version.release and version.codename from the build.prop file.
52# If either of the values aren't in the build.prop, the Make variables won't 52# If either of the values aren't in the build.prop, the Make variables won't
53# be defined, and fallback handling will take place. 53# be defined, and fallback handling will take place.
54# 54#
55#define newline 55define newline
56# 56
57# 57
58#endef 58endef
59#$(eval $(subst #,$(newline),$(shell cat $(BUILD_PROP) | \ 59$(eval $(subst #,$(newline),$(shell cat $(BUILD_PROP) | \
60# grep '^ro.build.version.release=\|^ro.build.version.codename=' | \ 60 grep '^ro.build.version.release=\|^ro.build.id=' | \
61# sed -e 's,ro.build.version.release=,PLATFORM_RELEASE=,' \ 61 sed -e 's,ro.build.version.release=,PLATFORM_RELEASE=,' \
62# -e 's,ro.build.version.codename=,PLATFORM_CODENAME=,' | tr '\n' '#'))) 62 -e 's,ro.build.id=,PLATFORM_BUILDID=,' | tr '\n' '#')))
63 63
64define release-starts-with 64define release-starts-with
65$(shell echo $(PLATFORM_RELEASE) | grep -q ^$(1); \ 65$(shell echo $(PLATFORM_RELEASE) | grep -q ^$(1); \
@@ -76,33 +76,32 @@ endef
76# ordering. You need to make sure that strings that are sub-strings of other 76# ordering. You need to make sure that strings that are sub-strings of other
77# checked strings appear _later_ in this list. 77# checked strings appear _later_ in this list.
78# 78#
79# e.g. 'KitKatMR' starts with 'KitKat', but it is not KitKat. 79# e.g. 'LollipopMR1' starts with 'Lollipop', but it is not Lollipop.
80# 80#
81# NOTE: The version codenames for Android stopped after KitKat, don't read 81# NOTE: The version codenames for Android stopped after KitKat, don't read
82# too much into the below names. They are mostly placeholders/reminders. 82# too much into the below names. They are mostly placeholders/reminders.
83# 83#
84ifeq ($(call release-starts-with,KitKatMR),1) 84ifeq ($(call release-starts-with,LollipopMR1),1)
85PLATFORM_RELEASE := 4.4.1 85override PLATFORM_RELEASE := 5.1
86else ifeq ($(call release-starts-with,KitKat),1)
87PLATFORM_RELEASE := 4.4
88else ifeq ($(call release-starts-with,LollipopMR1),1)
89PLATFORM_RELEASE := 5.1
90else ifeq ($(call release-starts-with,Lollipop),1)
91PLATFORM_RELEASE := 5.0
92else ifeq ($(call release-starts-with,Marshmallow),1) 86else ifeq ($(call release-starts-with,Marshmallow),1)
93PLATFORM_RELEASE := 6.0 87override PLATFORM_RELEASE := 6.0
94else ifeq ($(PLATFORM_CODENAME),AOSP) 88else ifeq ($(call release-starts-with,NougatMR),1)
95# AOSP (master) will normally have PLATFORM_CODENAME set to AOSP 89override PLATFORM_RELEASE := 7.1
96PLATFORM_RELEASE := 6.0.60 90else ifeq ($(call release-starts-with,Nougat),1)
91override PLATFORM_RELEASE := 7.0
92else ifeq ($(call release-starts-with,Oreo),1)
93override PLATFORM_RELEASE := 8.0
94else ifeq ($(PLATFORM_BUILDID),OC)
95override PLATFORM_RELEASE := 8.0.80
97else ifeq ($(shell echo $(PLATFORM_RELEASE) | grep -qE "[A-Za-z]+"; echo $$?),0) 96else ifeq ($(shell echo $(PLATFORM_RELEASE) | grep -qE "[A-Za-z]+"; echo $$?),0)
98PLATFORM_RELEASE := 6.1 97override PLATFORM_RELEASE := 8.2
99endif 98endif
100 99
101# Workaround for master. Sometimes there is an AOSP version ahead of 100# Workaround for master. Sometimes there is an AOSP version ahead of
102# the current master version number, but master still has more features. 101# the current master version number, but master still has more features.
103# 102#
104ifeq ($(PLATFORM_RELEASE),6.0.60) 103ifeq ($(PLATFORM_RELEASE),8.0.80)
105PLATFORM_RELEASE := 6.1 104override PLATFORM_RELEASE := 8.0
106is_aosp_master := 1 105is_aosp_master := 1
107endif 106endif
108 107
@@ -118,37 +117,69 @@ endif
118 117
119# Macros to help categorize support for features and API_LEVEL for tests. 118# Macros to help categorize support for features and API_LEVEL for tests.
120# 119#
121is_at_least_lollipop := \
122 $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 5 ) && echo 1 || echo 0)
123is_at_least_lollipop_mr1 := \ 120is_at_least_lollipop_mr1 := \
124 $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 5 || \ 121 $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 5 || \
125 ( test $(PLATFORM_RELEASE_MAJ) -eq 5 && \ 122 ( test $(PLATFORM_RELEASE_MAJ) -eq 5 && \
126 test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0) 123 test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0)
127is_at_least_marshmallow := \ 124is_at_least_marshmallow := \
128 $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 6 ) && echo 1 || echo 0) 125 $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 6 ) && echo 1 || echo 0)
126is_at_least_nougat := \
127 $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 7 ) && echo 1 || echo 0)
128is_at_least_nougat_mr1 := \
129 $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 7 || \
130 ( test $(PLATFORM_RELEASE_MAJ) -eq 7 && \
131 test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0)
132is_at_least_oreo := \
133 $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 8 ) && echo 1 || echo 0)
129 134
130# Assume "future versions" are >6.0, but we don't really know 135# Assume "future versions" are >7.1, but we don't really know
131is_future_version := \ 136is_future_version := \
132 $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 6 || \ 137 $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 8 || \
133 ( test $(PLATFORM_RELEASE_MAJ) -eq 6 && \ 138 ( test $(PLATFORM_RELEASE_MAJ) -eq 8 && \
134 test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0) 139 test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0)
135 140
136# Picking an exact match of API_LEVEL for the platform we're building 141# Picking an exact match of API_LEVEL for the platform we're building
137# against can avoid compatibility theming and affords better integration. 142# against can avoid compatibility theming and affords better integration.
138# 143#
144# This is also a good place to select the right jack toolchain.
145#
139ifeq ($(is_future_version),1) 146ifeq ($(is_future_version),1)
140API_LEVEL := 23 147JACK_VERSION ?= 4.32.CANDIDATE
148API_LEVEL := 26
149else ifeq ($(is_at_least_oreo),1)
150ifeq ($(is_aosp_master),1)
151override JACK_VERSION :=
152else
153JACK_VERSION ?= 4.31.CANDIDATE
154endif
155API_LEVEL := 26
156else ifeq ($(is_at_least_nougat_mr1),1)
157JACK_VERSION ?= 3.36.CANDIDATE
158API_LEVEL := 25
159else ifeq ($(is_at_least_nougat),1)
160JACK_VERSION ?= 3.36.CANDIDATE
161API_LEVEL := 24
141else ifeq ($(is_at_least_marshmallow),1) 162else ifeq ($(is_at_least_marshmallow),1)
163JACK_VERSION ?= 2.21.RELEASE
142API_LEVEL := 23 164API_LEVEL := 23
143else ifeq ($(is_at_least_lollipop_mr1),1) 165else ifeq ($(is_at_least_lollipop_mr1),1)
166# This early version had no version-file.version.code; fake it
167JACK_VERSION ?= 1.0.RELEASE
144API_LEVEL := 22 168API_LEVEL := 22
145else ifeq ($(is_at_least_lollipop),1)
146API_LEVEL := 21
147#API_LEVEL := 20 was l-preview
148else ifeq ($(is_at_least_kitkat),1)
149API_LEVEL := 19
150else 169else
151$(error Must build against Android >= 4.4) 170$(error Must build against Android >= 5.1)
171endif
172
173# If the NDK is enabled, check it has API_LEVEL support for us
174ifneq ($(NDK_ROOT),)
175 NDK_PLATFORMS_ROOT ?= $(NDK_ROOT)/platforms
176 ifeq ($(strip $(wildcard $(NDK_PLATFORMS_ROOT)/android-*)),)
177 $(error NDK_PLATFORMS_ROOT does not point to a valid location)
178 endif
179 override TARGET_PLATFORM := android-$(API_LEVEL)
180 ifeq ($(strip $(wildcard $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM))),)
181 $(error NDK support for $(TARGET_PLATFORM) is missing)
182 endif
152endif 183endif
153 184
154# Each DDK is tested against only a single version of the platform. 185# Each DDK is tested against only a single version of the platform.
@@ -156,6 +187,6 @@ endif
156# 187#
157ifeq ($(is_future_version),1) 188ifeq ($(is_future_version),1)
158$(info WARNING: Android version is newer than this DDK supports) 189$(info WARNING: Android version is newer than this DDK supports)
159else ifneq ($(is_at_least_lollipop_mr1),1) 190else ifneq ($(is_at_least_marshmallow),1)
160$(info WARNING: Android version is older than this DDK supports) 191$(info WARNING: Android version is older than this DDK supports)
161endif 192endif
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk
index b6f945f..dfe3018 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk
@@ -61,18 +61,3 @@ $(eval $(call TunableKernelConfigC,PVR_DRI_DRM_PLATFORM_DEV,))
61 61
62 62
63 63
64ifeq ($(SUPPORT_DRI_DRM_PLUGIN),1)
65PVR_DRI_CLIENT_DRIVER := pvrsrvkm
66else
67# The X and Wayland window systems derive the client driver name from a
68# display driver DRM device node. The Surfaceless window system derives it
69# from a render node.
70ifeq ($(WINDOW_SYSTEM),surfaceless)
71PVR_DRI_CLIENT_DRIVER := pvr
72else
73PVR_DRI_CLIENT_DRIVER := $(if $(PVR_DRM_MODESET_DRIVER_NAME),$(PVR_DRM_MODESET_DRIVER_NAME),pvr)
74endif
75endif
76
77PVR_DRI_GET_EXTENSIONS_ENTRY_POINT := __driDriverGetExtensions_$(PVR_DRI_CLIENT_DRIVER)
78
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compiler.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compiler.mk
new file mode 100644
index 0000000..82c9d44
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compiler.mk
@@ -0,0 +1,240 @@
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# Check for valid values of $(MULTIARCH).
43ifeq ($(strip $(MULTIARCH)),0)
44$(error MULTIARCH must be empty to disable multiarch)
45endif
46
47define calculate-compiler-preferred-target
48 ifeq ($(2),qcc)
49 $(1)_compiler_preferred_target := qcc
50 else
51 $(1)_compiler_preferred_target := $$(subst --,-,$$(shell $(2) -dumpmachine))
52 ifeq ($$($(1)_compiler_preferred_target),)
53 $$(warning No output from '$(2) -dumpmachine')
54 $$(warning Check that the compiler is in your PATH and CROSS_COMPILE is)
55 $$(warning set correctly.)
56 $$(error Unable to run compiler '$(2)')
57 endif
58 ifneq ($$(filter x86_64-%,$$($(1)_compiler_preferred_target)),)
59 $(1)_compiler_preferred_target := x86_64-linux-gnu
60 endif
61 ifneq ($$(filter i386-% i486-% i586-% i686-%,$$($(1)_compiler_preferred_target)),)
62 $(1)_compiler_preferred_target := i386-linux-gnu
63 endif
64 ifneq ($$(filter arm-linux-android,$$($(1)_compiler_preferred_target)),)
65 $(1)_compiler_preferred_target := arm-linux-androideabi
66 endif
67 endif
68endef
69
70define cross-compiler-name
71 ifeq ($$(origin CC),file)
72 $(1) := $(2)$(3)
73 else
74 $(1) := $(3)
75 ifeq ($$(_CLANG),true)
76 ifneq ($(strip $(2)),)
77 $(1) := $(3) -target $$(patsubst %-,%,$(2)) -Qunused-arguments -fcolor-diagnostics
78 else
79 $(1) := $(3) -Qunused-arguments -fcolor-diagnostics
80 endif
81 endif
82 endif
83endef
84
85# Work out the host compiler architecture
86$(eval $(call calculate-compiler-preferred-target,host,$(HOST_CC)))
87
88ifeq ($(host_compiler_preferred_target),x86_64-linux-gnu)
89 ifeq ($(ARCH),i386)
90 HOST_PRIMARY_ARCH := host_i386
91 HOST_FORCE_32BIT := -m32
92 else
93 HOST_PRIMARY_ARCH := host_x86_64
94 HOST_32BIT_ARCH := host_i386
95 HOST_FORCE_32BIT := -m32
96 endif
97else
98ifeq ($(host_compiler_preferred_target),i386-linux-gnu)
99 HOST_PRIMARY_ARCH := host_i386
100 HOST_32BIT_ARCH := host_i386
101else
102ifeq ($(host_compiler_preferred_target),arm-linux-gnueabihf)
103 HOST_PRIMARY_ARCH := host_armhf
104 HOST_32BIT_ARCH := host_armhf
105else
106ifeq ($(host_compiler_preferred_target),aarch64-linux-gnu)
107 HOST_PRIMARY_ARCH := host_aarch64
108 HOST_32BIT_ARCH := host_armhf
109else
110 $(error Unknown host compiler target architecture $(host_compiler_preferred_target))
111endif
112endif
113endif
114endif
115
116# Workaround our lack of support for non-Linux HOST_CCs
117ifneq ($(HOST_CC_IS_LINUX),1)
118 $(warning $$(HOST_CC) is non-Linux. Trying to work around.)
119 override HOST_CC := $(HOST_CC) -D__linux__
120 $(eval $(call BothConfigMake,HOST_CC,$(HOST_CC)))
121endif
122
123$(eval $(call BothConfigMake,HOST_PRIMARY_ARCH,$(HOST_PRIMARY_ARCH)))
124$(eval $(call BothConfigMake,HOST_32BIT_ARCH,$(HOST_32BIT_ARCH)))
125$(eval $(call BothConfigMake,HOST_FORCE_32BIT,$(HOST_FORCE_32BIT)))
126
127TARGET_ALL_ARCH :=
128TARGET_PRIMARY_ARCH :=
129TARGET_SECONDARY_ARCH :=
130
131# Work out the target compiler cross triple, and include the corresponding
132# compilers/*.mk file, which sets TARGET_PRIMARY_ARCH and
133# TARGET_SECONDARY_ARCH for that compiler.
134#
135compilers := ../config/compilers
136define include-compiler-file
137 ifeq ($(strip $(1)),)
138 $$(error empty arg passed to include-compiler-file)
139 endif
140 ifeq ($$(wildcard $$(compilers)/$(1).mk),)
141 $$(warning ******************************************************)
142 $$(warning Compiler target '$(1)' not recognised)
143 $$(warning (missing $$(compilers)/$(1).mk file))
144 $$(warning ******************************************************)
145 $$(error Compiler '$(1)' not recognised)
146 endif
147 include $$(compilers)/$(1).mk
148endef
149
150# Check the kernel cross compiler to work out which architecture it targets.
151# We can then tell if CROSS_COMPILE targets a different architecture.
152ifneq ($(origin KERNEL_CROSS_COMPILE),undefined)
153 # First, calculate the value of KERNEL_CROSS_COMPILE as it would be seen by
154 # the main build, so we can check it here in the config stage.
155 $(call one-word-only,KERNEL_CROSS_COMPILE)
156 _kernel_cross_compile := $(if $(filter undef,$(KERNEL_CROSS_COMPILE)),,$(KERNEL_CROSS_COMPILE))
157 # We can take shortcuts with KERNEL_CROSS_COMPILE, as we don't want to
158 # respect CC and we don't support clang in that part currently.
159 _kernel_cross_compile := $(_kernel_cross_compile)gcc
160 # Then check the compiler.
161 $(eval $(call calculate-compiler-preferred-target,target,$(_kernel_cross_compile)))
162 $(eval $(call include-compiler-file,$(target_compiler_preferred_target)))
163 _kernel_primary_arch := $(TARGET_PRIMARY_ARCH)
164else
165 # We can take shortcuts with KERNEL_CROSS_COMPILE, as we don't want to
166 # respect CC and we don't support clang in that part currently.
167 _kernel_cross_compile := $(CROSS_COMPILE)gcc
168 # KERNEL_CROSS_COMPILE will be the same as CROSS_COMPILE, so we don't need
169 # to do the compatibility check.
170 _kernel_primary_arch :=
171endif
172
173$(eval $(call cross-compiler-name,_cc,$(CROSS_COMPILE),$(CC)))
174$(eval $(call cross-compiler-name,_cc_secondary,$(if $(CROSS_COMPILE_SECONDARY),$(CROSS_COMPILE_SECONDARY),$(CROSS_COMPILE)),$(CC_SECONDARY)))
175$(eval $(call calculate-compiler-preferred-target,target,$(_cc)))
176$(eval $(call include-compiler-file,$(target_compiler_preferred_target)))
177
178ifneq ($(SUPPORT_ANDROID_PLATFORM),1)
179ifeq ($(MULTIARCH),1)
180 ifneq ($(MAKECMDGOALS),kbuild)
181 ifneq ($(COMPONENTS),)
182 $(eval $(call calculate-compiler-preferred-target,target_secondary,$(_cc_secondary)))
183 ifneq ($(target_compiler_preferred_target),$(target_secondary_compiler_preferred_target))
184 $(eval $(call include-compiler-file,$(target_secondary_compiler_preferred_target)))
185
186 ifeq ($(TARGET_SECONDARY_ARCH),)
187 $(error $(CROSS_COMPILE_SECONDARY) not supported for MULTIARCH builds)
188 endif
189 endif
190 endif
191 endif
192endif
193endif
194
195define remap-arch
196$(if $(INTERNAL_ARCH_REMAP_$(1)),$(INTERNAL_ARCH_REMAP_$(1)),$(1))
197endef
198
199# Remap 'essentially compatible' architectures so the KM vs UM check
200# isn't too strict. These mixtures are widely supported.
201INTERNAL_ARCH_REMAP_target_armhf := target_armv7-a
202INTERNAL_ARCH_REMAP_target_armel := target_armv7-a
203INTERNAL_ARCH_REMAP_target_mips32r2el := target_mips32el
204INTERNAL_ARCH_REMAP_target_mips32r6el := target_mips32el
205
206# Sanity check: if KERNEL_CROSS_COMPILE was set, it has to target the same
207# architecture as CROSS_COMPILE.
208ifneq ($(_kernel_primary_arch),)
209 ifneq ($(call remap-arch,$(TARGET_PRIMARY_ARCH)),$(call remap-arch,$(_kernel_primary_arch)))
210 $(warning ********************************************************)
211 $(warning Error: Kernel and user-mode cross compilers build for)
212 $(warning different targets)
213 $(warning $(space)$(space)CROSS_COMPILE=$(CROSS_COMPILE))
214 $(warning $(space)$(space)$(space)builds for $(TARGET_PRIMARY_ARCH))
215 $(warning $(space)$(space)KERNEL_CROSS_COMPILE=$(KERNEL_CROSS_COMPILE))
216 $(warning $(space)$(space)$(space)builds for $(_kernel_primary_arch))
217 $(warning ********************************************************)
218 $(error Mismatching kernel and user-mode cross compilers)
219 endif
220endif
221
222ifneq ($(MULTIARCH),32only)
223TARGET_ALL_ARCH += $(TARGET_PRIMARY_ARCH)
224endif
225ifneq ($(MULTIARCH),64only)
226TARGET_ALL_ARCH += $(TARGET_SECONDARY_ARCH)
227endif
228
229$(eval $(call BothConfigMake,TARGET_PRIMARY_ARCH,$(TARGET_PRIMARY_ARCH)))
230$(eval $(call BothConfigMake,TARGET_SECONDARY_ARCH,$(TARGET_SECONDARY_ARCH)))
231$(eval $(call BothConfigMake,TARGET_ALL_ARCH,$(TARGET_ALL_ARCH)))
232$(eval $(call BothConfigMake,TARGET_FORCE_32BIT,$(TARGET_FORCE_32BIT)))
233
234$(info ******* Multiarch build: $(if $(MULTIARCH),yes,no))
235$(info ******* Primary arch: $(if $(TARGET_PRIMARY_ARCH),$(TARGET_PRIMARY_ARCH),none))
236$(info ******* Secondary arch: $(if $(TARGET_SECONDARY_ARCH),$(TARGET_SECONDARY_ARCH),none))
237
238# Find the paths to libgcc for the primary and secondary architectures.
239LIBGCC := $(shell $(_cc) -print-libgcc-file-name)
240LIBGCC_SECONDARY := $(shell $(_cc_secondary) $(TARGET_FORCE_32BIT) -print-libgcc-file-name)
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-eabi.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-eabi.mk
new file mode 100644
index 0000000..d671ba9
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-eabi.mk
@@ -0,0 +1,2 @@
1# 32-bit ARM EABI compiler
2TARGET_PRIMARY_ARCH := target_armv7-a
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-linux-androideabi.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-linux-androideabi.mk
new file mode 100644
index 0000000..8aaeaad
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-linux-androideabi.mk
@@ -0,0 +1,2 @@
1# 32-bit Android ARM compiler
2include $(compilers)/arm-eabi.mk
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/mips64el-linux-android.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/mips64el-linux-android.mk
new file mode 100644
index 0000000..8777b2a
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/compilers/mips64el-linux-android.mk
@@ -0,0 +1,29 @@
1# 64-bit MIPS R6 little-endian compiler
2IS_KERNEL_32 := 0
3ifneq ($(KERNELDIR),)
4 IS_KERNEL_32 = ($(shell grep -q "CONFIG_MIPS=y" $(KERNELDIR)/.config && echo 1 || echo 0))
5 ifneq ($(ARCH),mips)
6 ifeq ($(IS_KERNEL_32),1)
7 $(warning ******************************************************)
8 $(warning Your kernel appears to be configured for 32-bit MIPS,)
9 $(warning but CROSS_COMPILE (or KERNEL_CROSS_COMPILE) points)
10 $(warning to a 64-bit compiler.)
11 $(warning If you want a 32-bit build, either set CROSS_COMPILE)
12 $(warning to point to a 32-bit compiler, or build with ARCH=mips)
13 $(warning to force 32-bit mode with your existing compiler.)
14 $(warning ******************************************************)
15 $(error Invalid CROSS_COMPILE / kernel architecture combination)
16 endif # CONFIG_X86_32
17 endif # ARCH=mips
18endif # KERNELDIR
19
20# If ARCH=mips is set, force a build for 32-bit only, even though we're
21# using a 64-bit compiler.
22ifeq ($(ARCH),mips)
23 TARGET_PRIMARY_ARCH := target_mips32r6el
24 ifeq ($(IS_KERNEL_32),0)
25 USE_64BIT_COMPAT := 1
26 endif
27else
28 $(error MIPS64 build is not supported)
29endif
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk
index 5cd7a47..dc8c9e7 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk
@@ -223,18 +223,55 @@ endif
223# require things like SGXCORE to be set 223# require things like SGXCORE to be set
224ifneq ($(INTERNAL_CLOBBER_ONLY),true) 224ifneq ($(INTERNAL_CLOBBER_ONLY),true)
225 225
226# These are defined by the core build system, but we might need them 226# GNU Make has builtin values for CC/CXX which we don't want to trust. This
227# earlier to feature-check the compilers 227# is because $(CROSS_COMPILE)$(CC) doesn't always expand to a cross compiler
228# 228# toolchain binary name (e.g. most toolchains have 'gcc' but not 'cc').
229_CC := $(if $(filter default,$(origin CC)),gcc,$(CC)) 229
230_CLANG := \ 230ifeq ($(origin CC),default)
231 $(shell $(TOP)/eurasiacon/build/linux2/tools/cc-check.sh --clang --cc $(_CC)) 231 _CC := $(CROSS_COMPILE)gcc
232ifeq ($(_CLANG),true) 232 CC := gcc
233_CC := $(_CC) -target $(patsubst %-,%,$(CROSS_COMPILE))
234else 233else
235_CC := $(CROSS_COMPILE)$(_CC) 234 _CLANG := $(shell $(TOP)/eurasiacon/build/linux2/tools/cc-check.sh --clang --cc $(CC))
235 _CC := $(CC)
236 ifeq ($(_CLANG),true)
237 ifneq ($(strip $(CROSS_COMPILE)),)
238 _CC := $(CC) -target $(patsubst %-,%,$(CROSS_COMPILE)) -Qunused-arguments -fcolor-diagnostics
239 else
240 _CC := $(CC) -Qunused-arguments -fcolor-diagnostics
241 endif
242 endif
236endif 243endif
237HOST_CC ?= gcc 244
245ifeq ($(origin CXX),default)
246 _CXX := $(CROSS_COMPILE)g++
247 CXX := g++
248else
249 _CLANGXX := $(shell $(TOP)/eurasiacon/build/linux2/tools/cc-check.sh --clang --cc $(CXX))
250 _CXX := $(CXX)
251 ifeq ($(_CLANGXX),true)
252 ifneq ($(strip $(CROSS_COMPILE)),)
253 _CXX := $(CXX) -target $(patsubst %-,%,$(CROSS_COMPILE)) -Qunused-arguments -fcolor-diagnostics
254 else
255 _CXX := $(CXX) -Qunused-arguments -fcolor-diagnostics
256 endif
257 endif
258endif
259
260CC_SECONDARY ?= $(CC)
261HOST_CC ?= gcc
262
263# Work out if we are targeting ARM before we start tweaking _CC.
264TARGETING_AARCH64 := $(shell \
265 $(_CC) -dM -E - </dev/null | grep -q __aarch64__ && echo 1)
266
267TARGETING_ARM := $(shell \
268 $(_CC) -dM -E - </dev/null | grep __arm__ >/dev/null 2>&1 && echo 1)
269
270TARGETING_MIPS := $(shell \
271 $(_CC) -dM -E - </dev/null | grep __mips__ >/dev/null 2>&1 && echo 1)
272
273HOST_CC_IS_LINUX := $(shell \
274 $(HOST_CC) -dM -E - </dev/null | grep __linux__ >/dev/null 2>&1 && echo 1)
238 275
239-include ../config/user-defs.mk 276-include ../config/user-defs.mk
240 277
@@ -348,6 +385,11 @@ PVRSRV_MODNAME ?= pvrsrvkm
348# 385#
349SUPPORT_PVRSRV_DEVICE_CLASS ?= 1 386SUPPORT_PVRSRV_DEVICE_CLASS ?= 1
350 387
388# Default place for binaries and shared libraries
389BIN_DESTDIR ?= /usr/local/bin
390SHARE_DESTDIR ?= /usr/local/share
391SHLIB_DESTDIR ?= /usr/lib
392
351# The user didn't set CROSS_COMPILE. There's probably nothing wrong 393# The user didn't set CROSS_COMPILE. There's probably nothing wrong
352# with that, but we'll let them know anyway. 394# with that, but we'll let them know anyway.
353# 395#
@@ -366,12 +408,12 @@ $$(warning *** Setting $(1) via $$(origin $(1)) is deprecated)
366$$(error If you are trying to disable a component, use e.g. EXCLUDED_APIS="opengles1 opengl") 408$$(error If you are trying to disable a component, use e.g. EXCLUDED_APIS="opengles1 opengl")
367endif 409endif
368endef 410endef
369$(foreach _o,SYS_CFLAGS SYS_CXXFLAGS SYS_INCLUDES SYS_COMMON_LDFLAGS SYS_EXE_LDFLAGS SYS_LIB_LDFLAGS SYS_EXE_LDFLAGS_CXX SYS_LIB_LDFLAGS_CXX SUPPORT_EWS SUPPORT_OPENGLES1 SUPPORT_OPENGLES2 SUPPORT_OPENCL SUPPORT_RSCOMPUTE SUPPORT_OPENGL SUPPORT_UNITTESTS SUPPORT_XORG,$(eval $(call sanity-check-support-option-origin,$(_o)))) 411$(foreach _o,SYS_CFLAGS SYS_CXXFLAGS SYS_INCLUDES SYS_COMMON_LDFLAGS SYS_EXE_LDFLAGS SYS_LIB_LDFLAGS SYS_EXE_LDFLAGS_CXX SYS_LIB_LDFLAGS_CXX SUPPORT_EWS SUPPORT_NULLWS SUPPORT_OPENGLES1 SUPPORT_OPENGLES2 SUPPORT_OPENCL SUPPORT_OPENGL SUPPORT_SURFACELESS SUPPORT_UNITTESTS SUPPORT_XORG SUPPORT_WAYLAND,$(eval $(call sanity-check-support-option-origin,$(_o))))
370 412
371# Check for words in EXCLUDED_APIS that aren't understood by the 413# Check for words in EXCLUDED_APIS that aren't understood by the
372# common/apis/*.mk files. This should be kept in sync with all the tests on 414# common/apis/*.mk files. This should be kept in sync with all the tests on
373# EXCLUDED_APIS in those files 415# EXCLUDED_APIS in those files
374_excludable_apis := rscompute opencl opengl opengles1 opengles2 openvg ews unittests xorg xorg_unittests scripts composerhal camerahal memtrackhal 416_excludable_apis := opencl opengl opengles1 opengles2 unittests scripts composerhal camerahal memtrackhal sensorhal
375_excluded_apis := $(subst $(comma),$(space),$(EXCLUDED_APIS)) 417_excluded_apis := $(subst $(comma),$(space),$(EXCLUDED_APIS))
376_unrecognised := $(strip $(filter-out $(_excludable_apis),$(_excluded_apis))) 418_unrecognised := $(strip $(filter-out $(_excludable_apis),$(_excluded_apis)))
377ifneq ($(_unrecognised),) 419ifneq ($(_unrecognised),)
@@ -386,6 +428,9 @@ override EXCLUDED_APIS := $(filter $(_excludable_apis), $(_excluded_apis))
386# 428#
387-include components.mk 429-include components.mk
388 430
431# Set up the host and target compiler.
432include ../config/compiler.mk
433
389# PDUMP needs extra components 434# PDUMP needs extra components
390# 435#
391ifeq ($(PDUMP),1) 436ifeq ($(PDUMP),1)
@@ -399,27 +444,6 @@ KERNEL_COMPONENTS += dbgdrv
399endif 444endif
400endif 445endif
401 446
402ifeq ($(SUPPORT_PVR_REMOTE),1)
403ifneq ($(filter pvr2d,$(COMPONENTS)),)
404COMPONENTS += null_pvr2d_remote
405endif
406COMPONENTS += pvrvncsrv
407COMPONENTS += pvrvncinput
408endif
409
410ifeq ($(HAVE_WINDOW_SYSTEM_MAKEFILE),)
411 ifeq ($(WINDOW_SYSTEM_SET_INTERNALLY),)
412 ifneq ($(WINDOW_SYSTEM),)
413 $(error "The WINDOW_SYSTEM build variable is not supported on this platform")
414 endif
415 endif
416 ifneq ($(MESA_EGL),)
417 $(error "The MESA_EGL build variable is not supported on this platform")
418 endif
419 PVR_LWS_NODC :=
420 PVR_LWS_NOBC :=
421endif
422
423ifneq ($(WINDOW_SYSTEM),) 447ifneq ($(WINDOW_SYSTEM),)
424endif 448endif
425ifeq ($(MESA_EGL),1) 449ifeq ($(MESA_EGL),1)
@@ -427,11 +451,18 @@ ifeq ($(MESA_EGL),1)
427 GLES1_EXTENSION_EGL_IMAGE_EXTERNAL := 1 451 GLES1_EXTENSION_EGL_IMAGE_EXTERNAL := 1
428 GLES2_EXTENSION_EGL_IMAGE_EXTERNAL := 1 452 GLES2_EXTENSION_EGL_IMAGE_EXTERNAL := 1
429else 453else
430 ifeq ($(SUPPORT_BUILD_LWS),1) 454endif
431 else 455
456ifneq ($(SUPPORT_BUILD_LWS),)
457 ifneq ($(SYSROOT),)
458 $(info WARNING: You have specified a SYSROOT (or are using a buildroot compiler) and enabled SUPPORT_BUILD_LWS.)
459 $(info We will ignore the sysroot and will build all required LWS components.)
460 $(info Unset SUPPORT_BUILD_LWS if this is not what you want.)
432 endif 461 endif
462 override SYSROOT:=
433endif 463endif
434 464
465
435$(if $(filter config,$(D)),$(info Build configuration:)) 466$(if $(filter config,$(D)),$(info Build configuration:))
436 467
437################################# CONFIG #################################### 468################################# CONFIG ####################################
@@ -441,9 +472,11 @@ $(if $(filter config,$(D)),$(info Build configuration:))
441# 472#
442ifneq ($(strip $(KERNELDIR)),) 473ifneq ($(strip $(KERNELDIR)),)
443include ../kernel_version.mk 474include ../kernel_version.mk
444PVRSRV_MODULE_BASEDIR ?= /lib/modules/$(KERNEL_ID)/extra/ 475PVRSRV_MODULE_BASEDIR ?= /lib/modules/$(KERNEL_ID)/extra
445$(eval $(call KernelConfigMake,KERNELDIR,$(KERNELDIR))) 476$(eval $(call BothConfigMake,KERNELDIR,$(KERNELDIR)))
446# Needed only by install script 477# Needed only by install script
478$(eval $(call BothConfigMake,KERNEL_ID,$(KERNEL_ID)))
479$(eval $(call KernelConfigMake,PVRSRV_MODULE_BASEDIR,$(PVRSRV_MODULE_BASEDIR)))
447$(eval $(call KernelConfigMake,KERNEL_COMPONENTS,$(KERNEL_COMPONENTS))) 480$(eval $(call KernelConfigMake,KERNEL_COMPONENTS,$(KERNEL_COMPONENTS)))
448$(eval $(call TunableKernelConfigMake,EXTRA_PVRSRVKM_COMPONENTS,)) 481$(eval $(call TunableKernelConfigMake,EXTRA_PVRSRVKM_COMPONENTS,))
449$(eval $(call TunableKernelConfigMake,EXTRA_KBUILD_SOURCE,)) 482$(eval $(call TunableKernelConfigMake,EXTRA_KBUILD_SOURCE,))
@@ -456,34 +489,35 @@ KERNEL_CROSS_COMPILE ?= $(CROSS_COMPILE)
456$(eval $(call TunableBothConfigMake,KERNEL_CROSS_COMPILE,)) 489$(eval $(call TunableBothConfigMake,KERNEL_CROSS_COMPILE,))
457endif 490endif
458 491
492# Alternatively, allow the CC used for kbuild to be overridden
493# exactly, bypassing any KERNEL_CROSS_COMPILE configuration.
494$(eval $(call TunableBothConfigMake,KERNEL_CC,))
495
459# Check the KERNELDIR has a kernel built. 496# Check the KERNELDIR has a kernel built.
460VMLINUX := 497VMLINUX :=
461LINUXCFG := $(strip $(wildcard $(KERNELDIR)/.config)) 498#$(strip $(wildcard $(KERNELDIR)/vmlinux))
462 499
463ifneq ($(VMLINUX),) 500ifneq ($(wildcard $(VMLINUX)),)
464ifneq ($(shell file $(KERNELDIR)/vmlinux | grep 64-bit >/dev/null && echo 1),$(shell $(_CC) -dM -E - </dev/null | grep __x86_64__ >/dev/null && echo 1)) 501 ifneq ($(shell file $(KERNELDIR)/vmlinux | grep 64-bit >/dev/null && echo 1),$(shell $(_CC) -dM -E - </dev/null | grep __x86_64__ >/dev/null && echo 1))
465$(error Attempting to build 64-bit DDK against 32-bit kernel, or 32-bit DDK against 64-bit kernel. This is not allowed.) 502 $(error Attempting to build 64-bit DDK against 32-bit kernel, or 32-bit DDK against 64-bit kernel. This is not allowed.)
466endif 503 endif
467VMLINUX_IS_64BIT := $(shell file $(VMLINUX) | grep 64-bit >/dev/null || echo false) 504 LINUXCFG := $(strip $(wildcard $(KERNELDIR)/.config))
468VMLINUX_HAS_PAE36 := $(shell cat $(LINUXCFG) | grep CONFIG_X86_PAE=y >/dev/null || echo false) 505 VMLINUX_IS_64BIT := $(shell file $(VMLINUX) | grep 64-bit >/dev/null || echo false)
469VMLINUX_HAS_PAE40 := $(shell cat $(LINUXCFG) | grep CONFIG_ARM_LPAE=y >/dev/null || echo false) 506 VMLINUX_HAS_PAE36 := $(shell cat $(LINUXCFG) | grep CONFIG_X86_PAE=y >/dev/null || echo false)
470VMLINUX_HAS_DMA32 := $(shell cat $(LINUXCFG) | grep CONFIG_ZONE_DMA32=y >/dev/null || echo false) 507 VMLINUX_HAS_PAE40 := $(shell cat $(LINUXCFG) | grep CONFIG_ARM_LPAE=y >/dev/null || echo false)
471VMLINUX_HAS_DMA := $(shell cat $(LINUXCFG) | grep CONFIG_ZONE_DMA=y >/dev/null || echo false) 508 VMLINUX_HAS_DMA32 := $(shell cat $(LINUXCFG) | grep CONFIG_ZONE_DMA32=y >/dev/null || echo false)
472 509 ifneq ($(VMLINUX_IS_64BIT),false)
473 510 $(warning $$(KERNELDIR)/vmlinux: Note: vmlinux is 64-bit, which is supported but currently experimental.)
474# $(error 64BIT=$(VMLINUX_IS_64BIT) PAE36=$(VMLINUX_HAS_PAE36) PAE40=$(VMLINUX_HAS_PAE40) DMA=$(VMLINUX_HAS_DMA) DMA32=$(VMLINUX_HAS_DMA32) MMU36=$(SGX_FEATURE_36BIT_MMU)) 511 endif
475
476ifneq ($(VMLINUX_IS_64BIT),false)
477$(warning $$(KERNELDIR)/vmlinux: Note: vmlinux is 64-bit, which is supported but currently experimental.)
478endif
479else 512else
480$(warning $$(KERNELDIR)/vmlinux does not exist. Kbuild may fail.) 513 $(warning $$(KERNELDIR)/vmlinux does not exist. Kbuild may fail.)
481endif
482endif 514endif
483 515
516endif # KERNELDIR
517
484ifneq ($(VMLINUX_HAS_PAE40),false) 518ifneq ($(VMLINUX_HAS_PAE40),false)
485ifeq ($(VMLINUX_HAS_DMA),false) 519ifeq ($(VMLINUX_HAS_DMA32),false)
486$(warning SGX MMUs are currently supported up to only 36 bits max. Your Kernel is built with 40-bit PAE but does not have CONFIG_ZONE_DMA.) 520$(warning SGX MMUs are currently supported up to only 36 bits max. Your Kernel is built with 40-bit PAE but does not have CONFIG_ZONE_DMA32.)
487$(warning This means you must ensure the runtime system has <= 4GB of RAM, or there will be BIG problems...) 521$(warning This means you must ensure the runtime system has <= 4GB of RAM, or there will be BIG problems...)
488endif 522endif
489endif 523endif
@@ -498,8 +532,8 @@ endif
498else 532else
499 # Kernel is 32-bit 533 # Kernel is 32-bit
500ifneq ($(VMLINUX_HAS_PAE36),false) 534ifneq ($(VMLINUX_HAS_PAE36),false)
501ifeq ($(VMLINUX_HAS_DMA),false) 535ifeq ($(VMLINUX_HAS_DMA32),false)
502$(warning SGX is configured with 32-bit MMU. Your Kernel is 32-bit PAE, but does not have CONFIG_ZONE_DMA. ) 536$(warning SGX is configured with 32-bit MMU. Your Kernel is 32-bit PAE, but does not have CONFIG_ZONE_DMA32. )
503$(warning This means you must ensure the runtime system has <= 4GB of RAM, or there will be BIG problems...) 537$(warning This means you must ensure the runtime system has <= 4GB of RAM, or there will be BIG problems...)
504endif 538endif
505endif 539endif
@@ -509,6 +543,7 @@ endif
509 543
510# Ideally configured by platform Makefiles, as necessary 544# Ideally configured by platform Makefiles, as necessary
511# 545#
546SHADER_DESTDIR := $(SHARE_DESTDIR)/pvr/shaders/
512 547
513# Invariant options for Linux 548# Invariant options for Linux
514# 549#
@@ -517,7 +552,11 @@ $(eval $(call BothConfigC,LINUX,))
517$(eval $(call BothConfigC,PVR_BUILD_DIR,"\"$(PVR_BUILD_DIR)\"")) 552$(eval $(call BothConfigC,PVR_BUILD_DIR,"\"$(PVR_BUILD_DIR)\""))
518$(eval $(call BothConfigC,PVR_BUILD_TYPE,"\"$(BUILD)\"")) 553$(eval $(call BothConfigC,PVR_BUILD_TYPE,"\"$(BUILD)\""))
519$(eval $(call BothConfigC,PVRSRV_MODNAME,"\"$(PVRSRV_MODNAME)\"")) 554$(eval $(call BothConfigC,PVRSRV_MODNAME,"\"$(PVRSRV_MODNAME)\""))
555$(eval $(call BothConfigMake,PVRSRV_MODNAME,$(PVRSRV_MODNAME)))
556$(eval $(call BothConfigMake,PVR_BUILD_DIR,$(PVR_BUILD_DIR)))
557$(eval $(call BothConfigMake,PVR_BUILD_TYPE,$(BUILD)))
520 558
559$(eval $(call TunableBothConfigC,USE_64BIT_COMPAT,))
521$(eval $(call TunableBothConfigC,SGXCORE,)) 560$(eval $(call TunableBothConfigC,SGXCORE,))
522$(eval $(call BothConfigC,SGX$(SGXCORE),)) 561$(eval $(call BothConfigC,SGX$(SGXCORE),))
523$(eval $(call BothConfigC,SUPPORT_SGX$(SGXCORE),)) 562$(eval $(call BothConfigC,SUPPORT_SGX$(SGXCORE),))
@@ -529,6 +568,7 @@ $(eval $(call TunableBothConfigC,USE_SGX_CORE_REV_HEAD,))
529$(eval $(call BothConfigC,TRANSFER_QUEUE,)) 568$(eval $(call BothConfigC,TRANSFER_QUEUE,))
530$(eval $(call BothConfigC,PVR_SECURE_HANDLES,)) 569$(eval $(call BothConfigC,PVR_SECURE_HANDLES,))
531 570
571
532# Support syncing LISR & MISR. This is required for OS's where 572# Support syncing LISR & MISR. This is required for OS's where
533# on SPM platforms the LISR and MISR can run at the same time and 573# on SPM platforms the LISR and MISR can run at the same time and
534# thus during powerdown we need to drain all pending LISRs before 574# thus during powerdown we need to drain all pending LISRs before
@@ -537,9 +577,15 @@ $(eval $(call KernelConfigC,SUPPORT_LISR_MISR_SYNC))
537 577
538ifneq ($(DISPLAY_CONTROLLER),) 578ifneq ($(DISPLAY_CONTROLLER),)
539$(eval $(call BothConfigC,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER))) 579$(eval $(call BothConfigC,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER)))
580$(eval $(call BothConfigMake,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER)))
540endif 581endif
541 582
542ifneq ($(DRM_DISPLAY_CONTROLLER),) 583ifneq ($(DRM_DISPLAY_CONTROLLER),)
584$(eval $(call KernelConfigMake,DRM_DISPLAY_CONTROLLER,$(DRM_DISPLAY_CONTROLLER)))
585endif
586
587ifneq ($(BUFFERCLASS_MODULE),)
588$(eval $(call BothConfigMake,BUFFERCLASS_MODULE,$(BUFFERCLASS_MODULE)))
543endif 589endif
544 590
545ifneq ($(strip $(KERNELDIR)),) 591ifneq ($(strip $(KERNELDIR)),)
@@ -590,6 +636,8 @@ $(eval $(call TunableBothConfigC,SUPPORT_HW_RECOVERY,1))
590$(eval $(call TunableBothConfigC,SUPPORT_ACTIVE_POWER_MANAGEMENT,1)) 636$(eval $(call TunableBothConfigC,SUPPORT_ACTIVE_POWER_MANAGEMENT,1))
591$(eval $(call TunableBothConfigC,SUPPORT_SGX_HWPERF,1)) 637$(eval $(call TunableBothConfigC,SUPPORT_SGX_HWPERF,1))
592$(eval $(call TunableBothConfigC,SUPPORT_SGX_LOW_LATENCY_SCHEDULING,1)) 638$(eval $(call TunableBothConfigC,SUPPORT_SGX_LOW_LATENCY_SCHEDULING,1))
639$(eval $(call TunableBothConfigC,SUPPORT_SGX_CONTEXT_PRIORITY_PER_THREAD,))
640
593$(eval $(call TunableBothConfigC,SUPPORT_MEMINFO_IDS,)) 641$(eval $(call TunableBothConfigC,SUPPORT_MEMINFO_IDS,))
594$(eval $(call TunableBothConfigC,SUPPORT_SGX_NEW_STATUS_VALS,1)) 642$(eval $(call TunableBothConfigC,SUPPORT_SGX_NEW_STATUS_VALS,1))
595$(eval $(call TunableBothConfigC,SUPPORT_PDUMP_MULTI_PROCESS,)) 643$(eval $(call TunableBothConfigC,SUPPORT_PDUMP_MULTI_PROCESS,))
@@ -655,6 +703,15 @@ $(eval $(call TunableKernelConfigC,SUPPORT_PDUMP_SYNC_DEBUG,))
655$(eval $(call TunableKernelConfigC,SUPPORT_PER_SYNC_DEBUG,)) 703$(eval $(call TunableKernelConfigC,SUPPORT_PER_SYNC_DEBUG,))
656$(eval $(call TunableKernelConfigC,SUPPORT_FORCE_SYNC_DUMP,)) 704$(eval $(call TunableKernelConfigC,SUPPORT_FORCE_SYNC_DUMP,))
657 705
706ifneq ($(filter opengl,$(COMPONENTS)),)
707SUPPORT_OPENGL = 1
708endif
709ifneq ($(filter opengles1,$(COMPONENTS)),)
710endif
711ifneq ($(filter opengles2,$(COMPONENTS)),)
712endif
713ifneq ($(filter opencl,$(COMPONENTS)),)
714endif
658 715
659 716
660$(eval $(call TunableBothConfigMake,OPTIM,)) 717$(eval $(call TunableBothConfigMake,OPTIM,))
@@ -665,6 +722,25 @@ $(eval $(call TunableBothConfigMake,SUPPORT_PVRSRV_DEVICE_CLASS,))
665 722
666$(eval $(call TunableKernelConfigMake,TTRACE,)) 723$(eval $(call TunableKernelConfigMake,TTRACE,))
667 724
725
726$(if $(USE_CCACHE),$(if $(USE_DISTCC),$(error\
727Enabling both USE_CCACHE and USE_DISTCC at the same time is not supported)))
728
729SUPPORT_SGX_LOW_LATENCY_SCHEDULING ?= 1
730SUPPORT_SGX_CONTEXT_PRIORITY_PER_THREAD ?= 0
731
732ifeq ($(SUPPORT_SGX_CONTEXT_PRIORITY_PER_THREAD),1)
733ifeq ($(SUPPORT_OPENGL),)
734ifeq ($(SUPPORT_SGX_LOW_LATENCY_SCHEDULING),1)
735$(eval $(call BothConfigC,SGX_FEATURE_CONTEXT_PRIORITY_PER_THREAD,))
736else
737$(info SGX_CONTEXT_PRIORITY_PER_THREAD requires Low latency scheduling to be enabled)
738endif
739else
740$(info SGX_CONTEXT_PRIORITY_PER_THREAD requires OpenGL support to be disabled)
741endif
742endif
743
668endif # INTERNAL_CLOBBER_ONLY 744endif # INTERNAL_CLOBBER_ONLY
669 745
670export INTERNAL_CLOBBER_ONLY 746export INTERNAL_CLOBBER_ONLY
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/defs.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/defs.mk
index 311bbb0..29fc365 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/defs.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/defs.mk
@@ -54,14 +54,6 @@ define one-word-only
54$(if $(filter-out $(firstword $($(1))),$($(1))),$(error In makefile $(THIS_MAKEFILE): $$($(1)) must contain only one word),) 54$(if $(filter-out $(firstword $($(1))),$($(1))),$(error In makefile $(THIS_MAKEFILE): $$($(1)) must contain only one word),)
55endef 55endef
56 56
57define target-intermediates-of
58$(addprefix $(TARGET_OUT)/intermediates/$(1)/,$(2))
59endef
60
61define host-intermediates-of
62$(addprefix $(HOST_OUT)/intermediates/$(1)/,$(2))
63endef
64
65define module-library 57define module-library
66$(patsubst lib%.so,%,$(if $($(1)_target),$($(1)_target),$(1).so)) 58$(patsubst lib%.so,%,$(if $($(1)_target),$($(1)_target),$(1).so))
67endef 59endef
@@ -71,16 +63,69 @@ define register-module
71INTERNAL_MAKEFILE_FOR_MODULE_$(1) := $(THIS_MAKEFILE) 63INTERNAL_MAKEFILE_FOR_MODULE_$(1) := $(THIS_MAKEFILE)
72endef 64endef
73 65
66define process-module-arch
67MODULE_ARCH := $$(strip $(2))
68include $$(MAKE_TOP)/moduledefs_common.mk
69include $$(MAKE_TOP)/moduledefs/$$(MODULE_ARCH).mk
70include $$(MAKE_TOP)/$$(strip $$($$(THIS_MODULE)_type)).mk
71.SECONDARY: $$(MODULE_INTERMEDIATES_DIR)
72$$(MODULE_INTERMEDIATES_DIR):
73 $$(make-directory)
74MODULE_CLEAN_TARGETS += $$(MODULE_INTERMEDIATES_DIR)
75INTERNAL_TARGETS_FOR_$(1) += $$(MODULE_TARGETS)
76INTERNAL_CLEAN_TARGETS_FOR_$(1) += $$(MODULE_CLEAN_TARGETS)
77INTERNAL_CLOBBER_TARGETS_FOR_$(1) += $$(MODULE_CLEAN_TARGETS) $$(MODULE_CLOBBER_TARGETS) $$(MODULE_TARGETS)
78endef
79
80target_neutral_types := \
81 apk \
82 bison_parser \
83 copy_files \
84 custom \
85 flex_lexer \
86 dex \
87 gen_dispatch \
88 image_header \
89 inline_shaders \
90 java_archive \
91 module_group \
92 pds_header \
93 use_header
94
95doc_types := doc
96
97define calculate-arch-list
98# Work out the target platforms for this module
99MODULE_ARCH_LIST := $(2)
100ifeq ($$(MODULE_ARCH_LIST),)
101ifneq ($$(filter $(1),$(doc_types)),)
102MODULE_ARCH_LIST := doc
103else
104ifneq ($$(filter $(1),$(target_neutral_types)),)
105MODULE_ARCH_LIST := target_neutral
106else
107ifneq ($$(filter $(1),kernel_module),)
108MODULE_ARCH_LIST := $(TARGET_PRIMARY_ARCH)
109else
110MODULE_ARCH_LIST := $(TARGET_ALL_ARCH)
111endif
112endif
113endif
114endif
115endef
116
74define process-module 117define process-module
75THIS_MODULE := $(1) 118THIS_MODULE := $(1)
76THIS_MAKEFILE := $(INTERNAL_MAKEFILE_FOR_MODULE_$(1)) 119THIS_MAKEFILE := $(INTERNAL_MAKEFILE_FOR_MODULE_$(1))
120INTERNAL_TARGETS_FOR_$(1) :=
121INTERNAL_CLEAN_TARGETS_FOR_$(1) :=
122INTERNAL_CLOBBER_TARGETS_FOR_$(1) :=
77include $$(MAKE_TOP)/this_makefile.mk 123include $$(MAKE_TOP)/this_makefile.mk
78$$(call must-be-nonempty,THIS_MAKEFILE) 124$$(call must-be-nonempty,THIS_MAKEFILE)
79$$(call must-be-nonempty,$(1)_type) 125$$(call must-be-nonempty,$(1)_type)
80MODULE_HOST_BUILD := $$(if $(filter host_%,$($(1)_type)),true,) 126$$(eval $$(call calculate-arch-list,$$($(1)_type),$$($(1)_arch)))
81include $$(MAKE_TOP)/moduledefs.mk 127INTERNAL_ARCH_LIST_FOR_$(1) := $$(MODULE_ARCH_LIST)
82include $$(MAKE_TOP)/$$(patsubst host_%,%,$($(1)_type)).mk 128$$(foreach _m,$$(MODULE_ARCH_LIST),$$(eval $$(call process-module-arch,$(1),$$(_m))))
83INTERNAL_TARGETS_FOR_$(THIS_MODULE) := $(MODULE_TARGETS)
84endef 129endef
85 130
86# This can be used by module_type.mk files to indicate that they can't be 131# This can be used by module_type.mk files to indicate that they can't be
@@ -100,10 +145,6 @@ $(shell \
100 $$CC_CHECK --cc "$(1)" --out "$(2)" $(3)) 145 $$CC_CHECK --cc "$(1)" --out "$(2)" $(3))
101endef 146endef
102 147
103define cc-is-64bit
104$(call cc-check,$(1),$(OUT),--64)
105endef
106
107define cc-is-clang 148define cc-is-clang
108$(call cc-check,$(patsubst @%,%,$(CC)),$(OUT),--clang) 149$(call cc-check,$(patsubst @%,%,$(CC)),$(OUT),--clang)
109endef 150endef
@@ -144,10 +185,14 @@ $(call kernel-cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(
144endef 185endef
145 186
146define module-info-line 187define module-info-line
147$(if $(filter modules,$(D)),$(info $(1)),) 188$(if $(filter modules,$(D)),$(info [$(THIS_MODULE)] <$(MODULE_ARCH)> $(1)),)
148endef 189endef
149 190
150# $(call if-exists,A,B) => A if A is a file which exists, otherwise B 191# $(call if-exists,A,B) => A if A is a file which exists, otherwise B
151define if-exists 192define if-exists
152$(if $(wildcard $(1)),$(1),$(2)) 193$(if $(wildcard $(1)),$(1),$(2))
153endef 194endef
195
196define unsupported-module-var
197$(if $(strip $($(THIS_MODULE)_$(1))),$(error In makefile $(THIS_MAKEFILE): Setting '$(THIS_MODULE)_$(1)' has no effect, because $(THIS_MODULE) has type $($(THIS_MODULE)_type)))
198endef
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/jz4780_android/Makefile b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/jz4780_android/Makefile
new file mode 100644
index 0000000..999c7bf
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/jz4780_android/Makefile
@@ -0,0 +1,62 @@
1# Copyright (C) Imagination Technologies Limited. All rights reserved.
2#
3# No part of this software, either material or conceptual may be
4# copied or distributed, transmitted, transcribed, stored in a
5# retrieval system or translated into any human or computer
6# language in any form by any means, electronic, mechanical,
7# manual or other-wise, or disclosed to third parties without
8# the express written permission of: Imagination Technologies
9# Limited, HomePark Industrial Estate, Kings Langley,
10# Hertfordshire, WD4 8LZ, UK
11#
12# $Log: $
13#
14
15TARGET_DEVICE ?= ci20
16
17override SGXCORE := 540
18override SGX_CORE_REV := 130
19override SUPPORT_SLC := 1
20
21SGX_DYNAMIC_TIMING_INFO ?= 1
22SGX_FAST_DPM_INIT ?= 1
23
24override SUPPORT_LINUX_USING_WORKQUEUES := 1
25
26PVR_SYSTEM := sgx_jz4780
27HAL_VARIANT := xb4780
28
29# Force-disable camerahal on this board
30override EXCLUDED_APIS := $(EXCLUDED_APIS) camerahal
31
32include ../common/android/paths.mk
33include ../common/android/arch.mk
34include ../common/android/features.mk
35
36# Switch on USSE EDM status debug by default
37PVRSRV_USSE_EDM_STATUS_DEBUG ?= 1
38PVRSRV_DUMP_MK_TRACE ?= 1
39
40# Pre-rotate surfaces in non-screen orientations
41PVR_ANDROID_USE_WINDOW_TRANSFORM_HINT ?= 1
42
43# Disable legacy displayclass support, we will use DRM
44override SUPPORT_PVRSRV_DEVICE_CLASS := 0
45override PVR_LDM_DEVICE_TREE := 1
46override SUPPORT_DMABUF := 1
47
48PVR_ANDROID_COMPOSERHAL ?= drm
49
50include ../config/core.mk
51include ../common/android/extra_config.mk
52
53# Until dri/drm is officially supported, hide the setup in this file
54$(eval $(call BothConfigC,SUPPORT_DRI_DRM,))
55$(eval $(call BothConfigMake,SUPPORT_DRI_DRM,1))
56$(eval $(call KernelConfigC,PVR_DRI_DRM_PLATFORM_DEV,))
57$(eval $(call UserConfigC,PVR_DRM_MODESET_DRIVER_NAME,jz4780))
58$(eval $(call UserConfigC,PVR_DRM_MODESET_MODULE_NAME,dumb))
59$(eval $(call UserConfigMake,PVR_DRM_MODESET_MODULE_NAME,dumb))
60
61# Compile in interception code for USAGE_FB buffers so they use CMA/DMA
62$(eval $(call UserConfigMake,SUPPORT_ANDROID_JZ4780,1))
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/Makefile.template b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/Makefile.template
index 2b49f50..822c3df 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/Makefile.template
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/Makefile.template
@@ -40,8 +40,8 @@
40### ########################################################################### 40### ###########################################################################
41 41
42# This top-level kbuild makefile builds all the Linux kernel modules in the 42# This top-level kbuild makefile builds all the Linux kernel modules in the
43# DDK. To run kbuild, this makefile is copied to $(TARGET_OUT)/kbuild/Makefile 43# DDK. To run kbuild, this makefile is copied to $(TARGET_PRIMARY_OUT)/kbuild/Makefile
44# and make is invoked in $(TARGET_OUT)/kbuild. 44# and make is invoked in $(TARGET_PRIMARY_OUT)/kbuild.
45 45
46# This makefile doesn't define any kbuild special variables apart from 46# This makefile doesn't define any kbuild special variables apart from
47# ccflags-y and obj-m. The variables for objects are picked up by including 47# ccflags-y and obj-m. The variables for objects are picked up by including
@@ -56,11 +56,11 @@ include $(OUT)/config_kernel.mk
56 56
57.SECONDARY: 57.SECONDARY:
58 58
59$(OUT)/target/kbuild/external/%.c: $(EXTRA_KBUILD_SOURCE)/%.c 59$(OUT)/$(TARGET_PRIMARY_ARCH)/kbuild/external/%.c: $(EXTRA_KBUILD_SOURCE)/%.c
60 @if [ ! -e $(dir $@) ]; then mkdir -p $(dir $@); fi 60 @if [ ! -e $(dir $@) ]; then mkdir -p $(dir $@); fi
61 @if [ ! -h $@ ]; then ln -sf $< $@; fi 61 @if [ ! -h $@ ]; then ln -sf $< $@; fi
62 62
63$(OUT)/target/kbuild/%.c: $(TOP)/%.c 63$(OUT)/$(TARGET_PRIMARY_ARCH)/kbuild/%.c: $(TOP)/%.c
64 @if [ ! -e $(dir $@) ]; then mkdir -p $(dir $@); fi 64 @if [ ! -e $(dir $@) ]; then mkdir -p $(dir $@); fi
65 @if [ ! -h $@ ]; then ln -sf $< $@; fi 65 @if [ ! -h $@ ]; then ln -sf $< $@; fi
66 66
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/kbuild.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/kbuild.mk
index 63542f0..e289a25 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/kbuild.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/kbuild.mk
@@ -41,7 +41,7 @@
41$(if $(strip $(KERNELDIR)),,$(error KERNELDIR must be set)) 41$(if $(strip $(KERNELDIR)),,$(error KERNELDIR must be set))
42$(call directory-must-exist,$(KERNELDIR)) 42$(call directory-must-exist,$(KERNELDIR))
43 43
44$(TARGET_OUT)/kbuild/Makefile: $(MAKE_TOP)/kbuild/Makefile.template 44$(TARGET_PRIMARY_OUT)/kbuild/Makefile: $(MAKE_TOP)/kbuild/Makefile.template
45 @[ ! -e $(dir $@) ] && mkdir -p $(dir $@) || true 45 @[ ! -e $(dir $@) ] && mkdir -p $(dir $@) || true
46 $(CP) -f $< $@ 46 $(CP) -f $< $@
47 47
@@ -52,40 +52,36 @@ INTERNAL_KBUILD_OBJECTS := $(foreach _m,$(KERNEL_COMPONENTS),$(if $(INTERNAL_KBU
52INTERNAL_EXTRA_KBUILD_OBJECTS := $(foreach _m,$(EXTRA_PVRSRVKM_COMPONENTS),$(if $(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(error BUG: Unknown kbuild module "$(_m)" should have been caught earlier))) 52INTERNAL_EXTRA_KBUILD_OBJECTS := $(foreach _m,$(EXTRA_PVRSRVKM_COMPONENTS),$(if $(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(error BUG: Unknown kbuild module "$(_m)" should have been caught earlier)))
53.PHONY: kbuild kbuild_clean 53.PHONY: kbuild kbuild_clean
54 54
55kbuild: $(TARGET_OUT)/kbuild/Makefile 55kbuild: $(TARGET_PRIMARY_OUT)/kbuild/Makefile
56 @$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) M=$(abspath $(TARGET_OUT)/kbuild) \ 56 $(if $(V),,@)$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) \
57 M=$(abspath $(TARGET_PRIMARY_OUT)/kbuild) \
57 INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \ 58 INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \
58 INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \ 59 INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \
59 INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \ 60 INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \
60 EXTRA_KBUILD_SOURCE="$(EXTRA_KBUILD_SOURCE)" \ 61 EXTRA_KBUILD_SOURCE="$(EXTRA_KBUILD_SOURCE)" \
62 TARGET_PRIMARY_ARCH=$(TARGET_PRIMARY_ARCH) \
61 CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \ 63 CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \
62 EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \ 64 EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \
65 CC=$(if $(KERNEL_CC),$(KERNEL_CC),$(KERNEL_CROSS_COMPILE)gcc) \
63 V=$(V) W=$(W) \ 66 V=$(V) W=$(W) \
64 TOP=$(TOP) 67 TOP=$(TOP)
65 @for kernel_module in $(addprefix $(TARGET_OUT)/kbuild/,$(INTERNAL_KBUILD_OBJECTS:.o=.ko)); do \ 68 @for kernel_module in $(addprefix $(TARGET_PRIMARY_OUT)/kbuild/,$(INTERNAL_KBUILD_OBJECTS:.o=.ko)); do \
66 cp $$kernel_module $(TARGET_OUT); \ 69 cp $$kernel_module $(TARGET_PRIMARY_OUT); \
67 done 70 done
68 71
69kbuild_clean: $(TARGET_OUT)/kbuild/Makefile 72kbuild_clean: $(TARGET_PRIMARY_OUT)/kbuild/Makefile
70 @$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) M=$(abspath $(TARGET_OUT)/kbuild) \ 73 $(if $(V),,@)$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) \
74 M=$(abspath $(TARGET_PRIMARY_OUT)/kbuild) \
71 INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \ 75 INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \
72 INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \ 76 INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \
73 INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \ 77 INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \
74 EXTRA_KBUILD_SOURCE="$(EXTRA_KBUILD_SOURCE)" \ 78 EXTRA_KBUILD_SOURCE="$(EXTRA_KBUILD_SOURCE)" \
79 TARGET_PRIMARY_ARCH=$(TARGET_PRIMARY_ARCH) \
75 CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \ 80 CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \
76 EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \ 81 EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \
82 CC=$(if $(KERNEL_CC),$(KERNEL_CC),$(KERNEL_CROSS_COMPILE)gcc) \
77 V=$(V) W=$(W) \ 83 V=$(V) W=$(W) \
78 TOP=$(TOP) clean 84 TOP=$(TOP) clean
79 85
80kbuild_install: $(TARGET_OUT)/kbuild/Makefile 86kbuild_install: install
81 @: $(if $(strip $(DISCIMAGE)),,$(error $$(DISCIMAGE) was empty or unset while trying to use it to set INSTALL_MOD_PATH for modules_install)) 87kbuild: install_script_km
82 @$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) M=$(abspath $(TARGET_OUT)/kbuild) \
83 INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \
84 INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \
85 INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \
86 EXTRA_KBUILD_SOURCE="$(EXTRA_KBUILD_SOURCE)" \
87 CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \
88 EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \
89 INSTALL_MOD_PATH="$(DISCIMAGE)" \
90 V=$(V) W=$(W) \
91 TOP=$(TOP) modules_install
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_module.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_module.mk
index a0a1289..095fb02 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_module.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_module.mk
@@ -54,8 +54,20 @@ $(if $(wildcard $(abspath $(MODULE_KBUILD_MAKEFILE))),,$(error In makefile $(THI
54 54
55# $(THIS_MODULE)_target specifies the name of the kernel module 55# $(THIS_MODULE)_target specifies the name of the kernel module
56$(call must-be-nonempty,$(THIS_MODULE)_target) 56$(call must-be-nonempty,$(THIS_MODULE)_target)
57MODULE_TARGETS := $($(THIS_MODULE)_target)
57MODULE_KBUILD_OBJECTS := $($(THIS_MODULE)_target:.ko=.o) 58MODULE_KBUILD_OBJECTS := $($(THIS_MODULE)_target:.ko=.o)
58 59
60$(call module-info-line,kernel module: $(MODULE_TARGETS))
61
62# Unusually, we define $(THIS_MODULE)_install_path if the user didn't, as we
63# can't use MODULE_INSTALL_PATH in the scripts.mk logic.
64ifeq ($($(THIS_MODULE)_install_path),)
65$(THIS_MODULE)_install_path := \
66 $${MOD_DESTDIR}/$(patsubst $(MODULE_OUT)/%,%,$(MODULE_TARGETS))
67endif
68
69MODULE_INSTALL_PATH := $($(THIS_MODULE)_install_path)
70
59# Here we could maybe include $(MODULE_KBUILD_MAKEFILE) and look at 71# Here we could maybe include $(MODULE_KBUILD_MAKEFILE) and look at
60# $(MODULE_KBUILD_OBJECTS)-y to see which source files might be built 72# $(MODULE_KBUILD_OBJECTS)-y to see which source files might be built
61 73
@@ -70,6 +82,12 @@ $(THIS_MODULE):
70 @echo "Module $@ is a kbuild module. Run 'make kbuild' to make it" 82 @echo "Module $@ is a kbuild module. Run 'make kbuild' to make it"
71 @false 83 @false
72 84
85$(MODULE_INTERMEDIATES_DIR)/.install: MODULE_TYPE := $($(THIS_MODULE)_type)
86$(MODULE_INTERMEDIATES_DIR)/.install: MODULE_INSTALL_PATH := $(MODULE_INSTALL_PATH)
87$(MODULE_INTERMEDIATES_DIR)/.install: MODULE_TARGETS := $(patsubst $(MODULE_OUT)/%,%,$(MODULE_TARGETS))
88$(MODULE_INTERMEDIATES_DIR)/.install: $(THIS_MAKEFILE) | $(MODULE_INTERMEDIATES_DIR)
89 @echo 'install_file $(MODULE_TARGETS) $(MODULE_INSTALL_PATH) "$(MODULE_TYPE)" 0644 0:0' >$@
90
73ALL_KBUILD_MODULES += $(THIS_MODULE) 91ALL_KBUILD_MODULES += $(THIS_MODULE)
74INTERNAL_KBUILD_MAKEFILE_FOR_$(THIS_MODULE) := $(MODULE_KBUILD_MAKEFILE) 92INTERNAL_KBUILD_MAKEFILE_FOR_$(THIS_MODULE) := $(MODULE_KBUILD_MAKEFILE)
75INTERNAL_KBUILD_OBJECTS_FOR_$(THIS_MODULE) := $(MODULE_KBUILD_OBJECTS) 93INTERNAL_KBUILD_OBJECTS_FOR_$(THIS_MODULE) := $(MODULE_KBUILD_OBJECTS)
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/host_x86_64.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/host_x86_64.mk
new file mode 100644
index 0000000..1130045
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/host_x86_64.mk
@@ -0,0 +1,57 @@
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
42MODULE_HOST_BUILD := true
43
44MODULE_CC := $(HOST_CC)
45MODULE_CXX := $(HOST_CXX)
46
47MODULE_HOST_CFLAGS := $(ALL_HOST_CFLAGS) $($(THIS_MODULE)_cflags)
48MODULE_HOST_CXXFLAGS := $(ALL_HOST_CXXFLAGS) $($(THIS_MODULE)_cxxflags)
49MODULE_HOST_LDFLAGS := $(ALL_HOST_LDFLAGS) -L$(MODULE_OUT) $($(THIS_MODULE)_ldflags)
50
51ifneq ($(BUILD),debug)
52 ifeq ($(USE_LTO),1)
53 MODULE_HOST_LDFLAGS := \
54 $(sort $(filter-out -W% -D%,$(ALL_HOST_CFLAGS) $(ALL_HOST_CXXFLAGS))) \
55 $(MODULE_HOST_LDFLAGS)
56 endif
57endif
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/target_armv7-a.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/target_armv7-a.mk
new file mode 100644
index 0000000..bf0979e
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/target_armv7-a.mk
@@ -0,0 +1,130 @@
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
42MODULE_HOST_BUILD :=
43
44MODULE_CC := $(CC_SECONDARY) -march=armv7-a -mfloat-abi=softfp
45MODULE_CXX := $(CXX_SECONDARY) -march=armv7-a -mfloat-abi=softfp
46
47ifneq ($(BUILD),debug)
48MODULE_CC := $(MODULE_CC) -mthumb
49MODULE_CXX := $(MODULE_CXX) -mthumb
50endif
51
52MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags)
53MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags)
54MODULE_LDFLAGS := $($(THIS_MODULE)_ldflags) -L$(MODULE_OUT) -Xlinker -rpath-link=$(MODULE_OUT) $(ALL_LDFLAGS)
55
56# Since this is a target module, add system-specific include flags.
57MODULE_INCLUDE_FLAGS := \
58 $(SYS_INCLUDES_RESIDUAL) \
59 $(addprefix -isystem ,$(filter-out $(patsubst -I%,%,$(filter -I%,$(MODULE_INCLUDE_FLAGS))),$(SYS_INCLUDES_ISYSTEM))) \
60 $(MODULE_INCLUDE_FLAGS)
61
62ifneq ($(SUPPORT_ANDROID_PLATFORM),)
63
64_obj := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj$(if $(MULTIARCH),_arm,)
65
66# Linker flags used to find system libraries.
67MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \
68 -L$(_obj)/lib \
69 -Xlinker -rpath-link=$(_obj)/lib \
70 -L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib \
71 -Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib
72ifneq ($(wildcard $(TARGET_ROOT)/product/$(TARGET_DEVICE)/vendor),)
73MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \
74 -L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/vendor/lib \
75 -Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/vendor/lib
76else
77MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \
78 -L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/vendor/lib \
79 -Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/vendor/lib
80endif
81
82ifeq ($(NDK_ROOT),)
83
84MODULE_INCLUDE_FLAGS := \
85 -isystem $(ANDROID_ROOT)/bionic/libc/arch-arm/include \
86 -isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-arm \
87 -isystem $(ANDROID_ROOT)/bionic/libm/include/arm \
88 $(MODULE_INCLUDE_FLAGS)
89
90else # NDK_ROOT
91
92_obj := $(NDK_ROOT)/platforms/$(TARGET_PLATFORM)/arch-arm/usr
93
94MODULE_SYSTEM_LIBRARY_DIR_FLAGS := \
95 -L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a \
96 $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS)
97
98endif # NDK_ROOT
99
100MODULE_LDFLAGS += $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS)
101
102MODULE_EXE_LDFLAGS := \
103 -Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker -lc
104
105MODULE_LIB_LDFLAGS := $(MODULE_EXE_LDFLAGS)
106
107# Keeping it same as C for now
108MODULE_LIB_LDFLAGS_CXX := $(MODULE_EXE_LDFLAGS)
109
110MODULE_EXE_CRTBEGIN := $(_obj)/lib/crtbegin_dynamic.o
111MODULE_EXE_CRTEND := $(_obj)/lib/crtend_android.o
112
113MODULE_LIB_CRTBEGIN := $(_obj)/lib/crtbegin_so.o
114MODULE_LIB_CRTEND := $(_obj)/lib/crtend_so.o
115
116MODULE_LIBGCC := -Wl,--version-script,$(MAKE_TOP)/common/libgcc.lds $(LIBGCC_SECONDARY)
117
118MODULE_ARCH_TAG := $(_obj)
119
120endif # SUPPORT_ANDROID_PLATFORM
121
122ifneq ($(BUILD),debug)
123ifeq ($(USE_LTO),1)
124MODULE_LDFLAGS := \
125 $(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \
126 $(MODULE_LDFLAGS)
127endif
128endif
129
130MODULE_ARCH_BITNESS := 32
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/target_mips32r6el.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/target_mips32r6el.mk
new file mode 100644
index 0000000..0891966
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs/target_mips32r6el.mk
@@ -0,0 +1,134 @@
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