Advertisement
infected_

Untitled

Jun 2nd, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. # begin The SaberMod Project additions
  2.  
  3. # Copyright (C) 2015 The SaberMod Project
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17.  
  18. # Handle kernel CC flags by importing vendor/sm strings
  19. ifdef SM_KERNEL_NAME
  20. USE_GCC = $(CROSS_COMPILE)gcc-$(SM_KERNEL_NAME)
  21. CC = $(USE_GCC)
  22. else
  23. CC = $(CROSS_COMPILE)gcc
  24. endif
  25.  
  26. CPP = $(CC) -E
  27.  
  28. # Highest level of basic gcc optimizations if enabled
  29. ifeq ($(strip $(LOCAL_O3)),true)
  30. SABERMOD_KERNEL_FLAGS := -O3
  31. else
  32. SABERMOD_KERNEL_FLAGS := -O2
  33. endif
  34.  
  35. # Extra flags
  36. ifdef SABERMOD_KERNEL_FLAGS
  37. ifdef EXTRA_SABERMOD_GCC_VECTORIZE
  38. SABERMOD_KERNEL_FLAGS += $(EXTRA_SABERMOD_GCC_VECTORIZE)
  39. endif
  40. ifdef EXTRA_SABERMOD_GCC
  41. SABERMOD_KERNEL_FLAGS += $(EXTRA_SABERMOD_GCC)
  42. endif
  43. else
  44. ifdef EXTRA_SABERMOD_GCC_VECTORIZE
  45. SABERMOD_KERNEL_FLAGS := $(EXTRA_SABERMOD_GCC_VECTORIZE)
  46. endif
  47. ifdef EXTRA_SABERMOD_GCC
  48. SABERMOD_KERNEL_FLAGS := $(EXTRA_SABERMOD_GCC)
  49. endif
  50. endif
  51.  
  52. ifdef SABERMOD_KERNEL_FLAGS
  53. ifdef kernel_arch_variant_cflags
  54. SABERMOD_KERNEL_FLAGS += $(kernel_arch_variant_cflags)
  55. endif
  56. else
  57. ifdef kernel_arch_variant_cflags
  58. SABERMOD_KERNEL_FLAGS := $(kernel_arch_variant_cflags)
  59. endif
  60. endif
  61.  
  62. # Strict aliasing for hammerhead if enabled
  63. ifdef CONFIG_MACH_MSM8974_HAMMERHEAD_STRICT_ALIASING
  64. ifdef SABERMOD_KERNEL_FLAGS
  65. SABERMOD_KERNEL_FLAGS += $(KERNEL_STRICT_FLAGS)
  66. else
  67. SABERMOD_KERNEL_FLAGS := $(KERNEL_STRICT_FLAGS)
  68. endif
  69. endif
  70.  
  71. ifneq (1,$(words $(DISABLE_SANITIZE_LEAK)))
  72.  
  73. # Memory leak detector sanitizer
  74. ifdef SABERMOD_KERNEL_FLAGS
  75. SABERMOD_KERNEL_FLAGS += -fsanitize=leak
  76. else
  77. SABERMOD_KERNEL_FLAGS := -fsanitize=leak
  78. endif
  79. endif
  80.  
  81. ifdef SABERMOD_KERNEL_FLAGS
  82. ifdef GRAPHITE_KERNEL_FLAGS
  83. SABERMOD_KERNEL_FLAGS += $(GRAPHITE_KERNEL_FLAGS)
  84. endif
  85. else
  86. ifdef GRAPHITE_KERNEL_FLAGS
  87. SABERMOD_KERNEL_FLAGS := $(GRAPHITE_KERNEL_FLAGS) -marm
  88. endif
  89. endif
  90.  
  91. # Add everything to CC at the end
  92. ifdef SABERMOD_KERNEL_FLAGS
  93. CC += $(SABERMOD_KERNEL_FLAGS)
  94. endif
  95. # end The SaberMod Project additions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement