tensorflow build failed due to '*.so' file dlopen.
currently, i'm using M1 chip with macOS  ventura 13.1 Hi @ysong2123 Thanks for reporting this issue.

Sorry for the late response.

I have tried to reproduce the issue on the same steup but facing  different error. Please refer the screenshot below. Need to try out on [rc2.12](https://github.com/tensorflow/tensorflow/tree/r2.12) version.

<img width="565" alt="Screenshot 2023-02-27 at 8 11 08 PM" src="https://user-images.githubusercontent.com/118897289/221851976-a561c979-2ea3-443f-aa31-eb8d18414e17.png">

Have you tried on [rc2.12](https://github.com/tensorflow/tensorflow/tree/r2.12) version and observed the same issue? Closing as stale. Please reopen if you'd like to work on this further. Thanks!

 Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59769">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59769">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Build/Install

### Have you reproduced the bug with TF nightly?

No

### Source

source

### Tensorflow Version

tag: v2.11.0

### Custom Code

No

### OS Platform and Distribution

MacOS Ventura13

### Mobile device

_No response_

### Python version

3.8

### Bazel version

5.3.0

### GCC/Compiler version

clang 14.0

### CUDA/cuDNN version

none

### GPU model and memory

none

### Current Behaviour?

```shell
ImportError: dlopen(/private/var/tmp/_bazel_username/b326506f60d8e1a7b80e7181271420e8/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/platform/_pywrap_cpu_feature_guard.so, 0x0002): tried: '/private/var/tmp/_bazel_ysong2/b326506f60d8e1a7b80e7181271420e8/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/platform/_pywrap_cpu_feature_guard.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')
```


### Standalone code to reproduce the issue

```shell
bazel build //tensorflow/tools/pip_package:build_pip_package



is there any conifg to control the way of "so" file generation?
```


### Relevant log output

_No response_</details>