dep-protobuf/build_defs
Son Luong Ngoc 5233990ad7 Fix protoc_nowkt linking on MacOS (#12320)
Depending on how the local cc toolchain is setup on macos, the core
foundation framework might not be available while linking protoc_nowkt.

This results in a few _CF symbols being interpreted as dynamic load and
is set to the binary's flat-namespace, causing runtime errors during
susequent actions such as gen_wkt_cc_sources.

```bash
> otool -dyld_info bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/protoc_nowkt | grep '_CF'
__DATA_CONST __got         0x10035C038 0x8010000000000007 bind   0x0      flat-namespace _CFRelease
__DATA_CONST __got         0x10035C040 0x8010000000000008 bind   0x0      flat-namespace _CFStringGetCString
__DATA_CONST __got         0x10035C048 0x8010000000000009 bind   0x0      flat-namespace _CFStringGetLength
__DATA_CONST __got         0x10035C050 0x801000000000000A bind   0x0      flat-namespace _CFStringGetMaximumSizeForEncoding
__DATA_CONST __got         0x10035C058 0x801000000000000B bind   0x0      flat-namespace _CFTimeZoneCopyDefault
__DATA_CONST __got         0x10035C060 0x801000000000000C bind   0x0      flat-namespace _CFTimeZoneGetName
```

Tell the linker to use CoreFoundation framework explicitly fixes this
issue.

```bash
> otool -dyld_info bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/src/google/protobuf/compiler/protoc_nowkt | grep '_CF'
__DATA_CONST __got         0x10035C038 0x8010000000000007 bind   0x0      CoreFoundation _CFRelease
__DATA_CONST __got         0x10035C040 0x8010000000000008 bind   0x0      CoreFoundation _CFStringGetCString
__DATA_CONST __got         0x10035C048 0x8010000000000009 bind   0x0      CoreFoundation _CFStringGetLength
__DATA_CONST __got         0x10035C050 0x801000000000000A bind   0x0      CoreFoundation _CFStringGetMaximumSizeForEncoding
__DATA_CONST __got         0x10035C058 0x801000000000000B bind   0x0      CoreFoundation _CFTimeZoneCopyDefault
__DATA_CONST __got         0x10035C060 0x801000000000000C bind   0x0      CoreFoundation _CFTimeZoneGetName
```

closes #12173

Closes #12320

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12320 from sluongng:main 1416168f12
PiperOrigin-RevId: 526830008
2023-04-24 20:18:30 -07:00
..
arch_tests.bzl Clean up aarch64 tests. 2022-12-14 21:52:35 -08:00
BUILD.bazel Merge 22.x back to main (#12169) 2023-03-08 15:38:14 -08:00
cc_proto_blacklist_test.bzl [Bazel] Move C++ build-related logic into //build_defs (#9921) 2022-05-06 12:11:46 -07:00
compiler_config_setting.bzl [Bazel] Move C++ build-related logic into //build_defs (#9921) 2022-05-06 12:11:46 -07:00
cpp_opts.bzl Fix protoc_nowkt linking on MacOS (#12320) 2023-04-24 20:18:30 -07:00
internal_shell.bzl Clean up aarch64 tests. 2022-12-14 21:52:35 -08:00
java_opts.bzl Re-attach OSGI headers to lite,core, and util. This information was dropped in the move from maven to bazel. 2023-03-21 07:35:58 -07:00
upb.patch Bump upb version 2023-03-20 08:15:28 -07:00