diff --git a/zircon/system/ulib/c/BUILD.gn b/zircon/system/ulib/c/BUILD.gn index 4b50f98be2871a93d6fb9fbf503986930d11ef7f..252447012c14ff825537757371af4339dbd8eb30 100644 --- a/zircon/system/ulib/c/BUILD.gn +++ b/zircon/system/ulib/c/BUILD.gn @@ -25,6 +25,9 @@ library("c") { # Suppress the ${toolchain.implicit_deps} that points back to here. no_implicit_deps = true + # Don't link against the shared libc++. + configs += [ "$zx/public/gn/config:static-libc++" ] + # TODO(BLD-353): temporary kludges; see //zircon/public/sysroot metadata = { legacy_sysroot = [ diff --git a/zircon/third_party/lib/cortex-strings/README.fuchsia b/zircon/third_party/lib/cortex-strings/README.fuchsia index 9934c6eba1e2ecf1a16d0b15a54cc245503db791..2b9a99f39873ee53369e86e18f929170115ad60a 100644 --- a/zircon/third_party/lib/cortex-strings/README.fuchsia +++ b/zircon/third_party/lib/cortex-strings/README.fuchsia @@ -13,3 +13,4 @@ Modifications: - The no-neon directory is taken from an earlier revision of the same repo: bc654e7a594385071b42db3c9c94bd0fd5fe0da5 It contains only a subset of src/aarch64 from that revision. +- Added ".Lmemcpy" branch veneer to src/aarch64/memmove.S diff --git a/zircon/third_party/lib/cortex-strings/src/aarch64/memmove.S b/zircon/third_party/lib/cortex-strings/src/aarch64/memmove.S index c9fe6c1f5710976972eeee5ba5f410c98f782ae9..9a3fc8e08b5639ceb7d3a1e4b4add6a17472a120 100644 --- a/zircon/third_party/lib/cortex-strings/src/aarch64/memmove.S +++ b/zircon/third_party/lib/cortex-strings/src/aarch64/memmove.S @@ -93,7 +93,11 @@ def_fn memmove, 6 sub tmp1, dstin, src cmp count, 96 ccmp tmp1, count, 2, hi - b.hs memcpy + // The linker doesn't generate a veneer for a conditional branch + // whose target is too far away, so we need to use our own "veneer". + // Unfortunately that introduces the extra jump even when the + // distance would allow removing it, because only the linker knows. + b.hs .Lmemcpy cbz tmp1, 3f add dstend, dstin, count @@ -147,4 +151,7 @@ def_fn memmove, 6 stp C_l, C_h, [dstin] 3: ret +.Lmemcpy: + b memcpy + .size memmove, . - memmove