summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew F. Davis2018-06-26 16:24:59 -0500
committerAndrew F. Davis2018-06-26 16:24:59 -0500
commit493daaec1e59310ccbd342fdd918d069e495b769 (patch)
treefa4a4af738756b1d3e1741b335d690c100fac223
parentd44d1d35d1d7e1feb36c615beae57c3114f37d70 (diff)
downloadvendor-ti-am57x-sgx-km-source.tar.gz
vendor-ti-am57x-sgx-km-source.tar.xz
vendor-ti-am57x-sgx-km-source.zip
sgx_km: Build SGX KM from sourcesgx-km-source
Signed-off-by: Andrew F. Davis <afd@ti.com>
-rw-r--r--sgx_km/Android.mk35
-rw-r--r--sgx_km/eurasia_km/GPL-COPYING344
-rw-r--r--sgx_km/eurasia_km/INSTALL72
-rw-r--r--sgx_km/eurasia_km/MIT-COPYING41
-rw-r--r--sgx_km/eurasia_km/README49
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/_objects.mk121
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/bits.mk116
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/buildvars.mk267
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/commands.mk312
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/arch.mk107
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk158
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk115
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/features.mk254
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/install.sh.tpl315
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk60
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk192
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk63
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/ion.mk65
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/omap4.mk44
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/common/opencl.mk40
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/config/compiler.mk240
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-eabi.mk2
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-linux-androideabi.mk2
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/config/compilers/mips64el-linux-android.mk29
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/config/core.mk790
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/defs.mk198
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/kbuild/Makefile.template91
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/kbuild/kbuild.mk87
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/kernel_module.mk93
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/kernel_version.mk100
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/moduledefs/host_x86_64.mk57
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/moduledefs/target_armv7-a.mk130
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/moduledefs/target_mips32r6el.mk134
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/moduledefs/target_neutral.mk45
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/moduledefs_common.mk164
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/modules.mk48
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/omap_android/Makefile263
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/prepare_tree.mk56
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/pvrversion.mk53
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/scripts.mk364
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/shared_library.mk210
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/this_makefile.mk68
-rwxr-xr-xsgx_km/eurasia_km/eurasiacon/build/linux2/tools/cc-check.sh119
-rw-r--r--sgx_km/eurasia_km/eurasiacon/build/linux2/toplevel.mk312
-rw-r--r--sgx_km/eurasia_km/include4/dbgdrvif.h382
-rw-r--r--sgx_km/eurasia_km/include4/img_defs.h227
-rw-r--r--sgx_km/eurasia_km/include4/img_types.h231
-rw-r--r--sgx_km/eurasia_km/include4/kernel_types.h136
-rw-r--r--sgx_km/eurasia_km/include4/pdumpdefs.h127
-rw-r--r--sgx_km/eurasia_km/include4/pvr_debug.h283
-rw-r--r--sgx_km/eurasia_km/include4/pvr_sync_user.h137
-rw-r--r--sgx_km/eurasia_km/include4/pvrmodule.h48
-rw-r--r--sgx_km/eurasia_km/include4/pvrversion.h68
-rw-r--r--sgx_km/eurasia_km/include4/services.h1641
-rw-r--r--sgx_km/eurasia_km/include4/servicesext.h980
-rw-r--r--sgx_km/eurasia_km/include4/sgx_options.h245
-rw-r--r--sgx_km/eurasia_km/include4/sgxapi_km.h554
-rw-r--r--sgx_km/eurasia_km/include4/sgxscript.h108
-rw-r--r--sgx_km/eurasia_km/services4/include/env/linux/pvr_drm_shared.h76
-rw-r--r--sgx_km/eurasia_km/services4/include/ion_sys_private.h50
-rw-r--r--sgx_km/eurasia_km/services4/include/kernelbuffer.h97
-rw-r--r--sgx_km/eurasia_km/services4/include/kerneldisplay.h239
-rw-r--r--sgx_km/eurasia_km/services4/include/pdump.h51
-rw-r--r--sgx_km/eurasia_km/services4/include/pvr_bridge.h1696
-rw-r--r--sgx_km/eurasia_km/services4/include/pvr_bridge_km.h422
-rw-r--r--sgx_km/eurasia_km/services4/include/pvrmmap.h73
-rw-r--r--sgx_km/eurasia_km/services4/include/pvrsrv_errors.h311
-rw-r--r--sgx_km/eurasia_km/services4/include/servicesint.h616
-rw-r--r--sgx_km/eurasia_km/services4/include/sgx_bridge.h577
-rw-r--r--sgx_km/eurasia_km/services4/include/sgx_mkif_km.h476
-rw-r--r--sgx_km/eurasia_km/services4/include/sgx_ukernel_status_codes.h998
-rw-r--r--sgx_km/eurasia_km/services4/include/sgxinfo.h341
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.c5024
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.h257
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/bridged/bridged_support.c113
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/bridged/bridged_support.h68
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/bridged/sgx/bridged_sgx_bridge.c3058
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/bridged/sgx/bridged_sgx_bridge.h61
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/buffer_manager.c3485
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/deviceclass.c2945
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/deviceid.h51
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/devicemem.c3491
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/handle.c2548
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/hash.c739
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/lists.c159
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/mem.c175
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/mem_debug.c276
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/metrics.c209
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/osfunc_common.c48
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/pdump_common.c3117
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/perproc.c398
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/power.c996
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/pvrsrv.c1909
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/queue.c1764
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/ra.c2217
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/refcount.c760
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/resman.c990
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/common/ttrace.c601
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/mmu.c4734
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/mmu.h501
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/pb.c493
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/sgx_bridge_km.h254
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/sgxconfig.h645
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/sgxinfokm.h631
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/sgxinit.c3642
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/sgxkick.c811
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c666
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/sgxreset.c824
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/sgxtransfer.c1007
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/sgxutils.c1976
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/devices/sgx/sgxutils.h195
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/Kbuild.mk194
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/Linux.mk45
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/dma_fence_sync_native_server.c94
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/dmabuf.c328
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/dmabuf.h98
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/env_data.h93
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/env_perproc.h79
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/event.c413
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/event.h48
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/ion.c580
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/ion.h73
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/linkage.h77
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/lma_heap_ion.h45
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/lock.h56
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/mm.c2770
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/mm.h675
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/mmap.c1659
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/mmap.h232
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/module.c1288
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/mutex.c163
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/mutex.h100
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/mutils.c179
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/mutils.h128
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/osfunc.c4850
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/osperproc.c155
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pdump.c855
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/private_data.h91
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/proc.c1059
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/proc.h95
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_bridge_k.c761
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_counting_timeline.c158
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_counting_timeline.h25
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_debug.c522
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_drm.c808
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_drm.h185
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_fence.c1681
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_fence.h252
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_linux_fence.c1533
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_linux_fence.h81
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_sw_fence.c141
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_sw_fence.h17
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_sync.c1492
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_sync.h201
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_sync_common.c379
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_sync_common.h90
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_sync_dma_fence.c812
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvr_uaccess.h89
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/pvrsrv_sync_server.h29
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/systrace.c376
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/env/linux/systrace.h70
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/mnemedefs.h117
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/ocpdefs.h308
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgx520defs.h555
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgx530defs.h542
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgx531defs.h601
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgx535defs.h739
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgx540defs.h605
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgx543_v1.164defs.h1396
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgx543defs.h1487
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgx544defs.h1487
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgx545defs.h1290
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgxdefs.h116
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgxerrata.h484
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgxfeaturedefs.h290
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgxmmu.h99
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/hwdefs/sgxmpdefs.h387
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/buffer_manager.h640
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/device.h409
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/devicemem.h52
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/dmabuf_sync.h69
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/handle.h547
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/hash.h277
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/ion_sync.h73
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/lists.h353
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/metrics.h146
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/osfunc.h802
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/osperproc.h94
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/pdump_int.h100
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/pdump_km.h446
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/pdump_osfunc.h385
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/perfkm.h53
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/perproc.h141
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/power.h140
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/queue.h154
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/ra.h290
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/refcount.h293
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/resman.h153
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/services_headers.h68
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/srvkm.h273
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/ttrace.h200
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/ttrace_common.h151
-rw-r--r--sgx_km/eurasia_km/services4/srvkm/include/ttrace_tokens.h135
-rw-r--r--sgx_km/eurasia_km/services4/system/include/syscommon.h393
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/oemfuncs.h80
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sgxfreq.c846
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sgxfreq.h122
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sgxfreq_activeidle.c206
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sgxfreq_cool.c216
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sgxfreq_on3demand.c295
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sgxfreq_onoff.c205
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sgxfreq_userspace.c149
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sysconfig.c1267
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sysconfig.h113
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sysinfo.h70
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/syslocal.h262
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sysutils.c63
-rw-r--r--sgx_km/eurasia_km/services4/system/omap/sysutils_linux.c721
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/client/linuxsrv.h64
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/Kbuild.mk51
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/Linux.mk45
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/common/dbgdriv.c2936
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/common/dbgdriv.h155
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/common/dbgdriv_handle.c141
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/common/dbgdriv_ioctl.h57
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/common/hostfunc.h82
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/common/hotkey.c199
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/common/hotkey.h82
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/common/ioctl.c827
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/linux/hostfunc.c395
-rw-r--r--sgx_km/eurasia_km/tools/intern/debug/dbgdriv/linux/main.c355
-rw-r--r--sgx_km/lib/modules/pvrsrvkm.kobin417820 -> 0 bytes
232 files changed, 123021 insertions, 0 deletions
diff --git a/sgx_km/Android.mk b/sgx_km/Android.mk
new file mode 100644
index 0000000..fb27474
--- /dev/null
+++ b/sgx_km/Android.mk
@@ -0,0 +1,35 @@
1#
2# Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH := $(call my-dir)
18include $(CLEAR_VARS)
19
20local-build := $(LOCAL_PATH)/eurasia_km/eurasiacon/build/linux2/omap_android
21out-intermediates := $(call intermediates-dir-for, ETC, pvrsrvkm)
22
23PVRSRVKM := $(LOCAL_PATH)/lib/modules/pvrsrvkm.ko
24
25$(PVRSRVKM): $(local-build)/Makefile $(KERNELDIR)/.version
26 @echo "Building $@"
27 @$(MAKE) -C $(local-build) \
28 CROSS_COMPILE=arm-linux-androideabi- \
29 KERNEL_CROSS_COMPILE=arm-linux-androideabi- \
30 KERNELDIR=$(KERNELDIR) \
31 ARCH=arm \
32 ANDROID_ROOT=$(ANDROID_BUILD_TOP) \
33 PLATFORM_RELEASE="8.1" \
34 OUT=$(abspath $(out-intermediates))
35 @$(ACP) -fp $(abspath $(out-intermediates))/target_armv7-a/pvrsrvkm.ko $@
diff --git a/sgx_km/eurasia_km/GPL-COPYING b/sgx_km/eurasia_km/GPL-COPYING
new file mode 100644
index 0000000..83d1261
--- /dev/null
+++ b/sgx_km/eurasia_km/GPL-COPYING
@@ -0,0 +1,344 @@
1-------------------------------------------------------------------------
2
3 GNU GENERAL PUBLIC LICENSE
4 Version 2, June 1991
5
6 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
7 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
8 Everyone is permitted to copy and distribute verbatim copies
9 of this license document, but changing it is not allowed.
10
11 Preamble
12
13 The licenses for most software are designed to take away your
14freedom to share and change it. By contrast, the GNU General Public
15License is intended to guarantee your freedom to share and change free
16software--to make sure the software is free for all its users. This
17General Public License applies to most of the Free Software
18Foundation's software and to any other program whose authors commit to
19using it. (Some other Free Software Foundation software is covered by
20the GNU Library General Public License instead.) You can apply it to
21your programs, too.
22
23 When we speak of free software, we are referring to freedom, not
24price. Our General Public Licenses are designed to make sure that you
25have the freedom to distribute copies of free software (and charge for
26this service if you wish), that you receive source code or can get it
27if you want it, that you can change the software or use pieces of it
28in new free programs; and that you know you can do these things.
29
30 To protect your rights, we need to make restrictions that forbid
31anyone to deny you these rights or to ask you to surrender the rights.
32These restrictions translate to certain responsibilities for you if you
33distribute copies of the software, or if you modify it.
34
35 For example, if you distribute copies of such a program, whether
36gratis or for a fee, you must give the recipients all the rights that
37you have. You must make sure that they, too, receive or can get the
38source code. And you must show them these terms so they know their
39rights.
40
41 We protect your rights with two steps: (1) copyright the software, and
42(2) offer you this license which gives you legal permission to copy,
43distribute and/or modify the software.
44
45 Also, for each author's protection and ours, we want to make certain
46that everyone understands that there is no warranty for this free
47software. If the software is modified by someone else and passed on, we
48want its recipients to know that what they have is not the original, so
49that any problems introduced by others will not reflect on the original
50authors' reputations.
51
52 Finally, any free program is threatened constantly by software
53patents. We wish to avoid the danger that redistributors of a free
54program will individually obtain patent licenses, in effect making the
55program proprietary. To prevent this, we have made it clear that any
56patent must be licensed for everyone's free use or not licensed at all.
57
58 The precise terms and conditions for copying, distribution and
59modification follow.
60
61 GNU GENERAL PUBLIC LICENSE
62 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
63
64 0. This License applies to any program or other work which contains
65a notice placed by the copyright holder saying it may be distributed
66under the terms of this General Public License. The "Program", below,
67refers to any such program or work, and a "work based on the Program"
68means either the Program or any derivative work under copyright law:
69that is to say, a work containing the Program or a portion of it,
70either verbatim or with modifications and/or translated into another
71language. (Hereinafter, translation is included without limitation in
72the term "modification".) Each licensee is addressed as "you".
73
74Activities other than copying, distribution and modification are not
75covered by this License; they are outside its scope. The act of
76running the Program is not restricted, and the output from the Program
77is covered only if its contents constitute a work based on the
78Program (independent of having been made by running the Program).
79Whether that is true depends on what the Program does.
80
81 1. You may copy and distribute verbatim copies of the Program's
82source code as you receive it, in any medium, provided that you
83conspicuously and appropriately publish on each copy an appropriate
84copyright notice and disclaimer of warranty; keep intact all the
85notices that refer to this License and to the absence of any warranty;
86and give any other recipients of the Program a copy of this License
87along with the Program.
88
89You may charge a fee for the physical act of transferring a copy, and
90you may at your option offer warranty protection in exchange for a fee.
91
92 2. You may modify your copy or copies of the Program or any portion
93of it, thus forming a work based on the Program, and copy and
94distribute such modifications or work under the terms of Section 1
95above, provided that you also meet all of these conditions:
96
97 a) You must cause the modified files to carry prominent notices
98 stating that you changed the files and the date of any change.
99
100 b) You must cause any work that you distribute or publish, that in
101 whole or in part contains or is derived from the Program or any
102 part thereof, to be licensed as a whole at no charge to all third
103 parties under the terms of this License.
104
105 c) If the modified program normally reads commands interactively
106 when run, you must cause it, when started running for such
107 interactive use in the most ordinary way, to print or display an
108 announcement including an appropriate copyright notice and a
109 notice that there is no warranty (or else, saying that you provide
110 a warranty) and that users may redistribute the program under
111 these conditions, and telling the user how to view a copy of this
112 License. (Exception: if the Program itself is interactive but
113 does not normally print such an announcement, your work based on
114 the Program is not required to print an announcement.)
115
116These requirements apply to the modified work as a whole. If
117identifiable sections of that work are not derived from the Program,
118and can be reasonably considered independent and separate works in
119themselves, then this License, and its terms, do not apply to those
120sections when you distribute them as separate works. But when you
121distribute the same sections as part of a whole which is a work based
122on the Program, the distribution of the whole must be on the terms of
123this License, whose permissions for other licensees extend to the
124entire whole, and thus to each and every part regardless of who wrote it.
125
126Thus, it is not the intent of this section to claim rights or contest
127your rights to work written entirely by you; rather, the intent is to
128exercise the right to control the distribution of derivative or
129collective works based on the Program.
130
131In addition, mere aggregation of another work not based on the Program
132with the Program (or with a work based on the Program) on a volume of
133a storage or distribution medium does not bring the other work under
134the scope of this License.
135
136 3. You may copy and distribute the Program (or a work based on it,
137under Section 2) in object code or executable form under the terms of
138Sections 1 and 2 above provided that you also do one of the following:
139
140 a) Accompany it with the complete corresponding machine-readable
141 source code, which must be distributed under the terms of Sections
142 1 and 2 above on a medium customarily used for software interchange; or,
143
144 b) Accompany it with a written offer, valid for at least three
145 years, to give any third party, for a charge no more than your
146 cost of physically performing source distribution, a complete
147 machine-readable copy of the corresponding source code, to be
148 distributed under the terms of Sections 1 and 2 above on a medium
149 customarily used for software interchange; or,
150
151 c) Accompany it with the information you received as to the offer
152 to distribute corresponding source code. (This alternative is
153 allowed only for noncommercial distribution and only if you
154 received the program in object code or executable form with such
155 an offer, in accord with Subsection b above.)
156
157The source code for a work means the preferred form of the work for
158making modifications to it. For an executable work, complete source
159code means all the source code for all modules it contains, plus any
160associated interface definition files, plus the scripts used to
161control compilation and installation of the executable. However, as a
162special exception, the source code distributed need not include
163anything that is normally distributed (in either source or binary
164form) with the major components (compiler, kernel, and so on) of the
165operating system on which the executable runs, unless that component
166itself accompanies the executable.
167
168If distribution of executable or object code is made by offering
169access to copy from a designated place, then offering equivalent
170access to copy the source code from the same place counts as
171distribution of the source code, even though third parties are not
172compelled to copy the source along with the object code.
173
174 4. You may not copy, modify, sublicense, or distribute the Program
175except as expressly provided under this License. Any attempt
176otherwise to copy, modify, sublicense or distribute the Program is
177void, and will automatically terminate your rights under this License.
178However, parties who have received copies, or rights, from you under
179this License will not have their licenses terminated so long as such
180parties remain in full compliance.
181
182 5. You are not required to accept this License, since you have not
183signed it. However, nothing else grants you permission to modify or
184distribute the Program or its derivative works. These actions are
185prohibited by law if you do not accept this License. Therefore, by
186modifying or distributing the Program (or any work based on the
187Program), you indicate your acceptance of this License to do so, and
188all its terms and conditions for copying, distributing or modifying
189the Program or works based on it.
190
191 6. Each time you redistribute the Program (or any work based on the
192Program), the recipient automatically receives a license from the
193original licensor to copy, distribute or modify the Program subject to
194these terms and conditions. You may not impose any further
195restrictions on the recipients' exercise of the rights granted herein.
196You are not responsible for enforcing compliance by third parties to
197this License.
198
199 7. If, as a consequence of a court judgment or allegation of patent
200infringement or for any other reason (not limited to patent issues),
201conditions are imposed on you (whether by court order, agreement or
202otherwise) that contradict the conditions of this License, they do not
203excuse you from the conditions of this License. If you cannot
204distribute so as to satisfy simultaneously your obligations under this
205License and any other pertinent obligations, then as a consequence you
206may not distribute the Program at all. For example, if a patent
207license would not permit royalty-free redistribution of the Program by
208all those who receive copies directly or indirectly through you, then
209the only way you could satisfy both it and this License would be to
210refrain entirely from distribution of the Program.
211
212If any portion of this section is held invalid or unenforceable under
213any particular circumstance, the balance of the section is intended to
214apply and the section as a whole is intended to apply in other
215circumstances.
216
217It is not the purpose of this section to induce you to infringe any
218patents or other property right claims or to contest validity of any
219such claims; this section has the sole purpose of protecting the
220integrity of the free software distribution system, which is
221implemented by public license practices. Many people have made
222generous contributions to the wide range of software distributed
223through that system in reliance on consistent application of that
224system; it is up to the author/donor to decide if he or she is willing
225to distribute software through any other system and a licensee cannot
226impose that choice.
227
228This section is intended to make thoroughly clear what is believed to
229be a consequence of the rest of this License.
230
231 8. If the distribution and/or use of the Program is restricted in
232certain countries either by patents or by copyrighted interfaces, the
233original copyright holder who places the Program under this License
234may add an explicit geographical distribution limitation excluding
235those countries, so that distribution is permitted only in or among
236countries not thus excluded. In such case, this License incorporates
237the limitation as if written in the body of this License.
238
239 9. The Free Software Foundation may publish revised and/or new versions
240of the General Public License from time to time. Such new versions will
241be similar in spirit to the present version, but may differ in detail to
242address new problems or concerns.
243
244Each version is given a distinguishing version number. If the Program
245specifies a version number of this License which applies to it and "any
246later version", you have the option of following the terms and conditions
247either of that version or of any later version published by the Free
248Software Foundation. If the Program does not specify a version number of
249this License, you may choose any version ever published by the Free Software
250Foundation.
251
252 10. If you wish to incorporate parts of the Program into other free
253programs whose distribution conditions are different, write to the author
254to ask for permission. For software which is copyrighted by the Free
255Software Foundation, write to the Free Software Foundation; we sometimes
256make exceptions for this. Our decision will be guided by the two goals
257of preserving the free status of all derivatives of our free software and
258of promoting the sharing and reuse of software generally.
259
260 NO WARRANTY
261
262 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
263FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
264OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
265PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
266OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
267MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
268TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
269PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
270REPAIR OR CORRECTION.
271
272 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
273WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
274REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
275INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
276OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
277TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
278YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
279PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
280POSSIBILITY OF SUCH DAMAGES.
281
282 END OF TERMS AND CONDITIONS
283
284 Appendix: How to Apply These Terms to Your New Programs
285
286 If you develop a new program, and you want it to be of the greatest
287possible use to the public, the best way to achieve this is to make it
288free software which everyone can redistribute and change under these terms.
289
290 To do so, attach the following notices to the program. It is safest
291to attach them to the start of each source file to most effectively
292convey the exclusion of warranty; and each file should have at least
293the "copyright" line and a pointer to where the full notice is found.
294
295 <one line to give the program's name and a brief idea of what it does.>
296 Copyright (C) 19yy <name of author>
297
298 This program is free software; you can redistribute it and/or modify
299 it under the terms of the GNU General Public License as published by
300 the Free Software Foundation; either version 2 of the License, or
301 (at your option) any later version.
302
303 This program is distributed in the hope that it will be useful,
304 but WITHOUT ANY WARRANTY; without even the implied warranty of
305 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
306 GNU General Public License for more details.
307
308 You should have received a copy of the GNU General Public License
309 along with this program; if not, write to the Free Software
310 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
311
312Also add information on how to contact you by electronic and paper mail.
313
314If the program is interactive, make it output a short notice like this
315when it starts in an interactive mode:
316
317 Gnomovision version 69, Copyright (C) 19yy name of author
318 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
319 This is free software, and you are welcome to redistribute it
320 under certain conditions; type `show c' for details.
321
322The hypothetical commands `show w' and `show c' should show the appropriate
323parts of the General Public License. Of course, the commands you use may
324be called something other than `show w' and `show c'; they could even be
325mouse-clicks or menu items--whatever suits your program.
326
327You should also get your employer (if you work as a programmer) or your
328school, if any, to sign a "copyright disclaimer" for the program, if
329necessary. Here is a sample; alter the names:
330
331 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
332 `Gnomovision' (which makes passes at compilers) written by James Hacker.
333
334 <signature of Ty Coon>, 1 April 1989
335 Ty Coon, President of Vice
336
337This General Public License does not permit incorporating your program into
338proprietary programs. If your program is a subroutine library, you may
339consider it more useful to permit linking proprietary applications with the
340library. If this is what you want to do, use the GNU Library General
341Public License instead of this License.
342
343-------------------------------------------------------------------------
344
diff --git a/sgx_km/eurasia_km/INSTALL b/sgx_km/eurasia_km/INSTALL
new file mode 100644
index 0000000..aefa6c3
--- /dev/null
+++ b/sgx_km/eurasia_km/INSTALL
@@ -0,0 +1,72 @@
1
2SGX Embedded Systems DDK for the Linux kernel.
3Copyright (C) Imagination Technologies Ltd. All rights reserved.
4======================================================================
5
6This file covers how to build and install the Imagination Technologies
7SGX DDK for the Linux kernel.
8
9
10Build System Environment Variables
11-------------------------------------------
12
13The SGX DDK Build scripts depend on a number of environment variables
14being setup before compilation or installation of DDK software can
15commence:
16
17$DISCIMAGE
18The DDK Build scripts install files to the location specified by the
19DISCIMAGE environment variable, when the make install target is used.
20This should point to the target filesystem.
21$ export DISCIMAGE=/path/to/filesystem
22
23$KERNELDIR
24When building the SGX DDK kernel module, the build needs access
25to the headers of the Linux kernel
26$ export KERNELDIR=/path/to/kernel
27
28$PATH
29If a cross compiler is being used make sure the PATH environment variable
30includes the path to the toolchain
31$ export PATH=$PATH:/path/to/toolchain
32
33$CROSS_COMPILE
34Since the SGX DDK Build scripts are geared toward a cross-compilation
35workflow, the CROSS_COMPILE environment variable needs to be set
36$ export CROSS_COMPILE=toolchain-prefix-
37
38
39Build and Install Instructions
40-------------------------------------------
41
42The SGX DDK configures different target builds within directories under
43eurasiacon/build/linux/.
44
45The supported build targets are:
46
47 all Makes everything
48 clean Removes all intermediate files created by a build.
49 clobber Removes all binaries for all builds as well.
50 install Runs the install script generated by the build.
51
52The following variables may be set on the command line to influence a build.
53
54 BUILD The type of build being performed.
55 Alternatives are release, timing or debug.
56 CFLAGS Build dependent optimisations and debug information flags.
57 SILENT Determines whether text of commands is produced during build.
58
59To build for, change to the appropriate target directory, e.g.:
60$ cd eurasiacon/build/linux/platform/kbuild
61
62Issue the make command:
63$ make BUILD=debug all
64
65The DDK software must be installed by the root user. Become the root user:
66$ su
67
68Install the DDK software:
69$ make install
70
71Become an ordinary user again:
72$ exit
diff --git a/sgx_km/eurasia_km/MIT-COPYING b/sgx_km/eurasia_km/MIT-COPYING
new file mode 100644
index 0000000..0cbd14e
--- /dev/null
+++ b/sgx_km/eurasia_km/MIT-COPYING
@@ -0,0 +1,41 @@
1
2This software is Copyright (C) Imagination Technologies Ltd.
3
4You may use, distribute and copy this software under the terms of the MIT
5license displayed below.
6
7-----------------------------------------------------------------------------
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19Alternatively, this Software may be used under the terms of the GNU General
20Public License Version 2 ("GPL") in which case the provisions of GPL are
21applicable instead of those above.
22
23If you wish to allow use of your version of this Software only under the terms
24of GPL, and not to allow others to use your version of this file under the
25terms of the MIT license, indicate your decision by deleting from each file
26the provisions above and replace them with the notice and other provisions
27required by GPL as set out in the file called "GPL-COPYING" included in this
28distribution. If you do not delete the provisions above, a recipient may use
29your version of this file under the terms of either the MIT license or GPL.
30
31-----------------------------------------------------------------------------
32
33EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
34PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
35BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
36PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
37COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
38IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
39CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40
41-----------------------------------------------------------------------------
diff --git a/sgx_km/eurasia_km/README b/sgx_km/eurasia_km/README
new file mode 100644
index 0000000..2eae109
--- /dev/null
+++ b/sgx_km/eurasia_km/README
@@ -0,0 +1,49 @@
1
2SGX Embedded Systems DDK for Linux kernel.
3Copyright (C) Imagination Technologies Ltd. All rights reserved.
4======================================================================
5
6
7About
8-------------------------------------------
9
10This is the Imagination Technologies SGX DDK for the Linux kernel.
11
12
13License
14-------------------------------------------
15
16You may use, distribute and copy this software under the terms of the MIT
17license. Details of this license can be found in the file "MIT-COPYING".
18
19Alternatively, you may use, distribute and copy this software under the terms
20of the GNU General Public License version 2. The full GNU General Public
21License version 2 can be found in the file "GPL-COPYING".
22
23
24Build and Install Instructions
25-------------------------------------------
26
27For details see the "INSTALL" file.
28
29To build for, change to the appropriate target directory, e.g.:
30$ cd eurasiacon/build/linux/platform/kbuild
31
32Issue the make command:
33$ make BUILD=debug all
34
35The DDK software must be installed by the root user. Become the root user:
36$ su
37
38Install the DDK software:
39# make install
40
41Become an ordinary user again:
42$ exit
43
44
45Contact information:
46-------------------------------------------
47
48Imagination Technologies Ltd. <gpl-support@imgtec.com>
49Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/_objects.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/_objects.mk
new file mode 100644
index 0000000..82da9d6
--- /dev/null
+++ b/sgx_km/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/sgx_km/eurasia_km/eurasiacon/build/linux2/bits.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/bits.mk
new file mode 100644
index 0000000..b6bcbbc
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/bits.mk
@@ -0,0 +1,116 @@
1########################################################################### ###
2#@Title Useful special targets which don't build anything
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
42ifneq ($(filter dumpvar-%,$(MAKECMDGOALS)),)
43dumpvar-%: ;
44$(foreach _var_to_dump,$(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS))),$(info $(if $(filter undefined,$(origin $(_var_to_dump))),# $$($(_var_to_dump)) is not set,$(_var_to_dump) := $($(_var_to_dump)))))
45endif
46
47ifneq ($(filter whereis-%,$(MAKECMDGOALS)),)
48whereis-%: ;
49$(foreach _module_to_find,$(patsubst whereis-%,%,$(filter whereis-%,$(MAKECMDGOALS))),$(info $(if $(INTERNAL_MAKEFILE_FOR_MODULE_$(_module_to_find)),$(INTERNAL_MAKEFILE_FOR_MODULE_$(_module_to_find)),# No module $(_module_to_find))))
50endif
51
52ifneq ($(filter whatis-%,$(MAKECMDGOALS)),)
53whatis-$(HOST_OUT)/%: ;
54whatis-$(TARGET_PRIMARY_OUT)/%: ;
55whatis-$(TARGET_NEUTRAL_OUT)/%: ;
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)),)))))
57endif
58
59.PHONY: ls-modules
60ls-modules:
61 @: $(foreach _m,$(ALL_MODULES),$(info $($(_m)_type) $(_m) $(patsubst $(TOP)/%,%,$(INTERNAL_MAKEFILE_FOR_MODULE_$(_m)))))
62
63ifeq ($(strip $(MAKECMDGOALS)),visualise)
64FORMAT ?= xlib
65GRAPHVIZ ?= neato
66visualise: $(OUT)/MAKE_RULES.dot
67 $(GRAPHVIZ) -T$(FORMAT) -o $(OUT)/MAKE_RULES.$(FORMAT) $<
68$(OUT)/MAKE_RULES.dot: $(OUT)/MAKE_RULES
69 perl $(MAKE_TOP)/tools/depgraph.pl -t $(TOP) -g $(firstword $(GRAPHVIZ)) $(OUT)/MAKE_RULES >$(OUT)/MAKE_RULES.dot
70$(OUT)/MAKE_RULES: $(ALL_MAKEFILES)
71 -$(MAKE) -C $(TOP) -f $(MAKE_TOP)/toplevel.mk TOP=$(TOP) OUT=$(OUT) ls-modules -qp >$(OUT)/MAKE_RULES 2>&1
72else
73visualise:
74 @: $(error visualise specified along with other goals. This is not supported)
75endif
76
77.PHONY: help
78help:
79 @echo 'Build targets'
80 @echo ' make, make build Build all components of the build'
81 @echo ' make components Build only the user-mode components'
82 @echo ' make kbuild Build only the kernel-mode components'
83 @echo ' make docs Build the build's supporting documentation'
84 @echo ' make MODULE Build the module MODULE and all of its dependencies'
85 @echo ' make eurasiacon/binary2_.../target/libsomething.so'
86 @echo ' Build a particular file (including intermediates)'
87 @echo 'Variables'
88 @echo ' make V=1 ... Print the commands that are executed'
89 @echo ' make W=1 ... Enable extra compiler warnings'
90 @echo ' make D=opt ... Set build system debug option (D=help for a list)'
91 @echo ' make OUT=dir ... Place output+intermediates in specified directory'
92 @echo ' EXCLUDED_APIS=... List of APIs to remove from the build'
93 @echo ' make SOMEOPTION=1 ... Set configuration options (see config/core.mk)'
94 @echo ' Defaults are set by $(PVR_BUILD_DIR)/Makefile'
95 @echo 'Clean targets'
96 @echo ' make clean Remove only intermediates for the current build'
97 @echo ' make clobber As "make clean", but remove output files too'
98 @echo ' make clean-MODULE Clean (or clobber) only files for MODULE'
99 @echo ''
100 @echo 'Special targets'
101 @echo ' make whereis-MODULE Show the path to the Linux.mk defining MODULE'
102 @echo ' make whatis-FILE Show which module builds an output FILE'
103 @echo ' make ls-modules List all modules defined by makefiles'
104
105ifneq ($(filter help,$(D)),)
106empty :=
107space := $(empty) $(empty)
108$(info Debug options)
109$(info $(space)D=modules dump module info)
110$(info $(space)D=config dump all config options + type and origin)
111$(info $(space)D=freeze-config prevent config changes)
112$(info $(space)D=config-changes dump diffs when config changes)
113$(info $(space)D=nobuild stop before running the main build)
114$(info Options can be combined: make D=freeze-config,config-changes)
115$(error D=help given)
116endif
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/buildvars.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/buildvars.mk
new file mode 100644
index 0000000..4d4afa6
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/buildvars.mk
@@ -0,0 +1,267 @@
1########################################################################### ###
2#@Title Define global variables
3#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4#@Description This file is read once at the start of the build, after reading
5# in config.mk. It should define the non-MODULE_* variables used
6# in commands, like ALL_CFLAGS
7#@License Dual MIT/GPLv2
8#
9# The contents of this file are subject to the MIT license as set out below.
10#
11# Permission is hereby granted, free of charge, to any person obtaining a copy
12# of this software and associated documentation files (the "Software"), to deal
13# in the Software without restriction, including without limitation the rights
14# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15# copies of the Software, and to permit persons to whom the Software is
16# furnished to do so, subject to the following conditions:
17#
18# The above copyright notice and this permission notice shall be included in
19# all copies or substantial portions of the Software.
20#
21# Alternatively, the contents of this file may be used under the terms of
22# the GNU General Public License Version 2 ("GPL") in which case the provisions
23# of GPL are applicable instead of those above.
24#
25# If you wish to allow use of your version of this file only under the terms of
26# GPL, and not to allow others to use your version of this file under the terms
27# of the MIT license, indicate your decision by deleting the provisions above
28# and replace them with the notice and other provisions required by GPL as set
29# out in the file called "GPL-COPYING" included in this distribution. If you do
30# not delete the provisions above, a recipient may use your version of this file
31# under the terms of either the MIT license or GPL.
32#
33# This License is also included in this distribution in the file called
34# "MIT-COPYING".
35#
36# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
37# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
38# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
39# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
40# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
41# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
42# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43### ###########################################################################
44
45# NOTE: You must *not* use the cc-option et al macros in COMMON_FLAGS,
46# COMMON_CFLAGS or COMMON_USER_FLAGS. These flags are shared between
47# host and target, which might use compilers with different capabilities.
48
49# ANOTHER NOTE: All flags here must be architecture-independent (i.e. no
50# -march or toolchain include paths)
51
52# These flags are used for kernel, User C and User C++
53#
54COMMON_FLAGS := -W -Wall
55
56# Some GCC warnings are C only, so we must mask them from C++
57#
58COMMON_CFLAGS := $(COMMON_FLAGS) \
59 -Wdeclaration-after-statement -Wno-format-zero-length \
60 -Wmissing-prototypes -Wstrict-prototypes
61
62# User C and User C++ optimization control. Does not affect kernel.
63#
64ifeq ($(BUILD),debug)
65COMMON_USER_FLAGS := -O0
66else
67OPTIM ?= -O2
68ifeq ($(USE_LTO),1)
69COMMON_USER_FLAGS := $(OPTIM) -flto
70else
71COMMON_USER_FLAGS := $(OPTIM)
72endif
73endif
74
75# FIXME: We should probably audit the driver for aliasing
76#
77COMMON_USER_FLAGS += -fno-strict-aliasing
78
79# We always enable debugging. Either the release binaries are stripped
80# and the symbols put in the symbolpackage, or we're building debug.
81#
82COMMON_USER_FLAGS += -g
83
84# User C and User C++ warning flags
85#
86COMMON_USER_FLAGS += \
87 -Wpointer-arith -Wunused-parameter \
88 -Wmissing-format-attribute
89
90# Additional warnings, and optional warnings.
91#
92TESTED_TARGET_USER_FLAGS := \
93 $(call cc-option,-Wno-missing-field-initializers) \
94 $(call cc-option,-fdiagnostics-show-option) \
95 $(call cc-option,-Wno-self-assign) \
96 $(call cc-option,-Wno-parentheses-equality)
97TESTED_HOST_USER_FLAGS := \
98 $(call host-cc-option,-Wno-missing-field-initializers) \
99 $(call host-cc-option,-fdiagnostics-show-option) \
100 $(call host-cc-option,-Wno-self-assign) \
101 $(call host-cc-option,-Wno-parentheses-equality)
102
103# These flags are clang-specific.
104# -Wno-unused-command-line-argument works around a buggy interaction
105# with ccache, see https://bugzilla.samba.org/show_bug.cgi?id=8118
106# -fcolor-diagnostics force-enables colored error messages which
107# get disabled when ccache is piped through ccache.
108#
109TESTED_TARGET_USER_FLAGS += \
110 $(call cc-option,-Qunused-arguments) \
111 $(call cc-option,-fcolor-diagnostics)
112TESTED_HOST_USER_FLAGS += \
113 $(call host-cc-option,-Qunused-arguments) \
114 $(call host-cc-option,-fcolor-diagnostics)
115
116ifeq ($(W),1)
117TESTED_TARGET_USER_FLAGS += \
118 $(call cc-option,-Wbad-function-cast) \
119 $(call cc-option,-Wcast-qual) \
120 $(call cc-option,-Wcast-align) \
121 $(call cc-option,-Wconversion) \
122 $(call cc-option,-Wdisabled-optimization) \
123 $(call cc-option,-Wlogical-op) \
124 $(call cc-option,-Wmissing-declarations) \
125 $(call cc-option,-Wmissing-include-dirs) \
126 $(call cc-option,-Wnested-externs) \
127 $(call cc-option,-Wold-style-definition) \
128 $(call cc-option,-Woverlength-strings) \
129 $(call cc-option,-Wpacked) \
130 $(call cc-option,-Wpacked-bitfield-compat) \
131 $(call cc-option,-Wpadded) \
132 $(call cc-option,-Wredundant-decls) \
133 $(call cc-option,-Wshadow) \
134 $(call cc-option,-Wswitch-default) \
135 $(call cc-option,-Wvla) \
136 $(call cc-option,-Wwrite-strings)
137TESTED_HOST_USER_FLAGS += \
138 $(call host-cc-option,-Wbad-function-cast) \
139 $(call host-cc-option,-Wcast-qual) \
140 $(call host-cc-option,-Wcast-align) \
141 $(call host-cc-option,-Wconversion) \
142 $(call host-cc-option,-Wdisabled-optimization) \
143 $(call host-cc-option,-Wlogical-op) \
144 $(call host-cc-option,-Wmissing-declarations) \
145 $(call host-cc-option,-Wmissing-include-dirs) \
146 $(call host-cc-option,-Wnested-externs) \
147 $(call host-cc-option,-Wold-style-definition) \
148 $(call host-cc-option,-Woverlength-strings) \
149 $(call host-cc-option,-Wpacked) \
150 $(call host-cc-option,-Wpacked-bitfield-compat) \
151 $(call host-cc-option,-Wpadded) \
152 $(call host-cc-option,-Wredundant-decls) \
153 $(call host-cc-option,-Wshadow) \
154 $(call host-cc-option,-Wswitch-default) \
155 $(call host-cc-option,-Wvla) \
156 $(call host-cc-option,-Wwrite-strings)
157endif
158
159TESTED_TARGET_USER_FLAGS += \
160 $(call cc-optional-warning,-Wunused-but-set-variable)
161TESTED_HOST_USER_FLAGS += \
162 $(call host-cc-optional-warning,-Wunused-but-set-variable)
163
164KBUILD_FLAGS := \
165 -Wno-unused-parameter -Wno-sign-compare
166
167# androideabi toolchain adds `pic` by default, disable it
168# for kernel module build
169KBUILD_FLAGS += -fno-pic
170KBUILD_FLAGS += -fstack-protector-strong
171
172TESTED_KBUILD_FLAGS := \
173 $(call kernel-cc-option,-Wmissing-include-dirs) \
174 $(call kernel-cc-option,-Wno-type-limits) \
175 $(call kernel-cc-option,-Wno-pointer-arith) \
176 $(call kernel-cc-option,-Wno-aggregate-return) \
177 $(call kernel-cc-option,-Wno-unused-but-set-variable) \
178 $(call kernel-cc-option,-Wno-ignored-qualifiers) \
179 $(call kernel-cc-option,-Wno-old-style-declaration) \
180 $(call kernel-cc-optional-warning,-Wbad-function-cast) \
181 $(call kernel-cc-optional-warning,-Wcast-qual) \
182 $(call kernel-cc-optional-warning,-Wcast-align) \
183 $(call kernel-cc-optional-warning,-Wconversion) \
184 $(call kernel-cc-optional-warning,-Wdisabled-optimization) \
185 $(call kernel-cc-optional-warning,-Wlogical-op) \
186 $(call kernel-cc-optional-warning,-Wmissing-declarations) \
187 $(call kernel-cc-optional-warning,-Wmissing-include-dirs) \
188 $(call kernel-cc-optional-warning,-Wnested-externs) \
189 $(call kernel-cc-optional-warning,-Wno-missing-field-initializers) \
190 $(call kernel-cc-optional-warning,-Wold-style-definition) \
191 $(call kernel-cc-optional-warning,-Woverlength-strings) \
192 $(call kernel-cc-optional-warning,-Wpacked) \
193 $(call kernel-cc-optional-warning,-Wpacked-bitfield-compat) \
194 $(call kernel-cc-optional-warning,-Wpadded) \
195 $(call kernel-cc-optional-warning,-Wredundant-decls) \
196 $(call kernel-cc-optional-warning,-Wshadow) \
197 $(call kernel-cc-optional-warning,-Wswitch-default) \
198 $(call kernel-cc-optional-warning,-Wvla) \
199 $(call kernel-cc-optional-warning,-Wwrite-strings)
200
201# User C only
202#
203ALL_CFLAGS := \
204 $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_TARGET_USER_FLAGS) \
205 $(SYS_CFLAGS)
206ALL_HOST_CFLAGS := \
207 $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_HOST_USER_FLAGS)
208
209# User C++ only
210#
211ALL_CXXFLAGS := \
212 -fno-rtti -fno-exceptions \
213 $(COMMON_USER_FLAGS) $(COMMON_FLAGS) $(TESTED_TARGET_USER_FLAGS) \
214 $(SYS_CXXFLAGS)
215ALL_HOST_CXXFLAGS := \
216 -fno-rtti -fno-exceptions \
217 $(COMMON_USER_FLAGS) $(COMMON_FLAGS) $(TESTED_HOST_USER_FLAGS)
218
219# Workaround for some target clangs that don't support -O0 w/ PIC.
220#
221ifeq ($(cc-is-clang),true)
222ALL_CFLAGS := $(patsubst -O0,-O1,$(ALL_CFLAGS))
223ALL_CXXFLAGS := $(patsubst -O0,-O1,$(ALL_CXXFLAGS))
224endif
225
226# Kernel C only
227#
228ALL_KBUILD_CFLAGS := $(COMMON_CFLAGS) $(KBUILD_FLAGS) $(TESTED_KBUILD_FLAGS)
229
230# User C and C++
231#
232# NOTE: ALL_HOST_LDFLAGS should probably be using -rpath-link too, and if we
233# ever need to support building host shared libraries, it's required.
234#
235# We can't use it right now because we want to support non-GNU-compatible
236# linkers like the Darwin 'ld' which doesn't support -rpath-link.
237#
238# For the same reason (Darwin 'ld') don't bother checking for text
239# relocations in host binaries.
240#
241ALL_HOST_LDFLAGS :=
242ALL_LDFLAGS := -Wl,--warn-shared-textrel
243
244ALL_LDFLAGS += $(SYS_LDFLAGS)
245
246# Optional security hardening features.
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
252
253# This variable contains a list of all modules built by kbuild
254ALL_KBUILD_MODULES :=
255
256# This variable contains a list of all modules which contain C++ source files
257ALL_CXX_MODULES :=
258
259# Toolchain triple for cross environment
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/sgx_km/eurasia_km/eurasiacon/build/linux2/commands.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/commands.mk
new file mode 100644
index 0000000..d4876c9
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/commands.mk
@@ -0,0 +1,312 @@
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
41# from-one-* recipes make a thing from one source file, so they use $<. Others
42# use $(MODULE_something) instead of $^
43
44# We expect that MODULE_*FLAGS contains all the flags we need, including the
45# flags for all modules (like $(ALL_CFLAGS) and $(ALL_HOST_CFLAGS)), and
46# excluding flags for include search dirs or for linking libraries. The
47# exceptions are ALL_EXE_LDFLAGS and ALL_LIB_LDFLAGS, since they depend on the
48# type of thing being linked, so they appear in the commands below
49
50define host-o-from-one-c
51$(if $(V),,@echo " HOST_CC " $(call relative-to-top,$<))
52$(MODULE_CC) -MD -c $(MODULE_HOST_CFLAGS) $(MODULE_INCLUDE_FLAGS) \
53 -include $(CONFIG_H) $< -o $@
54endef
55
56define target-o-from-one-c
57$(if $(V),,@echo " CC " $(call relative-to-top,$<))
58$(MODULE_CC) -MD -c $(MODULE_CFLAGS) $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) \
59 -include $(CONFIG_H) $< -o $@
60endef
61
62define host-o-from-one-cxx
63$(if $(V),,@echo " HOST_CXX" $(call relative-to-top,$<))
64$(MODULE_CXX) -MD -c $(MODULE_HOST_CXXFLAGS) $(MODULE_INCLUDE_FLAGS) \
65 -include $(CONFIG_H) $< -o $@
66endef
67
68define target-o-from-one-cxx
69$(if $(V),,@echo " CXX " $(call relative-to-top,$<))
70$(MODULE_CXX) -MD -c $(MODULE_CXXFLAGS) $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) \
71 -include $(CONFIG_H) $< -o $@
72endef
73
74define host-executable-from-o
75$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
76$(MODULE_CC) $(MODULE_HOST_LDFLAGS) \
77 -o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \
78 $(MODULE_LIBRARY_FLAGS)
79endef
80
81define host-executable-cxx-from-o
82$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
83$(MODULE_CXX) $(MODULE_HOST_LDFLAGS) \
84 -o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \
85 $(MODULE_LIBRARY_FLAGS)
86endef
87
88define target-executable-from-o
89$(if $(V),,@echo " LD " $(call relative-to-top,$@))
90$(MODULE_CC) \
91 $(MODULE_EXE_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
92 $(MODULE_EXE_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_EXE_CRTEND) \
93 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
94endef
95
96define target-executable-cxx-from-o
97$(if $(V),,@echo " LD " $(call relative-to-top,$@))
98$(MODULE_CXX) \
99 $(MODULE_EXE_LDFLAGS_CXX) $(MODULE_LDFLAGS) -o $@ \
100 $(MODULE_EXE_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_EXE_CRTEND) \
101 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
102endef
103
104define target-shared-library-from-o
105$(if $(V),,@echo " LD " $(call relative-to-top,$@))
106$(MODULE_CC) -shared -Wl,-Bsymbolic \
107 $(MODULE_LIB_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
108 $(MODULE_LIB_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIB_CRTEND) \
109 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
110endef
111
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
114define target-shared-library-cxx-from-o
115$(if $(V),,@echo " LD " $(call relative-to-top,$@))
116$(MODULE_CXX) -shared -Wl,-Bsymbolic \
117 $(MODULE_LIB_LDFLAGS_CXX) $(MODULE_LDFLAGS) -o $@ \
118 $(MODULE_LIB_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIB_CRTEND) \
119 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
120endef
121
122define host-shared-library-from-o
123$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
124$(MODULE_CC) -shared -Wl,-Bsymbolic \
125 $(MODULE_HOST_LDFLAGS) -o $@ \
126 $(sort $(MODULE_ALL_OBJECTS)) \
127 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS)
128endef
129
130# If there were any C++ source files in a shared library, we use this recipe,
131# which runs the C++ compiler to link the final library
132define host-shared-library-cxx-from-o
133$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
134$(MODULE_CXX) -shared -Wl,-Bsymbolic \
135 $(MODULE_HOST_LDFLAGS) -o $@ \
136 $(sort $(MODULE_ALL_OBJECTS)) \
137 $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS)
138endef
139
140define target-copy-debug-information
141$(OBJCOPY) --only-keep-debug $@ $(basename $@).dbg
142endef
143
144define host-strip-debug-information
145$(HOST_STRIP) --strip-unneeded $@
146endef
147
148define target-strip-debug-information
149$(STRIP) --strip-unneeded $@
150endef
151
152define target-add-debuglink
153$(if $(V),,@echo " DBGLINK " $(call relative-to-top,$(basename $@).dbg))
154$(OBJCOPY) --add-gnu-debuglink=$(basename $@).dbg $@
155endef
156
157define host-static-library-from-o
158$(if $(V),,@echo " HOST_AR " $(call relative-to-top,$@))
159$(HOST_AR) cru $@ $(sort $(MODULE_ALL_OBJECTS))
160endef
161
162define target-static-library-from-o
163$(if $(V),,@echo " AR " $(call relative-to-top,$@))
164$(AR) cru $@ $(sort $(MODULE_ALL_OBJECTS))
165endef
166
167define tab-c-from-y
168$(if $(V),,@echo " BISON " $(call relative-to-top,$<))
169$(BISON) $(MODULE_BISON_FLAGS) -o $@ -d $<
170endef
171
172define l-c-from-l
173$(if $(V),,@echo " FLEX " $(call relative-to-top,$<))
174$(FLEX) $(MODULE_FLEX_FLAGS) -o$@ $<
175endef
176
177define clean-dirs
178$(if $(V),,@echo " RM " $(call relative-to-top,$(MODULE_DIRS_TO_REMOVE)))
179$(RM) -rf $(MODULE_DIRS_TO_REMOVE)
180endef
181
182define make-directory
183$(MKDIR) -p $@
184endef
185
186define check-exports-from-file
187endef
188
189define check-exports
190$(call check-exports-from-file,$(if $1,$1,$(notdir $@).txt))
191endef
192
193# Programs used in recipes
194
195BISON ?= bison
196CC ?= gcc
197CC_SECONDARY ?= $(CC)
198CROSS_COMPILE_SECONDARY ?= $(CROSS_COMPILE)
199CXX ?= g++
200CXX_SECONDARY ?= $(CXX)
201HOST_CC ?= gcc
202HOST_CXX ?= g++
203JAR ?= jar
204JAVA ?= java
205JAVAC ?= javac
206ZIP ?= zip
207PKG_CONFIG ?= pkg-config
208
209ifeq ($(USE_CCACHE),1)
210CCACHE ?= ccache
211endif
212
213# Define CHMOD and CC_CHECK first so we can use cc-is-clang
214#
215override CHMOD := $(if $(V),,@)chmod
216override CC_CHECK := $(if $(V),,@)$(MAKE_TOP)/tools/cc-check.sh
217
218# If clang is detected, the compiler name is invariant but CROSS_COMPILE
219# is reflected in the use of -target. For GCC this is always encoded into
220# the binary. If CROSS_COMPILE is not set we can skip this.
221#
222# If we're doing a build with multiple target architectures, we might need
223# two separate compilers to build binaries for each architecture. In this
224# case, CROSS_COMPILE and CROSS_COMPILE_SECONDARY are the cross compiler
225# prefix for the two compilers - $(CC) and $(CC_SECONDARY).
226#
227# Set the secondary compiler first before we overwrite $(CC).
228#
229
230ifneq ($(CROSS_COMPILE_SECONDARY),)
231 ifeq ($(cc-is-clang),true)
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
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
272else
273 $(if $(CROSS_COMPILE_SECONDARY),$(error CROSS_COMPILE_SECONDARY is set but CROSS_COMPILE is empty))
274endif
275
276# Apply compiler wrappers and V=1 handling
277override CC := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CC)
278override CXX := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CXX)
279
280override AR := $(if $(V),,@)$(CROSS_COMPILE)ar
281override BISON := $(if $(V),,@)$(BISON)
282override BZIP2 := $(if $(V),,@)bzip2 -9
283override CAT := $(if $(V),,@)cat
284override CP := $(if $(V),,@)cp
285override ECHO := $(if $(V),,@)echo
286override FLEX := $(if $(V),,@)flex
287override GAWK := $(if $(V),,@)gawk
288override GREP := $(if $(V),,@)grep
289override HOST_AR := $(if $(V),,@)ar
290override HOST_CC := $(if $(V),,@)$(CCACHE) $(HOST_CC)
291override HOST_CXX := $(if $(V),,@)$(CCACHE) $(HOST_CXX)
292override HOST_STRIP := $(if $(V),,@)strip
293override INSTALL := $(if $(V),,@)install
294override JAR := $(if $(V),,@)$(JAR)
295override JAVA := $(if $(V),,@)$(JAVA)
296override JAVAC := $(if $(V),,@)$(JAVAC)
297override LN := $(if $(V),,@)ln -f
298override M4 := $(if $(V),,@)m4
299override MKDIR := $(if $(V),,@)mkdir
300override MV := $(if $(V),,@)mv
301override OBJCOPY := $(if $(V),,@)$(CROSS_COMPILE)objcopy
302override PDSASM := $(if $(V),,@)$(HOST_OUT)/pdsasm
303override RANLIB := $(if $(V),,@)$(CROSS_COMPILE)ranlib
304override RM := $(if $(V),,@)rm -f
305override SED := $(if $(V),,@)sed
306override STRIP := $(if $(V),,@)$(CROSS_COMPILE)strip
307override TAR := $(if $(V),,@)tar
308override TOUCH := $(if $(V),,@)touch
309override USEASM := $(if $(V),,@)$(HOST_OUT)/useasm
310override USELINK := $(if $(V),,@)$(HOST_OUT)/uselink
311override VHD2INC := $(if $(V),,@)$(HOST_OUT)/vhd2inc
312override ZIP := $(if $(V),,@)$(ZIP)
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/arch.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/arch.mk
new file mode 100644
index 0000000..7b41576
--- /dev/null
+++ b/sgx_km/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/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk
new file mode 100644
index 0000000..2cd272e
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk
@@ -0,0 +1,158 @@
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
41SYS_CFLAGS := \
42 -fno-short-enums \
43 -funwind-tables \
44 -D__linux__
45
46SYS_INCLUDES :=
47
48ifneq ($(TARGET_PLATFORM),)
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
134
135# This is comparing PVR_BUILD_DIR to see if it is omap and adding
136# includes required for it's HWC.
137ifeq ($(notdir $(abspath .)),omap_android)
138SYS_INCLUDES += \
139 -isystem $(ANDROID_ROOT)/hardware/ti/omap4xxx/kernel-headers \
140 -isystem $(ANDROID_ROOT)/hardware/ti/omap4xxx/ion
141endif
142
143# Always include the NDK compatibility directory, because it allows us to
144# compile in inline versions of simple functions to eliminate dependencies,
145# and we can also constrain the available APIs. Do this last, so we can
146# make sure it is always first on the include list.
147
148SYS_INCLUDES := -isystem eurasiacon/android/ndk $(SYS_INCLUDES)
149
150# Android enables build-id sections to allow mapping binaries to debug
151# information for symbol resolution
152SYS_LDFLAGS += -Wl,--build-id=md5
153
154SYS_EXE_LDFLAGS_CXX := -lstdc++
155
156SYS_LIB_LDFLAGS_CXX := $(SYS_EXE_LDFLAGS_CXX)
157
158OPTIM := -O2
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk
new file mode 100644
index 0000000..5cb8d84
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk
@@ -0,0 +1,115 @@
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
41
42
43$(eval $(call BothConfigC,ANDROID,))
44
45
46
47$(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_ANDROID_SYSTRACE,))
48
49$(eval $(call TunableBothConfigMake,SUPPORT_ANDROID_PLATFORM,))
50$(eval $(call TunableBothConfigMake,SUPPORT_PVRSRV_ANDROID_SYSTRACE,))
51
52$(eval $(call TunableBothConfigMake,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,))
53$(eval $(call TunableBothConfigC,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,))
54
55$(eval $(call TunableBothConfigMake,PVR_ANDROID_NATIVE_WINDOW_HAS_FENCE,))
56$(eval $(call TunableBothConfigC,PVR_ANDROID_NATIVE_WINDOW_HAS_FENCE,))
57
58ifeq ($(NO_HARDWARE),1)
59 override PVR_ANDROID_COMPOSERHAL := null
60endif
61
62ifneq ($(PVR_ANDROID_COMPOSERHAL),drm)
63 ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),1)
64 override PVR_ANDROID_COMPOSERHAL := null
65 endif
66endif
67
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
115include ../common/ion.mk
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/features.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
new file mode 100644
index 0000000..bc92a6f
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
@@ -0,0 +1,254 @@
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
41# Basic support option tuning for Android
42#
43SUPPORT_ANDROID_PLATFORM := 1
44SUPPORT_OPENGLES1_V1_ONLY := 1
45DONT_USE_SONAMES := 1
46
47# Meminfo IDs are required for buffer stamps
48#
49SUPPORT_MEMINFO_IDS := 1
50
51# Enable services ion support by default
52#
53SUPPORT_ION ?= 0
54SUPPORT_DMABUF := 1
55
56# Need multi-process support in PDUMP
57#
58SUPPORT_PDUMP_MULTI_PROCESS := 1
59
60# Always print debugging after 5 seconds of no activity
61#
62CLIENT_DRIVER_DEFAULT_WAIT_RETRIES := 50
63
64# Android WSEGL is always the same
65#
66OPK_DEFAULT := libpvrANDROID_WSEGL.so
67
68# srvkm is always built, but bufferclass_example is only built
69# before EGL_image_external was generally available.
70#
71KERNEL_COMPONENTS := srvkm
72
73# Use the new PVR_DPF implementation to allow lower message levels
74# to be stripped from production drivers
75#
76PVRSRV_NEW_PVR_DPF := 1
77
78# Production Android builds don't want PVRSRVGetDCSystemBuffer
79#
80SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER := 0
81
82# Prefer to limit the 3D parameters heap to <16MB and move the
83# extra 48MB to the general heap. This only affects cores with
84# 28bit MMUs (520, 530, 531, 540).
85#
86SUPPORT_LARGE_GENERAL_HEAP := 1
87
88# Enable a page pool for uncached memory allocations. This improves
89# the performance of such allocations because the pages are temporarily
90# not returned to Linux and therefore do not have to be re-invalidated
91# (fewer cache invalidates are needed).
92#
93# Default the cache size to a maximum of 5400 pages (~21MB). If using
94# newer Linux kernels (>=3.0) the cache may be reclaimed and become
95# smaller than this maximum during runtime.
96#
97PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 5400
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
106# matches that of the SDK API_LEVEL.
107#
108RSC_API_LEVEL ?= $(API_LEVEL)
109ifneq ($(findstring $(RSC_API_LEVEL),21 22),)
110RSC_API_LEVEL := 20
111endif
112
113##############################################################################
114# Framebuffer target extension is used to find configs compatible with
115# the framebuffer (added in JB MR1).
116#
117EGL_EXTENSION_ANDROID_FRAMEBUFFER_TARGET := 1
118
119##############################################################################
120# Handle various platform includes for unittests
121#
122UNITTEST_INCLUDES := \
123 eurasiacon/android \
124 $(ANDROID_ROOT)/frameworks/base/native/include \
125 $(ANDROID_ROOT)/frameworks/native/include \
126 $(ANDROID_ROOT)/frameworks/native/opengl/include \
127 $(ANDROID_ROOT)/libnativehelper/include/nativehelper
128
129UNITTEST_INCLUDES += eurasiacon/unittests/include
130
131##############################################################################
132# Future versions moved proprietary libraries to a vendor directory
133#
134ifeq ($(wildcard $(TARGET_ROOT)/product/$(TARGET_DEVICE)/vendor),)
135PVRSRV_MODULE_BASEDIR := /system/lib/modules/
136BIN_DESTDIR := /system/vendor/bin
137APP_DESTDIR := /data/app
138else
139PVR_ANDROID_FORCE_APP_NATIVE_UNPACKED := 1
140PVRSRV_MODULE_BASEDIR := /vendor/lib/modules/
141BIN_DESTDIR := /vendor/bin
142APP_DESTDIR := /vendor/app
143endif
144
145##############################################################################
146# Android doesn't use these install script variables. They're still in place
147# because the Linux install scripts use them.
148#
149SHLIB_DESTDIR := not-used
150EGL_DESTDIR := not-used
151
152# Must give our EGL/GLES libraries a globally unique name
153#
154EGL_BASENAME_SUFFIX := _POWERVR_SGX$(SGXCORE)_$(SGX_CORE_REV)
155
156SYS_CXXFLAGS := -fuse-cxa-atexit $(SYS_CFLAGS)
157SYS_INCLUDES += -isystem $(LIBCXX_INCLUDE_PATH)
158
159##############################################################################
160# Support the OES_EGL_image_external extensions in the client drivers.
161#
162GLES1_EXTENSION_EGL_IMAGE_EXTERNAL := 1
163GLES2_EXTENSION_EGL_IMAGE_EXTERNAL := 1
164
165##############################################################################
166# ICS requires that at least one driver EGLConfig advertises the
167# EGL_RECORDABLE_ANDROID attribute. The platform requires that surfaces
168# rendered with this config can be consumed by an OMX video encoder.
169#
170EGL_EXTENSION_ANDROID_RECORDABLE := 1
171
172##############################################################################
173# ICS added the EGL_ANDROID_blob_cache extension. Enable support for this
174# extension in EGL/GLESv2.
175#
176EGL_EXTENSION_ANDROID_BLOB_CACHE := 1
177
178##############################################################################
179# JB MR1 introduces cross-process syncs associated with a fd.
180# This requires a new enough kernel version to have the base/sync driver.
181#
182EGL_EXTENSION_ANDROID_NATIVE_FENCE_SYNC ?= 1
183
184##############################################################################
185# Kernel 4.9 introduces new sync framework for cross-process sync
186#
187ifneq ($(strip $(KERNELDIR)),)
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
194endif
195
196##############################################################################
197# Versions of Android prior to Nougat required Java 7 (OpenJDK).
198#
199ifeq ($(is_at_least_nougat),0)
200LEGACY_USE_JAVA7 ?= 1
201endif
202
203##############################################################################
204# Lollipop supports 64-bit. Configure BCC to emit both 32-bit and 64-bit LLVM
205# bitcode in the renderscript driver.
206#
207ifeq ($(is_at_least_lollipop),1)
208PVR_ANDROID_BCC_MULTIARCH_SUPPORT := 1
209endif
210
211##############################################################################
212# Versions of Android prior to Nougat required .apk files to be processed with
213# zipalign. Using this tool on Nougat or greater will corrupt the .apk file,
214# as alignment is already done by signapk.jar, so we must disable it.
215#
216ifeq ($(is_at_least_nougat),0)
217LEGACY_USE_ZIPALIGN ?= 1
218endif
219
220##############################################################################
221# Marshmallow needs --soname turned on
222#
223ifeq ($(is_at_least_marshmallow),1)
224PVR_ANDROID_NEEDS_SONAME ?= 1
225endif
226
227##############################################################################
228# Marshmallow replaces RAW_SENSOR with RAW10, RAW12 and RAW16
229#
230ifeq ($(is_at_least_marshmallow),1)
231PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_RAWxx := 1
232endif
233
234##############################################################################
235# Marshmallow onwards DDK stopped render script acceleration using GPU.
236# This flag stops device allocation.
237#
238ifeq ($(is_at_least_marshmallow),1)
239PVR_ANDROID_HAS_GRALLOC_USAGE_RENDERSCRIPT := 1
240endif
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
250# Placeholder for future version handling
251#
252ifeq ($(is_future_version),1)
253-include ../common/android/future_version.mk
254endif
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/install.sh.tpl b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/install.sh.tpl
new file mode 100644
index 0000000..bc9fa24
--- /dev/null
+++ b/sgx_km/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/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk
new file mode 100644
index 0000000..fa91e86
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk
@@ -0,0 +1,60 @@
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
41TARGET_BUILD_TYPE ?= release
42
43HOST_OS ?= linux
44HOST_ARCH ?= x86
45
46ifeq ($(wildcard $(OUT_DIR)),)
47OUT_DIR = $(ANDROID_ROOT)/out
48endif
49
50ifeq ($(TARGET_BUILD_TYPE),debug)
51TARGET_ROOT := $(OUT_DIR)/debug/target
52else
53TARGET_ROOT := $(OUT_DIR)/target
54endif
55
56ifeq ($(NDK_ROOT),)
57LIBCXX_INCLUDE_PATH := $(ANDROID_ROOT)/external/libcxx/include
58else
59LIBCXX_INCLUDE_PATH := $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/include
60endif
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk
new file mode 100644
index 0000000..0a91f6b
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk
@@ -0,0 +1,192 @@
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
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.
43#
44BUILD_PROP := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/vendor/build.prop
45ifeq ($(wildcard $(BUILD_PROP)),)
46$(warning *** Could not determine Android version. Did you set ANDROID_ROOT,\
47OUT_DIR and TARGET_DEVICE in your environment correctly?)
48$(error Error reading $(BUILD_PROP))
49endif
50
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
53# be defined, and fallback handling will take place.
54#
55define newline
56
57
58endef
59$(eval $(subst #,$(newline),$(shell cat $(BUILD_PROP) | \
60 grep '^ro.build.version.release=\|^ro.build.id=' | \
61 sed -e 's,ro.build.version.release=,PLATFORM_RELEASE=,' \
62 -e 's,ro.build.id=,PLATFORM_BUILDID=,' | tr '\n' '#')))
63
64define release-starts-with
65$(shell echo $(PLATFORM_RELEASE) | grep -q ^$(1); \
66 [ "$$?" = "0" ] && echo 1 || echo 0)
67endef
68
69# ro.build.version.release contains the version number for release builds, or
70# the version codename otherwise. In this case we need to assume that the
71# version of Android we're building against has the features that are in the
72# final release of that version, so we set PLATFORM_RELEASE to the
73# corresponding release number.
74#
75# NOTE: It's the _string_ ordering that matters here, not the version number
76# ordering. You need to make sure that strings that are sub-strings of other
77# checked strings appear _later_ in this list.
78#
79# e.g. 'LollipopMR1' starts with 'Lollipop', but it is not Lollipop.
80#
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.
83#
84ifeq ($(call release-starts-with,LollipopMR1),1)
85override PLATFORM_RELEASE := 5.1
86else ifeq ($(call release-starts-with,Marshmallow),1)
87override PLATFORM_RELEASE := 6.0
88else ifeq ($(call release-starts-with,NougatMR),1)
89override PLATFORM_RELEASE := 7.1
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
96else ifeq ($(shell echo $(PLATFORM_RELEASE) | grep -qE "[A-Za-z]+"; echo $$?),0)
97override PLATFORM_RELEASE := 8.2
98endif
99
100# Workaround for master. Sometimes there is an AOSP version ahead of
101# the current master version number, but master still has more features.
102#
103ifeq ($(PLATFORM_RELEASE),8.0.80)
104override PLATFORM_RELEASE := 8.0
105is_aosp_master := 1
106endif
107
108PLATFORM_RELEASE_MAJ := $(shell echo $(PLATFORM_RELEASE) | cut -f1 -d'.')
109PLATFORM_RELEASE_MIN := $(shell echo $(PLATFORM_RELEASE) | cut -f2 -d'.')
110PLATFORM_RELEASE_PATCH := $(shell echo $(PLATFORM_RELEASE) | cut -f3 -d'.')
111
112# Not all versions have a patchlevel; fix that up here
113#
114ifeq ($(PLATFORM_RELEASE_PATCH),)
115PLATFORM_RELEASE_PATCH := 0
116endif
117
118# Macros to help categorize support for features and API_LEVEL for tests.
119#
120is_at_least_lollipop_mr1 := \
121 $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 5 || \
122 ( test $(PLATFORM_RELEASE_MAJ) -eq 5 && \
123 test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0)
124is_at_least_marshmallow := \
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)
134
135# Assume "future versions" are >7.1, but we don't really know
136is_future_version := \
137 $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 8 || \
138 ( test $(PLATFORM_RELEASE_MAJ) -eq 8 && \
139 test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0)
140
141# Picking an exact match of API_LEVEL for the platform we're building
142# against can avoid compatibility theming and affords better integration.
143#
144# This is also a good place to select the right jack toolchain.
145#
146ifeq ($(is_future_version),1)
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
162else ifeq ($(is_at_least_marshmallow),1)
163JACK_VERSION ?= 2.21.RELEASE
164API_LEVEL := 23
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
168API_LEVEL := 22
169else
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
183endif
184
185# Each DDK is tested against only a single version of the platform.
186# Warn if a different platform version is used.
187#
188ifeq ($(is_future_version),1)
189$(info WARNING: Android version is newer than this DDK supports)
190else ifneq ($(is_at_least_marshmallow),1)
191$(info WARNING: Android version is older than this DDK supports)
192endif
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk
new file mode 100644
index 0000000..dfe3018
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk
@@ -0,0 +1,63 @@
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
41$(eval $(call TunableBothConfigC,SUPPORT_DRI_DRM,))
42$(eval $(call TunableBothConfigC,SUPPORT_DRI_DRM_EXT,))
43$(eval $(call TunableKernelConfigC,SUPPORT_DRI_DRM_PLUGIN,))
44
45
46$(eval $(call TunableBothConfigMake,SUPPORT_DRI_DRM,))
47
48ifeq ($(SUPPORT_DRI_DRM),1)
49ifeq ($(SUPPORT_DRI_DRM_NO_LIBDRM),1)
50endif
51$(eval $(call TunableKernelConfigC,PVR_SECURE_DRM_AUTH_EXPORT,))
52$(eval $(call TunableKernelConfigC,SUPPORT_DRM_MODESET,))
53endif
54
55$(eval $(call TunableKernelConfigC,PVR_DISPLAY_CONTROLLER_DRM_IOCTL,))
56
57$(eval $(call TunableBothConfigC,PVR_DRI_DRM_NOT_PCI))
58$(eval $(call TunableBothConfigMake,PVR_DRI_DRM_NOT_PCI))
59
60$(eval $(call TunableKernelConfigC,PVR_DRI_DRM_PLATFORM_DEV,))
61
62
63
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/common/ion.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/ion.mk
new file mode 100644
index 0000000..f3f3c46
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/ion.mk
@@ -0,0 +1,65 @@
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
41ifneq ($(KERNELDIR),)
42ifneq ($(SUPPORT_ION),)
43
44# Support kernels built out-of-tree with O=/other/path
45# In those cases, KERNELDIR will be O, not the source tree.
46ifneq ($(wildcard $(KERNELDIR)/source),)
47KSRCDIR := $(KERNELDIR)/source
48else
49KSRCDIR := $(KERNELDIR)
50endif
51
52ifneq ($(wildcard $(KSRCDIR)/drivers/staging/android/ion/ion.h),)
53# The kernel has a more recent version of ion, located in drivers/staging.
54# Change the default header paths and the behaviour wrt sg_dma_len.
55SUPPORT_ION_HEADER := \"../drivers/staging/android/ion/ion.h\"
56SUPPORT_ION_PRIV_HEADER := \"../drivers/staging/android/ion/ion_priv.h\"
57SUPPORT_ION_USE_SG_LENGTH := 1
58endif
59
60$(eval $(call TunableKernelConfigC,SUPPORT_ION_HEADER,\"linux/ion.h\"))
61$(eval $(call TunableKernelConfigC,SUPPORT_ION_PRIV_HEADER,\"../drivers/gpu/ion/ion_priv.h\"))
62$(eval $(call TunableKernelConfigC,SUPPORT_ION_USE_SG_LENGTH,))
63
64endif
65endif
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/common/omap4.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/omap4.mk
new file mode 100644
index 0000000..9a2cdd5
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/omap4.mk
@@ -0,0 +1,44 @@
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
41$(eval $(call TunableKernelConfigC,PVR_NO_OMAP_TIMER,))
42$(eval $(call TunableKernelConfigC,PVR_OMAPLFB_DONT_USE_FB_PAN_DISPLAY,))
43$(eval $(call TunableKernelConfigC,PVR_OMAPLFB_DRM_FB,))
44$(eval $(call TunableKernelConfigC,VS_PRODUCT_VERSION,))
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/common/opencl.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/opencl.mk
new file mode 100644
index 0000000..b5f84d4
--- /dev/null
+++ b/sgx_km/eurasia_km/eurasiacon/build/linux2/common/opencl.mk
@@ -0,0 +1,40 @@
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
diff --git a/sgx_km/eurasia_km/eurasiacon/build/linux2/config/compiler.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/config/compiler.mk
new file mode 100644
index 0000000..82c9d44
--- /dev/null
+++ b/sgx_km/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/sgx_km/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-eabi.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-eabi.mk
new file mode 100644
index 0000000..d671ba9
--- /dev/null
+++ b/sgx_km/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/sgx_km/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-linux-androideabi.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-linux-androideabi.mk
new file mode 100644
index 0000000..8aaeaad
--- /dev/null
+++ b/sgx_km/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/sgx_km/eurasia_km/eurasiacon/build/linux2/config/compilers/mips64el-linux-android.mk b/sgx_km/eurasia_km/eurasiacon/build/linux2/config/compilers/mips64el-linux-android.mk
new file mode 100644
index 0000000..8777b2a
--- /dev/null
+++ b/sgx_km/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))