tfgo Library not loaded: @rpath/libtensorflow.2.dylib in mac M1 (no LC_RPATH's found)
adding more details
```


export CGO_LDFLAGS="-L/usr/local/lib/ -Wl,-rpath,/usr/local/lib/"
go run  -ldflags='-X "xx" -X "xxx"' main.go

# command-line-arguments
ld: warning: duplicate -rpath '/usr/local/lib/' ignored
ld: warning: duplicate -rpath '/usr/local/lib/' ignored
ld: warning: duplicate -rpath '/usr/local/lib/' ignored
dyld[5000]: Symbol not found: __ZN3xla47_DynamicParameterBindingProto_default_instance_E
  Referenced from: <B1880BB8-E3E2-3229-A120-65EFD7CA6548> /usr/local/lib/libtensorflow.so.2
  Expected in:     <6C0A9BF1-5231-3443-AC09-CE2C58D19879> /usr/local/lib/libtensorflow_framework.2.dylib
signal: abort trap

``` @juancresc If you are building tfgo from source, make sure you've configured it for the ARM64 architecture (Apple M1) using the `--config=macos_arm64 `flag. If you are using a pre-built binary, please ensure it's specifically for Apple M1.
Thank you! I am having the same issue with `tf v2.15.0` on `macos_arm64`. A simple [C code](https://www.tensorflow.org/install/lang_c#build)  to display tf version builds and runs fine, however, I get following error when running with Go bindings:

```
dyld[1089]: Library not loaded: @rpath/libtensorflow.2.dylib
  Referenced from: <735FB3A4-830D-31BF-AA59-9D12C6A24D4C> /private/var/folders/jt/nqlsl9n94_d32kp9d544_blc0000gn/T/go-build4047475137/b121/attr.test
  Reason: no LC_RPATH's found
signal: abort trap
``` It seems the issue is only when running `go test`. I was able to build an executable using Go bindings to TF and that runs fine on `macos_arm64` for TF v2.15.0 This is what I did to make it work. 

```
#build with bazel
bazel build -c opt //tensorflow/tools/lib_package:libtensorflow
#replace .h files
sudo cp -R bazel-bin/tensorflow/tools/lib_package/libtensorflow/include/tensorflow/ /usr/local/include/tensorflow
#install with brew
brew install tensorflow && brew link tensorflow # just in case
#use this
export CGO_LDFLAGS="-L/opt/homebrew/opt/tensorflow/lib -Wl,-rpath,/opt/homebrew/opt/tensorflow/lib"
# then you can 
go run main.go
``` @juancresc Could you please confirm if the issue has been resolved?
Thank you! 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/62886">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/62886">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

v2.14.1

### Custom code

Yes

### OS platform and distribution

Apple M1 Pro 14.3

### Mobile device

_No response_

### Python version

3.7

### Bazel version

6.1.0

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

when I run my program that imports tensorflow-go

```
dyld[90744]: Library not loaded: @rpath/libtensorflow.2.dylib
  Referenced from: <CDB4E269-8AC1-3314-9A48-AECF62A45D5B> /private/var/folders/7m/mnymf5ss1mz39ygdshyl69n40000gp/T/go-build3544199075/b001/exe/main
  Reason: no LC_RPATH's found
signal: abort trap

```

### Standalone code to reproduce the issue

```shell
bazel build --config opt //tensorflow/tools/lib_package:libtensorflow  //tensorflow:libtensorflow.so.2 //tensorflow:libtensorflow.so --macos_sdk_version=14.2

sudo cp bazel-bin/tensorflow/libtensorflow*.so /usr/local/lib/
sudo cp -R bazel-bin/tensorflow/tools/lib_package/libtensorflow/include/tensorflow/ /usr/local/include/tensorflow/
sudo tar -C /usr/local/lib -xzf bazel-bin/tensorflow/tools/lib_package/libtensorflow.tar.gz
```


### Relevant log output

_No response_