compiler-rt-16.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. diff --git a/build/config/clang/BUILD.gn b/build/config/clang/BUILD.gn
  2. index d4de2e0cca0..57359c32121 100644
  3. --- a/build/config/clang/BUILD.gn
  4. +++ b/build/config/clang/BUILD.gn
  5. @@ -130,12 +130,15 @@ template("clang_lib") {
  6. } else if (is_linux || is_chromeos) {
  7. if (current_cpu == "x64") {
  8. _dir = "x86_64-unknown-linux-gnu"
  9. + _suffix = "-x86_64"
  10. } else if (current_cpu == "x86") {
  11. _dir = "i386-unknown-linux-gnu"
  12. + _suffix = "-i386"
  13. } else if (current_cpu == "arm") {
  14. _dir = "armv7-unknown-linux-gnueabihf"
  15. } else if (current_cpu == "arm64") {
  16. _dir = "aarch64-unknown-linux-gnu"
  17. + _suffix = "-aarch64"
  18. } else {
  19. assert(false) # Unhandled cpu type
  20. }
  21. @@ -166,6 +169,15 @@ template("clang_lib") {
  22. assert(false) # Unhandled target platform
  23. }
  24. + # Bit of a hack to make this find builtins from compiler-rt 16
  25. + if (is_linux || is_chromeos) {
  26. + if (clang_version == "16") {
  27. + _dir = "linux"
  28. + } else {
  29. + _suffix = ""
  30. + }
  31. + }
  32. +
  33. _clang_lib_dir = "$clang_base_path/lib/clang/$clang_version/lib"
  34. _lib_file = "${_prefix}clang_rt.${_libname}${_suffix}.${_ext}"
  35. libs = [ "$_clang_lib_dir/$_dir/$_lib_file" ]