build.ck 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*++
  2. Copyright (c) 2013 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. Minoca OS Library
  5. Abstract:
  6. This module implements the native system call interface between user
  7. mode applications and the kernel. It runs in user mode, and is utilized
  8. by the C library (or by applications directly) as an interface to the
  9. kernel. Applications are permitted to link against this library and
  10. call functions exported by it, but are not allowed to make system calls
  11. themselves (most of this library is simply a function call veneer over
  12. the system calls anyway). Applications utilizing this native library
  13. can get added functionality or performance, but at the cost of
  14. portability.
  15. Author:
  16. Evan Green 25-Feb-2013
  17. Environment:
  18. User
  19. --*/
  20. function build() {
  21. sources = [
  22. "env.c",
  23. "heap.c",
  24. "osimag.c",
  25. "osbase.c",
  26. "rwlock.c",
  27. "socket.c",
  28. "spinlock.c",
  29. "time.c",
  30. "tls.c"
  31. ];
  32. if ((arch == "armv7") || (arch == "armv6")) {
  33. text_base = "0x10000000";
  34. arch_sources = [
  35. "armv7/features.c",
  36. "armv7/osbasea.S",
  37. "armv7/syscall.c"
  38. ];
  39. } else if (arch == "x86") {
  40. text_base = "0x200000";
  41. arch_sources = [
  42. "x86/features.c",
  43. "x86/osbasea.S",
  44. "x86/syscall.c"
  45. ];
  46. } else if (arch == "x64") {
  47. text_base = "0x200000";
  48. arch_sources = [
  49. "x64/osbasea.S",
  50. "x64/syscall.c"
  51. ];
  52. }
  53. link_ldflags = [
  54. "-Wl,-Bsymbolic",
  55. "-nostdlib",
  56. "-Wl,--whole-archive",
  57. "-Wl,-Ttext-segment=" + text_base,
  58. ];
  59. link_config = {
  60. "LDFLAGS": link_ldflags
  61. };
  62. libs = [
  63. "//lib/rtl/base:basertl",
  64. "//lib/rtl/base:basertlw",
  65. "//lib/im:im",
  66. "//apps/osbase/urtl:urtl",
  67. "//lib/crypto:crypto"
  68. ];
  69. so = {
  70. "label": "libminocaos",
  71. "inputs": sources + arch_sources + libs,
  72. "entry": "OsDynamicLoaderMain",
  73. "config": link_config,
  74. "major_version": "1"
  75. };
  76. entries = shared_library(so);
  77. return entries;
  78. }
  79. return build();