diff options
author | Andrew F. Davis | 2018-06-26 16:24:59 -0500 |
---|---|---|
committer | Andrew F. Davis | 2018-06-26 16:24:59 -0500 |
commit | 493daaec1e59310ccbd342fdd918d069e495b769 (patch) | |
tree | fa4a4af738756b1d3e1741b335d690c100fac223 | |
parent | d44d1d35d1d7e1feb36c615beae57c3114f37d70 (diff) | |
download | vendor-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>
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 | |||
17 | LOCAL_PATH := $(call my-dir) | ||
18 | include $(CLEAR_VARS) | ||
19 | |||
20 | local-build := $(LOCAL_PATH)/eurasia_km/eurasiacon/build/linux2/omap_android | ||
21 | out-intermediates := $(call intermediates-dir-for, ETC, pvrsrvkm) | ||
22 | |||
23 | PVRSRVKM := $(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 | ||
14 | freedom to share and change it. By contrast, the GNU General Public | ||
15 | License is intended to guarantee your freedom to share and change free | ||
16 | software--to make sure the software is free for all its users. This | ||
17 | General Public License applies to most of the Free Software | ||
18 | Foundation's software and to any other program whose authors commit to | ||
19 | using it. (Some other Free Software Foundation software is covered by | ||
20 | the GNU Library General Public License instead.) You can apply it to | ||
21 | your programs, too. | ||
22 | |||
23 | When we speak of free software, we are referring to freedom, not | ||
24 | price. Our General Public Licenses are designed to make sure that you | ||
25 | have the freedom to distribute copies of free software (and charge for | ||
26 | this service if you wish), that you receive source code or can get it | ||
27 | if you want it, that you can change the software or use pieces of it | ||
28 | in 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 | ||
31 | anyone to deny you these rights or to ask you to surrender the rights. | ||
32 | These restrictions translate to certain responsibilities for you if you | ||
33 | distribute copies of the software, or if you modify it. | ||
34 | |||
35 | For example, if you distribute copies of such a program, whether | ||
36 | gratis or for a fee, you must give the recipients all the rights that | ||
37 | you have. You must make sure that they, too, receive or can get the | ||
38 | source code. And you must show them these terms so they know their | ||
39 | rights. | ||
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, | ||
43 | distribute and/or modify the software. | ||
44 | |||
45 | Also, for each author's protection and ours, we want to make certain | ||
46 | that everyone understands that there is no warranty for this free | ||
47 | software. If the software is modified by someone else and passed on, we | ||
48 | want its recipients to know that what they have is not the original, so | ||
49 | that any problems introduced by others will not reflect on the original | ||
50 | authors' reputations. | ||
51 | |||
52 | Finally, any free program is threatened constantly by software | ||
53 | patents. We wish to avoid the danger that redistributors of a free | ||
54 | program will individually obtain patent licenses, in effect making the | ||
55 | program proprietary. To prevent this, we have made it clear that any | ||
56 | patent must be licensed for everyone's free use or not licensed at all. | ||
57 | |||
58 | The precise terms and conditions for copying, distribution and | ||
59 | modification 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 | ||
65 | a notice placed by the copyright holder saying it may be distributed | ||
66 | under the terms of this General Public License. The "Program", below, | ||
67 | refers to any such program or work, and a "work based on the Program" | ||
68 | means either the Program or any derivative work under copyright law: | ||
69 | that is to say, a work containing the Program or a portion of it, | ||
70 | either verbatim or with modifications and/or translated into another | ||
71 | language. (Hereinafter, translation is included without limitation in | ||
72 | the term "modification".) Each licensee is addressed as "you". | ||
73 | |||
74 | Activities other than copying, distribution and modification are not | ||
75 | covered by this License; they are outside its scope. The act of | ||
76 | running the Program is not restricted, and the output from the Program | ||
77 | is covered only if its contents constitute a work based on the | ||
78 | Program (independent of having been made by running the Program). | ||
79 | Whether that is true depends on what the Program does. | ||
80 | |||
81 | 1. You may copy and distribute verbatim copies of the Program's | ||
82 | source code as you receive it, in any medium, provided that you | ||
83 | conspicuously and appropriately publish on each copy an appropriate | ||
84 | copyright notice and disclaimer of warranty; keep intact all the | ||
85 | notices that refer to this License and to the absence of any warranty; | ||
86 | and give any other recipients of the Program a copy of this License | ||
87 | along with the Program. | ||
88 | |||
89 | You may charge a fee for the physical act of transferring a copy, and | ||
90 | you 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 | ||
93 | of it, thus forming a work based on the Program, and copy and | ||
94 | distribute such modifications or work under the terms of Section 1 | ||
95 | above, 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 | |||
116 | These requirements apply to the modified work as a whole. If | ||
117 | identifiable sections of that work are not derived from the Program, | ||
118 | and can be reasonably considered independent and separate works in | ||
119 | themselves, then this License, and its terms, do not apply to those | ||
120 | sections when you distribute them as separate works. But when you | ||
121 | distribute the same sections as part of a whole which is a work based | ||
122 | on the Program, the distribution of the whole must be on the terms of | ||
123 | this License, whose permissions for other licensees extend to the | ||
124 | entire whole, and thus to each and every part regardless of who wrote it. | ||
125 | |||
126 | Thus, it is not the intent of this section to claim rights or contest | ||
127 | your rights to work written entirely by you; rather, the intent is to | ||
128 | exercise the right to control the distribution of derivative or | ||
129 | collective works based on the Program. | ||
130 | |||
131 | In addition, mere aggregation of another work not based on the Program | ||
132 | with the Program (or with a work based on the Program) on a volume of | ||
133 | a storage or distribution medium does not bring the other work under | ||
134 | the scope of this License. | ||
135 | |||
136 | 3. You may copy and distribute the Program (or a work based on it, | ||
137 | under Section 2) in object code or executable form under the terms of | ||
138 | Sections 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 | |||
157 | The source code for a work means the preferred form of the work for | ||
158 | making modifications to it. For an executable work, complete source | ||
159 | code means all the source code for all modules it contains, plus any | ||
160 | associated interface definition files, plus the scripts used to | ||
161 | control compilation and installation of the executable. However, as a | ||
162 | special exception, the source code distributed need not include | ||
163 | anything that is normally distributed (in either source or binary | ||
164 | form) with the major components (compiler, kernel, and so on) of the | ||
165 | operating system on which the executable runs, unless that component | ||
166 | itself accompanies the executable. | ||
167 | |||
168 | If distribution of executable or object code is made by offering | ||
169 | access to copy from a designated place, then offering equivalent | ||
170 | access to copy the source code from the same place counts as | ||
171 | distribution of the source code, even though third parties are not | ||
172 | compelled to copy the source along with the object code. | ||
173 | |||
174 | 4. You may not copy, modify, sublicense, or distribute the Program | ||
175 | except as expressly provided under this License. Any attempt | ||
176 | otherwise to copy, modify, sublicense or distribute the Program is | ||
177 | void, and will automatically terminate your rights under this License. | ||
178 | However, parties who have received copies, or rights, from you under | ||
179 | this License will not have their licenses terminated so long as such | ||
180 | parties remain in full compliance. | ||
181 | |||
182 | 5. You are not required to accept this License, since you have not | ||
183 | signed it. However, nothing else grants you permission to modify or | ||
184 | distribute the Program or its derivative works. These actions are | ||
185 | prohibited by law if you do not accept this License. Therefore, by | ||
186 | modifying or distributing the Program (or any work based on the | ||
187 | Program), you indicate your acceptance of this License to do so, and | ||
188 | all its terms and conditions for copying, distributing or modifying | ||
189 | the Program or works based on it. | ||
190 | |||
191 | 6. Each time you redistribute the Program (or any work based on the | ||
192 | Program), the recipient automatically receives a license from the | ||
193 | original licensor to copy, distribute or modify the Program subject to | ||
194 | these terms and conditions. You may not impose any further | ||
195 | restrictions on the recipients' exercise of the rights granted herein. | ||
196 | You are not responsible for enforcing compliance by third parties to | ||
197 | this License. | ||
198 | |||
199 | 7. If, as a consequence of a court judgment or allegation of patent | ||
200 | infringement or for any other reason (not limited to patent issues), | ||
201 | conditions are imposed on you (whether by court order, agreement or | ||
202 | otherwise) that contradict the conditions of this License, they do not | ||
203 | excuse you from the conditions of this License. If you cannot | ||
204 | distribute so as to satisfy simultaneously your obligations under this | ||
205 | License and any other pertinent obligations, then as a consequence you | ||
206 | may not distribute the Program at all. For example, if a patent | ||
207 | license would not permit royalty-free redistribution of the Program by | ||
208 | all those who receive copies directly or indirectly through you, then | ||
209 | the only way you could satisfy both it and this License would be to | ||
210 | refrain entirely from distribution of the Program. | ||
211 | |||
212 | If any portion of this section is held invalid or unenforceable under | ||
213 | any particular circumstance, the balance of the section is intended to | ||
214 | apply and the section as a whole is intended to apply in other | ||
215 | circumstances. | ||
216 | |||
217 | It is not the purpose of this section to induce you to infringe any | ||
218 | patents or other property right claims or to contest validity of any | ||
219 | such claims; this section has the sole purpose of protecting the | ||
220 | integrity of the free software distribution system, which is | ||
221 | implemented by public license practices. Many people have made | ||
222 | generous contributions to the wide range of software distributed | ||
223 | through that system in reliance on consistent application of that | ||
224 | system; it is up to the author/donor to decide if he or she is willing | ||
225 | to distribute software through any other system and a licensee cannot | ||
226 | impose that choice. | ||
227 | |||
228 | This section is intended to make thoroughly clear what is believed to | ||
229 | be a consequence of the rest of this License. | ||
230 | |||
231 | 8. If the distribution and/or use of the Program is restricted in | ||
232 | certain countries either by patents or by copyrighted interfaces, the | ||
233 | original copyright holder who places the Program under this License | ||
234 | may add an explicit geographical distribution limitation excluding | ||
235 | those countries, so that distribution is permitted only in or among | ||
236 | countries not thus excluded. In such case, this License incorporates | ||
237 | the limitation as if written in the body of this License. | ||
238 | |||
239 | 9. The Free Software Foundation may publish revised and/or new versions | ||
240 | of the General Public License from time to time. Such new versions will | ||
241 | be similar in spirit to the present version, but may differ in detail to | ||
242 | address new problems or concerns. | ||
243 | |||
244 | Each version is given a distinguishing version number. If the Program | ||
245 | specifies a version number of this License which applies to it and "any | ||
246 | later version", you have the option of following the terms and conditions | ||
247 | either of that version or of any later version published by the Free | ||
248 | Software Foundation. If the Program does not specify a version number of | ||
249 | this License, you may choose any version ever published by the Free Software | ||
250 | Foundation. | ||
251 | |||
252 | 10. If you wish to incorporate parts of the Program into other free | ||
253 | programs whose distribution conditions are different, write to the author | ||
254 | to ask for permission. For software which is copyrighted by the Free | ||
255 | Software Foundation, write to the Free Software Foundation; we sometimes | ||
256 | make exceptions for this. Our decision will be guided by the two goals | ||
257 | of preserving the free status of all derivatives of our free software and | ||
258 | of 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 | ||
263 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | ||
264 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | ||
265 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | ||
266 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
267 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | ||
268 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | ||
269 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | ||
270 | REPAIR OR CORRECTION. | ||
271 | |||
272 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||
273 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | ||
274 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | ||
275 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | ||
276 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | ||
277 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | ||
278 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | ||
279 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | ||
280 | POSSIBILITY 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 | ||
287 | possible use to the public, the best way to achieve this is to make it | ||
288 | free 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 | ||
291 | to attach them to the start of each source file to most effectively | ||
292 | convey the exclusion of warranty; and each file should have at least | ||
293 | the "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 | |||
312 | Also add information on how to contact you by electronic and paper mail. | ||
313 | |||
314 | If the program is interactive, make it output a short notice like this | ||
315 | when 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 | |||
322 | The hypothetical commands `show w' and `show c' should show the appropriate | ||
323 | parts of the General Public License. Of course, the commands you use may | ||
324 | be called something other than `show w' and `show c'; they could even be | ||
325 | mouse-clicks or menu items--whatever suits your program. | ||
326 | |||
327 | You should also get your employer (if you work as a programmer) or your | ||
328 | school, if any, to sign a "copyright disclaimer" for the program, if | ||
329 | necessary. 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 | |||
337 | This General Public License does not permit incorporating your program into | ||
338 | proprietary programs. If your program is a subroutine library, you may | ||
339 | consider it more useful to permit linking proprietary applications with the | ||
340 | library. If this is what you want to do, use the GNU Library General | ||
341 | Public 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 | |||
2 | SGX Embedded Systems DDK for the Linux kernel. | ||
3 | Copyright (C) Imagination Technologies Ltd. All rights reserved. | ||
4 | ====================================================================== | ||
5 | |||
6 | This file covers how to build and install the Imagination Technologies | ||
7 | SGX DDK for the Linux kernel. | ||
8 | |||
9 | |||
10 | Build System Environment Variables | ||
11 | ------------------------------------------- | ||
12 | |||
13 | The SGX DDK Build scripts depend on a number of environment variables | ||
14 | being setup before compilation or installation of DDK software can | ||
15 | commence: | ||
16 | |||
17 | $DISCIMAGE | ||
18 | The DDK Build scripts install files to the location specified by the | ||
19 | DISCIMAGE environment variable, when the make install target is used. | ||
20 | This should point to the target filesystem. | ||
21 | $ export DISCIMAGE=/path/to/filesystem | ||
22 | |||
23 | $KERNELDIR | ||
24 | When building the SGX DDK kernel module, the build needs access | ||
25 | to the headers of the Linux kernel | ||
26 | $ export KERNELDIR=/path/to/kernel | ||
27 | |||
28 | $PATH | ||
29 | If a cross compiler is being used make sure the PATH environment variable | ||
30 | includes the path to the toolchain | ||
31 | $ export PATH=$PATH:/path/to/toolchain | ||
32 | |||
33 | $CROSS_COMPILE | ||
34 | Since the SGX DDK Build scripts are geared toward a cross-compilation | ||
35 | workflow, the CROSS_COMPILE environment variable needs to be set | ||
36 | $ export CROSS_COMPILE=toolchain-prefix- | ||
37 | |||
38 | |||
39 | Build and Install Instructions | ||
40 | ------------------------------------------- | ||
41 | |||
42 | The SGX DDK configures different target builds within directories under | ||
43 | eurasiacon/build/linux/. | ||
44 | |||
45 | The 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 | |||
52 | The 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 | |||
59 | To build for, change to the appropriate target directory, e.g.: | ||
60 | $ cd eurasiacon/build/linux/platform/kbuild | ||
61 | |||
62 | Issue the make command: | ||
63 | $ make BUILD=debug all | ||
64 | |||
65 | The DDK software must be installed by the root user. Become the root user: | ||
66 | $ su | ||
67 | |||
68 | Install the DDK software: | ||
69 | $ make install | ||
70 | |||
71 | Become 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 | |||
2 | This software is Copyright (C) Imagination Technologies Ltd. | ||
3 | |||
4 | You may use, distribute and copy this software under the terms of the MIT | ||
5 | license displayed below. | ||
6 | |||
7 | ----------------------------------------------------------------------------- | ||
8 | |||
9 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
10 | of this software and associated documentation files (the "Software"), to deal | ||
11 | in the Software without restriction, including without limitation the rights | ||
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
13 | copies of the Software, and to permit persons to whom the Software is | ||
14 | furnished to do so, subject to the following conditions: | ||
15 | |||
16 | The above copyright notice and this permission notice shall be included in | ||
17 | all copies or substantial portions of the Software. | ||
18 | |||
19 | Alternatively, this Software may be used under the terms of the GNU General | ||
20 | Public License Version 2 ("GPL") in which case the provisions of GPL are | ||
21 | applicable instead of those above. | ||
22 | |||
23 | If you wish to allow use of your version of this Software only under the terms | ||
24 | of GPL, and not to allow others to use your version of this file under the | ||
25 | terms of the MIT license, indicate your decision by deleting from each file | ||
26 | the provisions above and replace them with the notice and other provisions | ||
27 | required by GPL as set out in the file called "GPL-COPYING" included in this | ||
28 | distribution. If you do not delete the provisions above, a recipient may use | ||
29 | your version of this file under the terms of either the MIT license or GPL. | ||
30 | |||
31 | ----------------------------------------------------------------------------- | ||
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 | ----------------------------------------------------------------------------- | ||
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 | |||
2 | SGX Embedded Systems DDK for Linux kernel. | ||
3 | Copyright (C) Imagination Technologies Ltd. All rights reserved. | ||
4 | ====================================================================== | ||
5 | |||
6 | |||
7 | About | ||
8 | ------------------------------------------- | ||
9 | |||
10 | This is the Imagination Technologies SGX DDK for the Linux kernel. | ||
11 | |||
12 | |||
13 | License | ||
14 | ------------------------------------------- | ||
15 | |||
16 | You may use, distribute and copy this software under the terms of the MIT | ||
17 | license. Details of this license can be found in the file "MIT-COPYING". | ||
18 | |||
19 | Alternatively, you may use, distribute and copy this software under the terms | ||
20 | of the GNU General Public License version 2. The full GNU General Public | ||
21 | License version 2 can be found in the file "GPL-COPYING". | ||
22 | |||
23 | |||
24 | Build and Install Instructions | ||
25 | ------------------------------------------- | ||
26 | |||
27 | For details see the "INSTALL" file. | ||
28 | |||
29 | To build for, change to the appropriate target directory, e.g.: | ||
30 | $ cd eurasiacon/build/linux/platform/kbuild | ||
31 | |||
32 | Issue the make command: | ||
33 | $ make BUILD=debug all | ||
34 | |||
35 | The DDK software must be installed by the root user. Become the root user: | ||
36 | $ su | ||
37 | |||
38 | Install the DDK software: | ||
39 | # make install | ||
40 | |||
41 | Become an ordinary user again: | ||
42 | $ exit | ||
43 | |||
44 | |||
45 | Contact information: | ||
46 | ------------------------------------------- | ||
47 | |||
48 | Imagination Technologies Ltd. <gpl-support@imgtec.com> | ||
49 | Home 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 | ||
43 | MODULE_C_SOURCES := $(filter %.c,$(MODULE_SOURCES)) | ||
44 | MODULE_CXX_SOURCES := $(filter %.cpp,$(MODULE_SOURCES)) | ||
45 | |||
46 | MODULE_UNRECOGNISED_SOURCES := $(filter-out %.c %.cpp, $(MODULE_SOURCES)) | ||
47 | |||
48 | ifneq ($(strip $(MODULE_UNRECOGNISED_SOURCES)),) | ||
49 | $(error In makefile $(THIS_MAKEFILE): Module $(THIS_MODULE) specified source files with unrecognised suffixes: $(MODULE_UNRECOGNISED_SOURCES)) | ||
50 | endif | ||
51 | |||
52 | # Objects built from MODULE_SOURCES | ||
53 | # Objects built from MODULE_C_SOURCES and MODULE_CXX_SOURCES | ||
54 | MODULE_C_OBJECTS := $(addprefix $(MODULE_INTERMEDIATES_DIR)/,$(foreach _cobj,$(MODULE_C_SOURCES:.c=.o),$(notdir $(_cobj)))) | ||
55 | MODULE_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 | ||
61 | MODULE_GENERATED_DEPENDENCIES := $(MODULE_C_OBJECTS:.o=.d) $(MODULE_CXX_OBJECTS:.o=.d) | ||
62 | -include $(MODULE_GENERATED_DEPENDENCIES) | ||
63 | |||
64 | MODULE_DEPENDS := $(addprefix $(MODULE_OUT)/,$($(THIS_MODULE)_depends)) | ||
65 | MODULE_DEPENDS += $(addprefix $(GENERATED_CODE_OUT)/,$($(THIS_MODULE)_genheaders)) | ||
66 | |||
67 | # Add any MODULE_OUT relative include flags here | ||
68 | MODULE_INCLUDE_FLAGS += $(addprefix -I $(MODULE_OUT)/, $($(THIS_MODULE)_includes_relative)) | ||
69 | |||
70 | define 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) | ||
77 | ifneq ($(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) | ||
80 | endif | ||
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) | ||
90 | ifeq ($(MODULE_HOST_BUILD),true) | ||
91 | $$(host-o-from-one-c) | ||
92 | else | ||
93 | $$(target-o-from-one-c) | ||
94 | endif | ||
95 | endef | ||
96 | |||
97 | # This rule is used to compile C++ source files | ||
98 | define 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) | ||
105 | ifneq ($(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) | ||
108 | endif | ||
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))))) | ||
116 | ifeq ($(MODULE_HOST_BUILD),true) | ||
117 | $$(host-o-from-one-cxx) | ||
118 | else | ||
119 | $$(target-o-from-one-cxx) | ||
120 | endif | ||
121 | endef | ||
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 | |||
42 | ifneq ($(filter dumpvar-%,$(MAKECMDGOALS)),) | ||
43 | dumpvar-%: ; | ||
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))))) | ||
45 | endif | ||
46 | |||
47 | ifneq ($(filter whereis-%,$(MAKECMDGOALS)),) | ||
48 | whereis-%: ; | ||
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)))) | ||
50 | endif | ||
51 | |||
52 | ifneq ($(filter whatis-%,$(MAKECMDGOALS)),) | ||
53 | whatis-$(HOST_OUT)/%: ; | ||
54 | whatis-$(TARGET_PRIMARY_OUT)/%: ; | ||
55 | whatis-$(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)),))))) | ||
57 | endif | ||
58 | |||
59 | .PHONY: ls-modules | ||
60 | ls-modules: | ||
61 | @: $(foreach _m,$(ALL_MODULES),$(info $($(_m)_type) $(_m) $(patsubst $(TOP)/%,%,$(INTERNAL_MAKEFILE_FOR_MODULE_$(_m))))) | ||
62 | |||
63 | ifeq ($(strip $(MAKECMDGOALS)),visualise) | ||
64 | FORMAT ?= xlib | ||
65 | GRAPHVIZ ?= neato | ||
66 | visualise: $(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 | ||
72 | else | ||
73 | visualise: | ||
74 | @: $(error visualise specified along with other goals. This is not supported) | ||
75 | endif | ||
76 | |||
77 | .PHONY: help | ||
78 | help: | ||
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 | |||
105 | ifneq ($(filter help,$(D)),) | ||
106 | empty := | ||
107 | space := $(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) | ||
116 | endif | ||
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 | # | ||
54 | COMMON_FLAGS := -W -Wall | ||
55 | |||
56 | # Some GCC warnings are C only, so we must mask them from C++ | ||
57 | # | ||
58 | COMMON_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 | # | ||
64 | ifeq ($(BUILD),debug) | ||
65 | COMMON_USER_FLAGS := -O0 | ||
66 | else | ||
67 | OPTIM ?= -O2 | ||
68 | ifeq ($(USE_LTO),1) | ||
69 | COMMON_USER_FLAGS := $(OPTIM) -flto | ||
70 | else | ||
71 | COMMON_USER_FLAGS := $(OPTIM) | ||
72 | endif | ||
73 | endif | ||
74 | |||
75 | # FIXME: We should probably audit the driver for aliasing | ||
76 | # | ||
77 | COMMON_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 | # | ||
82 | COMMON_USER_FLAGS += -g | ||
83 | |||
84 | # User C and User C++ warning flags | ||
85 | # | ||
86 | COMMON_USER_FLAGS += \ | ||
87 | -Wpointer-arith -Wunused-parameter \ | ||
88 | -Wmissing-format-attribute | ||
89 | |||
90 | # Additional warnings, and optional warnings. | ||
91 | # | ||
92 | TESTED_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) | ||
97 | TESTED_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 | # | ||
109 | TESTED_TARGET_USER_FLAGS += \ | ||
110 | $(call cc-option,-Qunused-arguments) \ | ||
111 | $(call cc-option,-fcolor-diagnostics) | ||
112 | TESTED_HOST_USER_FLAGS += \ | ||
113 | $(call host-cc-option,-Qunused-arguments) \ | ||
114 | $(call host-cc-option,-fcolor-diagnostics) | ||
115 | |||
116 | ifeq ($(W),1) | ||
117 | TESTED_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) | ||
137 | TESTED_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) | ||
157 | endif | ||
158 | |||
159 | TESTED_TARGET_USER_FLAGS += \ | ||
160 | $(call cc-optional-warning,-Wunused-but-set-variable) | ||
161 | TESTED_HOST_USER_FLAGS += \ | ||
162 | $(call host-cc-optional-warning,-Wunused-but-set-variable) | ||
163 | |||
164 | KBUILD_FLAGS := \ | ||
165 | -Wno-unused-parameter -Wno-sign-compare | ||
166 | |||
167 | # androideabi toolchain adds `pic` by default, disable it | ||
168 | # for kernel module build | ||
169 | KBUILD_FLAGS += -fno-pic | ||
170 | KBUILD_FLAGS += -fstack-protector-strong | ||
171 | |||
172 | TESTED_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 | # | ||
203 | ALL_CFLAGS := \ | ||
204 | $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_TARGET_USER_FLAGS) \ | ||
205 | $(SYS_CFLAGS) | ||
206 | ALL_HOST_CFLAGS := \ | ||
207 | $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_HOST_USER_FLAGS) | ||
208 | |||
209 | # User C++ only | ||
210 | # | ||
211 | ALL_CXXFLAGS := \ | ||
212 | -fno-rtti -fno-exceptions \ | ||
213 | $(COMMON_USER_FLAGS) $(COMMON_FLAGS) $(TESTED_TARGET_USER_FLAGS) \ | ||
214 | $(SYS_CXXFLAGS) | ||
215 | ALL_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 | # | ||
221 | ifeq ($(cc-is-clang),true) | ||
222 | ALL_CFLAGS := $(patsubst -O0,-O1,$(ALL_CFLAGS)) | ||
223 | ALL_CXXFLAGS := $(patsubst -O0,-O1,$(ALL_CXXFLAGS)) | ||
224 | endif | ||
225 | |||
226 | # Kernel C only | ||
227 | # | ||
228 | ALL_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 | # | ||
241 | ALL_HOST_LDFLAGS := | ||
242 | ALL_LDFLAGS := -Wl,--warn-shared-textrel | ||
243 | |||
244 | ALL_LDFLAGS += $(SYS_LDFLAGS) | ||
245 | |||
246 | # Optional security hardening features. | ||
247 | ifneq ($(FORTIFY),) | ||
248 | ALL_CFLAGS += -fstack-protector -Wa,--noexecstack -D_FORTIFY_SOURCE=2 | ||
249 | ALL_CXXFLAGS += -fstack-protector -Wa,--noexecstack -D_FORTIFY_SOURCE=2 | ||
250 | ALL_LDFLAGS += -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now | ||
251 | endif | ||
252 | |||
253 | # This variable contains a list of all modules built by kbuild | ||
254 | ALL_KBUILD_MODULES := | ||
255 | |||
256 | # This variable contains a list of all modules which contain C++ source files | ||
257 | ALL_CXX_MODULES := | ||
258 | |||
259 | # Toolchain triple for cross environment | ||
260 | CROSS_TRIPLE := $(patsubst %-,%,$(notdir $(CROSS_COMPILE))) | ||
261 | |||
262 | ifneq ($(TOOLCHAIN),) | ||
263 | $(warning **********************************************) | ||
264 | $(warning The TOOLCHAIN option has been removed, but) | ||
265 | $(warning you have it set (via $(origin TOOLCHAIN))) | ||
266 | $(warning **********************************************) | ||
267 | endif | ||
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 | |||
50 | define 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 $@ | ||
54 | endef | ||
55 | |||
56 | define 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 $@ | ||
60 | endef | ||
61 | |||
62 | define 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 $@ | ||
66 | endef | ||
67 | |||
68 | define 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 $@ | ||
72 | endef | ||
73 | |||
74 | define 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) | ||
79 | endef | ||
80 | |||
81 | define 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) | ||
86 | endef | ||
87 | |||
88 | define 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) | ||
94 | endef | ||
95 | |||
96 | define 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) | ||
102 | endef | ||
103 | |||
104 | define 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) | ||
110 | endef | ||
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 | ||
114 | define 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) | ||
120 | endef | ||
121 | |||
122 | define 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) | ||
128 | endef | ||
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 | ||
132 | define 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) | ||
138 | endef | ||
139 | |||
140 | define target-copy-debug-information | ||
141 | $(OBJCOPY) --only-keep-debug $@ $(basename $@).dbg | ||
142 | endef | ||
143 | |||
144 | define host-strip-debug-information | ||
145 | $(HOST_STRIP) --strip-unneeded $@ | ||
146 | endef | ||
147 | |||
148 | define target-strip-debug-information | ||
149 | $(STRIP) --strip-unneeded $@ | ||
150 | endef | ||
151 | |||
152 | define target-add-debuglink | ||
153 | $(if $(V),,@echo " DBGLINK " $(call relative-to-top,$(basename $@).dbg)) | ||
154 | $(OBJCOPY) --add-gnu-debuglink=$(basename $@).dbg $@ | ||
155 | endef | ||
156 | |||
157 | define host-static-library-from-o | ||
158 | $(if $(V),,@echo " HOST_AR " $(call relative-to-top,$@)) | ||
159 | $(HOST_AR) cru $@ $(sort $(MODULE_ALL_OBJECTS)) | ||
160 | endef | ||
161 | |||
162 | define target-static-library-from-o | ||
163 | $(if $(V),,@echo " AR " $(call relative-to-top,$@)) | ||
164 | $(AR) cru $@ $(sort $(MODULE_ALL_OBJECTS)) | ||
165 | endef | ||
166 | |||
167 | define tab-c-from-y | ||
168 | $(if $(V),,@echo " BISON " $(call relative-to-top,$<)) | ||
169 | $(BISON) $(MODULE_BISON_FLAGS) -o $@ -d $< | ||
170 | endef | ||
171 | |||
172 | define l-c-from-l | ||
173 | $(if $(V),,@echo " FLEX " $(call relative-to-top,$<)) | ||
174 | $(FLEX) $(MODULE_FLEX_FLAGS) -o$@ $< | ||
175 | endef | ||
176 | |||
177 | define clean-dirs | ||
178 | $(if $(V),,@echo " RM " $(call relative-to-top,$(MODULE_DIRS_TO_REMOVE))) | ||
179 | $(RM) -rf $(MODULE_DIRS_TO_REMOVE) | ||
180 | endef | ||
181 | |||
182 | define make-directory | ||
183 | $(MKDIR) -p $@ | ||
184 | endef | ||
185 | |||
186 | define check-exports-from-file | ||
187 | endef | ||
188 | |||
189 | define check-exports | ||
190 | $(call check-exports-from-file,$(if $1,$1,$(notdir $@).txt)) | ||
191 | endef | ||
192 | |||
193 | # Programs used in recipes | ||
194 | |||
195 | BISON ?= bison | ||
196 | CC ?= gcc | ||
197 | CC_SECONDARY ?= $(CC) | ||
198 | CROSS_COMPILE_SECONDARY ?= $(CROSS_COMPILE) | ||
199 | CXX ?= g++ | ||
200 | CXX_SECONDARY ?= $(CXX) | ||
201 | HOST_CC ?= gcc | ||
202 | HOST_CXX ?= g++ | ||
203 | JAR ?= jar | ||
204 | JAVA ?= java | ||
205 | JAVAC ?= javac | ||
206 | ZIP ?= zip | ||
207 | PKG_CONFIG ?= pkg-config | ||
208 | |||
209 | ifeq ($(USE_CCACHE),1) | ||
210 | CCACHE ?= ccache | ||
211 | endif | ||
212 | |||
213 | # Define CHMOD and CC_CHECK first so we can use cc-is-clang | ||
214 | # | ||
215 | override CHMOD := $(if $(V),,@)chmod | ||
216 | override 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 | |||
230 | ifneq ($(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 | ||
248 | endif | ||
249 | |||
250 | # Apply compiler wrappers and V=1 handling | ||
251 | override CC_SECONDARY := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CC_SECONDARY) | ||
252 | override CXX_SECONDARY := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CXX_SECONDARY) | ||
253 | |||
254 | ifneq ($(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 | ||
272 | else | ||
273 | $(if $(CROSS_COMPILE_SECONDARY),$(error CROSS_COMPILE_SECONDARY is set but CROSS_COMPILE is empty)) | ||
274 | endif | ||
275 | |||
276 | # Apply compiler wrappers and V=1 handling | ||
277 | override CC := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CC) | ||
278 | override CXX := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CXX) | ||
279 | |||
280 | override AR := $(if $(V),,@)$(CROSS_COMPILE)ar | ||
281 | override BISON := $(if $(V),,@)$(BISON) | ||
282 | override BZIP2 := $(if $(V),,@)bzip2 -9 | ||
283 | override CAT := $(if $(V),,@)cat | ||
284 | override CP := $(if $(V),,@)cp | ||
285 | override ECHO := $(if $(V),,@)echo | ||
286 | override FLEX := $(if $(V),,@)flex | ||
287 | override GAWK := $(if $(V),,@)gawk | ||
288 | override GREP := $(if $(V),,@)grep | ||
289 | override HOST_AR := $(if $(V),,@)ar | ||
290 | override HOST_CC := $(if $(V),,@)$(CCACHE) $(HOST_CC) | ||
291 | override HOST_CXX := $(if $(V),,@)$(CCACHE) $(HOST_CXX) | ||
292 | override HOST_STRIP := $(if $(V),,@)strip | ||
293 | override INSTALL := $(if $(V),,@)install | ||
294 | override JAR := $(if $(V),,@)$(JAR) | ||
295 | override JAVA := $(if $(V),,@)$(JAVA) | ||
296 | override JAVAC := $(if $(V),,@)$(JAVAC) | ||
297 | override LN := $(if $(V),,@)ln -f | ||
298 | override M4 := $(if $(V),,@)m4 | ||
299 | override MKDIR := $(if $(V),,@)mkdir | ||
300 | override MV := $(if $(V),,@)mv | ||
301 | override OBJCOPY := $(if $(V),,@)$(CROSS_COMPILE)objcopy | ||
302 | override PDSASM := $(if $(V),,@)$(HOST_OUT)/pdsasm | ||
303 | override RANLIB := $(if $(V),,@)$(CROSS_COMPILE)ranlib | ||
304 | override RM := $(if $(V),,@)rm -f | ||
305 | override SED := $(if $(V),,@)sed | ||
306 | override STRIP := $(if $(V),,@)$(CROSS_COMPILE)strip | ||
307 | override TAR := $(if $(V),,@)tar | ||
308 | override TOUCH := $(if $(V),,@)touch | ||
309 | override USEASM := $(if $(V),,@)$(HOST_OUT)/useasm | ||
310 | override USELINK := $(if $(V),,@)$(HOST_OUT)/uselink | ||
311 | override VHD2INC := $(if $(V),,@)$(HOST_OUT)/vhd2inc | ||
312 | override 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 | |||
41 | include ../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.. | ||
54 | ANDROID_ARCH := $(filter arm arm64 x86 x86_64,$(ARCH)) | ||
55 | |||
56 | # x86 is special and has another legacy ARCH name which is remapped | ||
57 | ifeq ($(ARCH),i386) | ||
58 | TARGET_ARCH := x86 | ||
59 | endif | ||
60 | |||
61 | ifeq ($(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 | ||
65 | ifneq ($(filter arm64-v8a,$(JNI_CPU_ABI)),) | ||
66 | TARGET_ARCH=arm64 | ||
67 | else ifneq ($(filter armeabi-v7a armeabi,$(JNI_CPU_ABI)),) | ||
68 | TARGET_ARCH=arm | ||
69 | else ifneq ($(filter mips64,$(JNI_CPU_ABI)),) | ||
70 | TARGET_ARCH=mips64 | ||
71 | else ifneq ($(filter mips,$(JNI_CPU_ABI)),) | ||
72 | TARGET_ARCH=mips | ||
73 | else ifneq ($(filter x86_64,$(JNI_CPU_ABI)),) | ||
74 | TARGET_ARCH=x86_64 | ||
75 | else ifneq ($(filter x86,$(JNI_CPU_ABI)),) | ||
76 | TARGET_ARCH=x86 | ||
77 | else | ||
78 | $(error ARCH not set and JNI_CPU_ABI=$(JNI_CPU_ABI) was not remappable) | ||
79 | endif | ||
80 | else | ||
81 | TARGET_ARCH := $(ANDROID_ARCH) | ||
82 | endif | ||
83 | |||
84 | JNI_CPU_ABI := $(word 1,$(JNI_CPU_ABI)) | ||
85 | JNI_CPU_ABI_2ND := $(word 1,$(JNI_CPU_ABI_2ND)) | ||
86 | |||
87 | include ../common/android/arch_common.mk | ||
88 | |||
89 | ifneq ($(filter arm arm64 mips mips64,$(TARGET_ARCH)),) | ||
90 | LDM_PLATFORM ?= 1 | ||
91 | endif | ||
92 | |||
93 | ifneq ($(filter x86 x86_64,$(TARGET_ARCH)),) | ||
94 | LDM_PCI ?= 1 | ||
95 | endif | ||
96 | |||
97 | ifneq ($(filter x86 x86_64,$(TARGET_ARCH)),) | ||
98 | KERNEL_CROSS_COMPILE ?= undef | ||
99 | endif | ||
100 | |||
101 | ifneq ($(filter arm64 mips64 x86_64,$(TARGET_ARCH)),) | ||
102 | ifeq ($(MULTIARCH),) | ||
103 | $(warning *** 64-bit architecture detected. Enabling MULTIARCH=1.) | ||
104 | $(warning *** If you want a 64-bit only build, use MULTIARCH=64only.) | ||
105 | export MULTIARCH := 1 | ||
106 | endif | ||
107 | endif | ||
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 | |||
41 | SYS_CFLAGS := \ | ||
42 | -fno-short-enums \ | ||
43 | -funwind-tables \ | ||
44 | -D__linux__ | ||
45 | |||
46 | SYS_INCLUDES := | ||
47 | |||
48 | ifneq ($(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 | |||
58 | else # !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 | |||
83 | endif # !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. | ||
137 | ifeq ($(notdir $(abspath .)),omap_android) | ||
138 | SYS_INCLUDES += \ | ||
139 | -isystem $(ANDROID_ROOT)/hardware/ti/omap4xxx/kernel-headers \ | ||
140 | -isystem $(ANDROID_ROOT)/hardware/ti/omap4xxx/ion | ||
141 | endif | ||
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 | |||
148 | SYS_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 | ||
152 | SYS_LDFLAGS += -Wl,--build-id=md5 | ||
153 | |||
154 | SYS_EXE_LDFLAGS_CXX := -lstdc++ | ||
155 | |||
156 | SYS_LIB_LDFLAGS_CXX := $(SYS_EXE_LDFLAGS_CXX) | ||
157 | |||
158 | OPTIM := -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 | |||
58 | ifeq ($(NO_HARDWARE),1) | ||
59 | override PVR_ANDROID_COMPOSERHAL := null | ||
60 | endif | ||
61 | |||
62 | ifneq ($(PVR_ANDROID_COMPOSERHAL),drm) | ||
63 | ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),1) | ||
64 | override PVR_ANDROID_COMPOSERHAL := null | ||
65 | endif | ||
66 | endif | ||
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. | ||
74 | ifeq ($(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 | ||
113 | endif | ||
114 | |||
115 | include ../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 | # | ||
43 | SUPPORT_ANDROID_PLATFORM := 1 | ||
44 | SUPPORT_OPENGLES1_V1_ONLY := 1 | ||
45 | DONT_USE_SONAMES := 1 | ||
46 | |||
47 | # Meminfo IDs are required for buffer stamps | ||
48 | # | ||
49 | SUPPORT_MEMINFO_IDS := 1 | ||
50 | |||
51 | # Enable services ion support by default | ||
52 | # | ||
53 | SUPPORT_ION ?= 0 | ||
54 | SUPPORT_DMABUF := 1 | ||
55 | |||
56 | # Need multi-process support in PDUMP | ||
57 | # | ||
58 | SUPPORT_PDUMP_MULTI_PROCESS := 1 | ||
59 | |||
60 | # Always print debugging after 5 seconds of no activity | ||
61 | # | ||
62 | CLIENT_DRIVER_DEFAULT_WAIT_RETRIES := 50 | ||
63 | |||
64 | # Android WSEGL is always the same | ||
65 | # | ||
66 | OPK_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 | # | ||
71 | KERNEL_COMPONENTS := srvkm | ||
72 | |||
73 | # Use the new PVR_DPF implementation to allow lower message levels | ||
74 | # to be stripped from production drivers | ||
75 | # | ||
76 | PVRSRV_NEW_PVR_DPF := 1 | ||
77 | |||
78 | # Production Android builds don't want PVRSRVGetDCSystemBuffer | ||
79 | # | ||
80 | SUPPORT_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 | # | ||
86 | SUPPORT_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 | # | ||
97 | PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 5400 | ||
98 | |||
99 | ############################################################################## | ||
100 | # Enable source fortification by default | ||
101 | # | ||
102 | FORTIFY ?= 1 | ||
103 | |||
104 | ############################################################################## | ||
105 | # Unless overridden by the user, assume the RenderScript Compute API level | ||
106 | # matches that of the SDK API_LEVEL. | ||
107 | # | ||
108 | RSC_API_LEVEL ?= $(API_LEVEL) | ||
109 | ifneq ($(findstring $(RSC_API_LEVEL),21 22),) | ||
110 | RSC_API_LEVEL := 20 | ||
111 | endif | ||
112 | |||
113 | ############################################################################## | ||
114 | # Framebuffer target extension is used to find configs compatible with | ||
115 | # the framebuffer (added in JB MR1). | ||
116 | # | ||
117 | EGL_EXTENSION_ANDROID_FRAMEBUFFER_TARGET := 1 | ||
118 | |||
119 | ############################################################################## | ||
120 | # Handle various platform includes for unittests | ||
121 | # | ||
122 | UNITTEST_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 | |||
129 | UNITTEST_INCLUDES += eurasiacon/unittests/include | ||
130 | |||
131 | ############################################################################## | ||
132 | # Future versions moved proprietary libraries to a vendor directory | ||
133 | # | ||
134 | ifeq ($(wildcard $(TARGET_ROOT)/product/$(TARGET_DEVICE)/vendor),) | ||
135 | PVRSRV_MODULE_BASEDIR := /system/lib/modules/ | ||
136 | BIN_DESTDIR := /system/vendor/bin | ||
137 | APP_DESTDIR := /data/app | ||
138 | else | ||
139 | PVR_ANDROID_FORCE_APP_NATIVE_UNPACKED := 1 | ||
140 | PVRSRV_MODULE_BASEDIR := /vendor/lib/modules/ | ||
141 | BIN_DESTDIR := /vendor/bin | ||
142 | APP_DESTDIR := /vendor/app | ||
143 | endif | ||
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 | # | ||
149 | SHLIB_DESTDIR := not-used | ||
150 | EGL_DESTDIR := not-used | ||
151 | |||
152 | # Must give our EGL/GLES libraries a globally unique name | ||
153 | # | ||
154 | EGL_BASENAME_SUFFIX := _POWERVR_SGX$(SGXCORE)_$(SGX_CORE_REV) | ||
155 | |||
156 | SYS_CXXFLAGS := -fuse-cxa-atexit $(SYS_CFLAGS) | ||
157 | SYS_INCLUDES += -isystem $(LIBCXX_INCLUDE_PATH) | ||
158 | |||
159 | ############################################################################## | ||
160 | # Support the OES_EGL_image_external extensions in the client drivers. | ||
161 | # | ||
162 | GLES1_EXTENSION_EGL_IMAGE_EXTERNAL := 1 | ||
163 | GLES2_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 | # | ||
170 | EGL_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 | # | ||
176 | EGL_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 | # | ||
182 | EGL_EXTENSION_ANDROID_NATIVE_FENCE_SYNC ?= 1 | ||
183 | |||
184 | ############################################################################## | ||
185 | # Kernel 4.9 introduces new sync framework for cross-process sync | ||
186 | # | ||
187 | ifneq ($(strip $(KERNELDIR)),) | ||
188 | include ../kernel_version.mk | ||
189 | ifeq ($(call kernel-version-at-least,4,9,27),true) | ||
190 | PVR_ANDROID_NATIVE_WINDOW_HAS_FENCE ?= 1 | ||
191 | else | ||
192 | PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC ?= 1 | ||
193 | endif | ||
194 | endif | ||
195 | |||
196 | ############################################################################## | ||
197 | # Versions of Android prior to Nougat required Java 7 (OpenJDK). | ||
198 | # | ||
199 | ifeq ($(is_at_least_nougat),0) | ||
200 | LEGACY_USE_JAVA7 ?= 1 | ||
201 | endif | ||
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 | # | ||
207 | ifeq ($(is_at_least_lollipop),1) | ||
208 | PVR_ANDROID_BCC_MULTIARCH_SUPPORT := 1 | ||
209 | endif | ||
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 | # | ||
216 | ifeq ($(is_at_least_nougat),0) | ||
217 | LEGACY_USE_ZIPALIGN ?= 1 | ||
218 | endif | ||
219 | |||
220 | ############################################################################## | ||
221 | # Marshmallow needs --soname turned on | ||
222 | # | ||
223 | ifeq ($(is_at_least_marshmallow),1) | ||
224 | PVR_ANDROID_NEEDS_SONAME ?= 1 | ||
225 | endif | ||
226 | |||
227 | ############################################################################## | ||
228 | # Marshmallow replaces RAW_SENSOR with RAW10, RAW12 and RAW16 | ||
229 | # | ||
230 | ifeq ($(is_at_least_marshmallow),1) | ||
231 | PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_RAWxx := 1 | ||
232 | endif | ||
233 | |||
234 | ############################################################################## | ||
235 | # Marshmallow onwards DDK stopped render script acceleration using GPU. | ||
236 | # This flag stops device allocation. | ||
237 | # | ||
238 | ifeq ($(is_at_least_marshmallow),1) | ||
239 | PVR_ANDROID_HAS_GRALLOC_USAGE_RENDERSCRIPT := 1 | ||
240 | endif | ||
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 | # | ||
246 | ifeq ($(is_at_least_oreo),1) | ||
247 | override PVR_ANDROID_HAS_ANDROID_SYNC_H := 1 | ||
248 | endif | ||
249 | |||
250 | # Placeholder for future version handling | ||
251 | # | ||
252 | ifeq ($(is_future_version),1) | ||
253 | -include ../common/android/future_version.mk | ||
254 | endif | ||
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 | # | ||
43 | function 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 | |||
54 | WD=`pwd` | ||
55 | SCRIPT_ROOT=`dirname $0` | ||
56 | cd $SCRIPT_ROOT | ||
57 | |||
58 | PVRVERSION=[PVRVERSION] | ||
59 | PVRBUILD=[PVRBUILD] | ||
60 | PRIMARY_ARCH="[PRIMARY_ARCH]" | ||
61 | ARCHITECTURES="[ARCHITECTURES]" | ||
62 | |||
63 | APP_DESTDIR=[APP_DESTDIR] | ||
64 | BIN_DESTDIR=[BIN_DESTDIR] | ||
65 | DATA_DESTDIR=[BIN_DESTDIR] | ||
66 | |||
67 | # Exit with an error messages. | ||
68 | # $1=blurb | ||
69 | # | ||
70 | function 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. | ||
81 | function 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. | ||
185 | function 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 | # | ||
265 | while [ "$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 | ||
285 | done | ||
286 | |||
287 | if [ ! -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 | |||
313 | else | ||
314 | bail "DISCIMAGE must be set for installation to be possible." | ||
315 | fi | ||
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 | |||
41 | TARGET_BUILD_TYPE ?= release | ||
42 | |||
43 | HOST_OS ?= linux | ||
44 | HOST_ARCH ?= x86 | ||
45 | |||
46 | ifeq ($(wildcard $(OUT_DIR)),) | ||
47 | OUT_DIR = $(ANDROID_ROOT)/out | ||
48 | endif | ||
49 | |||
50 | ifeq ($(TARGET_BUILD_TYPE),debug) | ||
51 | TARGET_ROOT := $(OUT_DIR)/debug/target | ||
52 | else | ||
53 | TARGET_ROOT := $(OUT_DIR)/target | ||
54 | endif | ||
55 | |||
56 | ifeq ($(NDK_ROOT),) | ||
57 | LIBCXX_INCLUDE_PATH := $(ANDROID_ROOT)/external/libcxx/include | ||
58 | else | ||
59 | LIBCXX_INCLUDE_PATH := $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/include | ||
60 | endif | ||
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 | # | ||
44 | BUILD_PROP := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/vendor/build.prop | ||
45 | ifeq ($(wildcard $(BUILD_PROP)),) | ||
46 | $(warning *** Could not determine Android version. Did you set ANDROID_ROOT,\ | ||
47 | OUT_DIR and TARGET_DEVICE in your environment correctly?) | ||
48 | $(error Error reading $(BUILD_PROP)) | ||
49 | endif | ||
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 | # | ||
55 | define newline | ||
56 | |||
57 | |||
58 | endef | ||
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 | |||
64 | define release-starts-with | ||
65 | $(shell echo $(PLATFORM_RELEASE) | grep -q ^$(1); \ | ||
66 | [ "$$?" = "0" ] && echo 1 || echo 0) | ||
67 | endef | ||
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 | # | ||
84 | ifeq ($(call release-starts-with,LollipopMR1),1) | ||
85 | override PLATFORM_RELEASE := 5.1 | ||
86 | else ifeq ($(call release-starts-with,Marshmallow),1) | ||
87 | override PLATFORM_RELEASE := 6.0 | ||
88 | else ifeq ($(call release-starts-with,NougatMR),1) | ||
89 | override PLATFORM_RELEASE := 7.1 | ||
90 | else ifeq ($(call release-starts-with,Nougat),1) | ||
91 | override PLATFORM_RELEASE := 7.0 | ||
92 | else ifeq ($(call release-starts-with,Oreo),1) | ||
93 | override PLATFORM_RELEASE := 8.0 | ||
94 | else ifeq ($(PLATFORM_BUILDID),OC) | ||
95 | override PLATFORM_RELEASE := 8.0.80 | ||
96 | else ifeq ($(shell echo $(PLATFORM_RELEASE) | grep -qE "[A-Za-z]+"; echo $$?),0) | ||
97 | override PLATFORM_RELEASE := 8.2 | ||
98 | endif | ||
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 | # | ||
103 | ifeq ($(PLATFORM_RELEASE),8.0.80) | ||
104 | override PLATFORM_RELEASE := 8.0 | ||
105 | is_aosp_master := 1 | ||
106 | endif | ||
107 | |||
108 | PLATFORM_RELEASE_MAJ := $(shell echo $(PLATFORM_RELEASE) | cut -f1 -d'.') | ||
109 | PLATFORM_RELEASE_MIN := $(shell echo $(PLATFORM_RELEASE) | cut -f2 -d'.') | ||
110 | PLATFORM_RELEASE_PATCH := $(shell echo $(PLATFORM_RELEASE) | cut -f3 -d'.') | ||
111 | |||
112 | # Not all versions have a patchlevel; fix that up here | ||
113 | # | ||
114 | ifeq ($(PLATFORM_RELEASE_PATCH),) | ||
115 | PLATFORM_RELEASE_PATCH := 0 | ||
116 | endif | ||
117 | |||
118 | # Macros to help categorize support for features and API_LEVEL for tests. | ||
119 | # | ||
120 | is_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) | ||
124 | is_at_least_marshmallow := \ | ||
125 | $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 6 ) && echo 1 || echo 0) | ||
126 | is_at_least_nougat := \ | ||
127 | $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 7 ) && echo 1 || echo 0) | ||
128 | is_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) | ||
132 | is_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 | ||
136 | is_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 | # | ||
146 | ifeq ($(is_future_version),1) | ||
147 | JACK_VERSION ?= 4.32.CANDIDATE | ||
148 | API_LEVEL := 26 | ||
149 | else ifeq ($(is_at_least_oreo),1) | ||
150 | ifeq ($(is_aosp_master),1) | ||
151 | override JACK_VERSION := | ||
152 | else | ||
153 | JACK_VERSION ?= 4.31.CANDIDATE | ||
154 | endif | ||
155 | API_LEVEL := 26 | ||
156 | else ifeq ($(is_at_least_nougat_mr1),1) | ||
157 | JACK_VERSION ?= 3.36.CANDIDATE | ||
158 | API_LEVEL := 25 | ||
159 | else ifeq ($(is_at_least_nougat),1) | ||
160 | JACK_VERSION ?= 3.36.CANDIDATE | ||
161 | API_LEVEL := 24 | ||
162 | else ifeq ($(is_at_least_marshmallow),1) | ||
163 | JACK_VERSION ?= 2.21.RELEASE | ||
164 | API_LEVEL := 23 | ||
165 | else ifeq ($(is_at_least_lollipop_mr1),1) | ||
166 | # This early version had no version-file.version.code; fake it | ||
167 | JACK_VERSION ?= 1.0.RELEASE | ||
168 | API_LEVEL := 22 | ||
169 | else | ||
170 | $(error Must build against Android >= 5.1) | ||
171 | endif | ||
172 | |||
173 | # If the NDK is enabled, check it has API_LEVEL support for us | ||
174 | ifneq ($(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 | ||
183 | endif | ||
184 | |||
185 | # Each DDK is tested against only a single version of the platform. | ||
186 | # Warn if a different platform version is used. | ||
187 | # | ||
188 | ifeq ($(is_future_version),1) | ||
189 | $(info WARNING: Android version is newer than this DDK supports) | ||
190 | else ifneq ($(is_at_least_marshmallow),1) | ||
191 | $(info WARNING: Android version is older than this DDK supports) | ||
192 | endif | ||
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 | |||
48 | ifeq ($(SUPPORT_DRI_DRM),1) | ||
49 | ifeq ($(SUPPORT_DRI_DRM_NO_LIBDRM),1) | ||
50 | endif | ||
51 | $(eval $(call TunableKernelConfigC,PVR_SECURE_DRM_AUTH_EXPORT,)) | ||
52 | $(eval $(call TunableKernelConfigC,SUPPORT_DRM_MODESET,)) | ||
53 | endif | ||
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 | |||
41 | ifneq ($(KERNELDIR),) | ||
42 | ifneq ($(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. | ||
46 | ifneq ($(wildcard $(KERNELDIR)/source),) | ||
47 | KSRCDIR := $(KERNELDIR)/source | ||
48 | else | ||
49 | KSRCDIR := $(KERNELDIR) | ||
50 | endif | ||
51 | |||
52 | ifneq ($(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. | ||
55 | SUPPORT_ION_HEADER := \"../drivers/staging/android/ion/ion.h\" | ||
56 | SUPPORT_ION_PRIV_HEADER := \"../drivers/staging/android/ion/ion_priv.h\" | ||
57 | SUPPORT_ION_USE_SG_LENGTH := 1 | ||
58 | endif | ||
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 | |||
64 | endif | ||
65 | endif | ||
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). | ||
43 | ifeq ($(strip $(MULTIARCH)),0) | ||
44 | $(error MULTIARCH must be empty to disable multiarch) | ||
45 | endif | ||
46 | |||
47 | define 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 | ||
68 | endef | ||
69 | |||
70 | define 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 | ||
83 | endef | ||
84 | |||
85 | # Work out the host compiler architecture | ||
86 | $(eval $(call calculate-compiler-preferred-target,host,$(HOST_CC))) | ||
87 | |||
88 | ifeq ($(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 | ||
97 | else | ||
98 | ifeq ($(host_compiler_preferred_target),i386-linux-gnu) | ||
99 | HOST_PRIMARY_ARCH := host_i386 | ||
100 | HOST_32BIT_ARCH := host_i386 | ||
101 | else | ||
102 | ifeq ($(host_compiler_preferred_target),arm-linux-gnueabihf) | ||
103 | HOST_PRIMARY_ARCH := host_armhf | ||
104 | HOST_32BIT_ARCH := host_armhf | ||
105 | else | ||
106 | ifeq ($(host_compiler_preferred_target),aarch64-linux-gnu) | ||
107 | HOST_PRIMARY_ARCH := host_aarch64 | ||
108 | HOST_32BIT_ARCH := host_armhf | ||
109 | else | ||
110 | $(error Unknown host compiler target architecture $(host_compiler_preferred_target)) | ||
111 | endif | ||
112 | endif | ||
113 | endif | ||
114 | endif | ||
115 | |||
116 | # Workaround our lack of support for non-Linux HOST_CCs | ||
117 | ifneq ($(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))) | ||
121 | endif | ||
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 | |||
127 | TARGET_ALL_ARCH := | ||
128 | TARGET_PRIMARY_ARCH := | ||
129 | TARGET_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 | # | ||
135 | compilers := ../config/compilers | ||
136 | define 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 | ||
148 | endef | ||
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. | ||
152 | ifneq ($(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) | ||
164 | else | ||
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 := | ||
171 | endif | ||
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 | |||
178 | ifneq ($(SUPPORT_ANDROID_PLATFORM),1) | ||
179 | ifeq ($(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 | ||
192 | endif | ||
193 | endif | ||
194 | |||
195 | define remap-arch | ||
196 | $(if $(INTERNAL_ARCH_REMAP_$(1)),$(INTERNAL_ARCH_REMAP_$(1)),$(1)) | ||
197 | endef | ||
198 | |||
199 | # Remap 'essentially compatible' architectures so the KM vs UM check | ||
200 | # isn't too strict. These mixtures are widely supported. | ||
201 | INTERNAL_ARCH_REMAP_target_armhf := target_armv7-a | ||
202 | INTERNAL_ARCH_REMAP_target_armel := target_armv7-a | ||
203 | INTERNAL_ARCH_REMAP_target_mips32r2el := target_mips32el | ||
204 | INTERNAL_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. | ||
208 | ifneq ($(_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 | ||
220 | endif | ||
221 | |||
222 | ifneq ($(MULTIARCH),32only) | ||
223 | TARGET_ALL_ARCH += $(TARGET_PRIMARY_ARCH) | ||
224 | endif | ||
225 | ifneq ($(MULTIARCH),64only) | ||
226 | TARGET_ALL_ARCH += $(TARGET_SECONDARY_ARCH) | ||
227 | endif | ||
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. | ||
239 | LIBGCC := $(shell $(_cc) -print-libgcc-file-name) | ||
240 | LIBGCC_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 | ||
2 | TARGET_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 | ||
2 | include $(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 | ||
2 | IS_KERNEL_32 := 0 | ||
3 | ifneq ($(KERNELDIR),) | ||
4 | IS_KERNEL_32 = ($(shell grep -q "CONFIG_MIPS=y" $(KERNELDIR)/.config && echo 1 || echo 0)) | ||