build.ck 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*++
  2. Copyright (c) 2014 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. UEFI Runtime Core
  9. Abstract:
  10. This module implements the UEFI core runtime support, which only
  11. supports setting the virtual address map. It is implemented as a
  12. separate runtime binary to avoid the paradox of ExitBootServices
  13. and SetVirtualAddressMap trying to tear down or change themselves.
  14. Author:
  15. Evan Green 10-Mar-2014
  16. Environment:
  17. Firmware
  18. --*/
  19. from menv import staticApplication, mconfig, uefiRuntimeFfs;
  20. function build() {
  21. var arch = mconfig.arch;
  22. var elf;
  23. var entries;
  24. var includes;
  25. var libs;
  26. var linkConfig;
  27. var sources;
  28. var sourcesConfig;
  29. sources = [
  30. "uefi/core:crc32.o",
  31. "runtime.c",
  32. ];
  33. libs = [
  34. "uefi/archlib:uefiarch"
  35. ];
  36. includes = [
  37. "$S/uefi/include",
  38. "$S/uefi/core"
  39. ];
  40. sourcesConfig = {
  41. "CFLAGS": ["-fshort-wchar"],
  42. };
  43. linkConfig = {
  44. "LDFLAGS": ["-pie", "-nodefaultlibs", "-nostartfiles"]
  45. };
  46. elf = {
  47. "label": "rtbase.elf",
  48. "inputs": sources + libs,
  49. "sources_config": sourcesConfig,
  50. "includes": includes,
  51. "entry": "EfiRuntimeDriverEntry",
  52. "config": linkConfig
  53. };
  54. if ((arch == "armv7") || (arch == "armv6")) {
  55. elf["linker_script"] = "$S/uefi/include/link_arm.x";
  56. }
  57. entries = staticApplication(elf);
  58. entries += uefiRuntimeFfs("rtbase");
  59. return entries;
  60. }