[Apple ARM architecture] - Golang app crashes when use TensorFlow in M1 Mac (ARM-based).
@joseangel-mm To fix this issue , you need to install the TensorFlow library that is specifically designed for ARM-based Macs. You can download this library from the TensorFlow website.
Please make sure that you are using the latest version of TensorFlow and the latest version of the Golang toolchain. When you build your Golang app, use the` -ldflags="-r -w" `flag to link against the TensorFlow libraries. 
For any further queries could you please post your issue in this [repository](https://github.com/golang/go/issues) or TF [forum](https://discuss.tensorflow.org/) where there is a larger community to get you the right help?
Thank you! This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. Hello @sushreebarsa, thank you for the response.

I will try it. Hello, @joseangel-mm! Is there any update on this issue?
Thank you! > Hello, @joseangel-mm! Is there any update on this issue? Thank you!

Hi @sushreebarsa, not yet sorry. We are busy with other topics 😞. Hi @sushreebarsa, I've been trying your approach with `-ldflags="-r -w"`, but the issue keeps there.
I've run two different commands:
`go build -ldflags="-r -w"`
`go build -ldflags="-r="/usr/local/lib" -w"`

In both of them I get the following error:
<details><summary>Error</summary>
<p>

/usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
Undefined symbols for architecture arm64:
  "_TFE_ContextListDevices", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_ContextListDevices in 000004.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_ContextListDevices)
  "_TFE_ContextOptionsSetAsync", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_ContextOptionsSetAsync in 000004.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_ContextOptionsSetAsync)
  "_TFE_ContextOptionsSetConfig", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_ContextOptionsSetConfig in 000004.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_ContextOptionsSetConfig)
  "_TFE_DeleteContext", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_DeleteContext in 000004.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_DeleteContext, __cgo_aec64e91903f_Cfunc_TFE_DeleteContextOptions )
  "_TFE_DeleteContextOptions", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_DeleteContextOptions in 000004.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_DeleteContextOptions)
  "_TFE_DeleteTensorHandle", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_DeleteTensorHandle in 000013.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_DeleteTensorHandle)
  "_TFE_NewContext", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_NewContext in 000004.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_NewContext, __cgo_aec64e91903f_Cfunc_TFE_NewContextOptions )
  "_TFE_NewContextOptions", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_NewContextOptions in 000004.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_NewContextOptions)
  "_TFE_NewTensorHandle", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_NewTensorHandle in 000013.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_NewTensorHandle)
  "_TFE_TensorHandleBackingDeviceName", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_TensorHandleBackingDeviceName in 000013.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_TensorHandleBackingDeviceName)
  "_TFE_TensorHandleCopyToDevice", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_TensorHandleCopyToDevice in 000013.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_TensorHandleCopyToDevice)
  "_TFE_TensorHandleDataType", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_TensorHandleDataType in 000013.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_TensorHandleDataType)
  "_TFE_TensorHandleDeviceName", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_TensorHandleDeviceName in 000013.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_TensorHandleDeviceName)
  "_TFE_TensorHandleDim", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_TensorHandleDim in 000013.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_TensorHandleDim)
  "_TFE_TensorHandleNumDims", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_TensorHandleNumDims in 000013.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_TensorHandleNumDims)
  "_TFE_TensorHandleResolve", referenced from:
      __cgo_aec64e91903f_Cfunc_TFE_TensorHandleResolve in 000013.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TFE_TensorHandleResolve)
  "_TF_AddControlInput", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_AddControlInput in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_AddControlInput)
  "_TF_AddGradientsWithPrefix", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_AddGradientsWithPrefix in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_AddGradientsWithPrefix)
  "_TF_AddInput", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_AddInput in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_AddInput, __cgo_aec64e91903f_Cfunc_TF_AddInputList )
  "_TF_AddInputList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_AddInputList in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_AddInputList)
  "_TF_AllocateTensor", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_AllocateTensor in 000012.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_AllocateTensor)
  "_TF_CloseSession", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_CloseSession in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_CloseSession)
  "_TF_DeleteBuffer", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeleteBuffer in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeleteBuffer)
  "_TF_DeleteDeviceList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeleteDeviceList in 000004.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeleteDeviceList)
  "_TF_DeleteGraph", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeleteGraph in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeleteGraph)
  "_TF_DeleteImportGraphDefOptions", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeleteImportGraphDefOptions in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeleteImportGraphDefOptions)
  "_TF_DeleteLibraryHandle", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeleteLibraryHandle in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeleteLibraryHandle)
  "_TF_DeletePRunHandle", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeletePRunHandle in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeletePRunHandle)
  "_TF_DeleteSession", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeleteSession in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeleteSession, __cgo_aec64e91903f_Cfunc_TF_DeleteSessionOptions )
  "_TF_DeleteSessionOptions", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeleteSessionOptions in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeleteSessionOptions)
  "_TF_DeleteStatus", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeleteStatus in 000011.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeleteStatus)
  "_TF_DeleteTensor", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeleteTensor in 000012.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeleteTensor)
  "_TF_DeviceListCount", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeviceListCount in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeviceListCount)
  "_TF_DeviceListMemoryBytes", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeviceListMemoryBytes in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeviceListMemoryBytes)
  "_TF_DeviceListName", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeviceListName in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeviceListName)
  "_TF_DeviceListType", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_DeviceListType in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_DeviceListType)
  "_TF_Dim", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_Dim in 000012.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_Dim)
  "_TF_FinishOperation", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_FinishOperation in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_FinishOperation)
  "_TF_GetCode", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_GetCode in 000011.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_GetCode)
  "_TF_GraphGetTensorNumDims", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_GraphGetTensorNumDims in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_GraphGetTensorNumDims)
  "_TF_GraphGetTensorShape", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_GraphGetTensorShape in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_GraphGetTensorShape)
  "_TF_GraphImportGraphDef", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_GraphImportGraphDef in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_GraphImportGraphDef)
  "_TF_GraphNextOperation", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_GraphNextOperation in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_GraphNextOperation)
  "_TF_GraphOperationByName", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_GraphOperationByName in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_GraphOperationByName)
  "_TF_GraphToGraphDef", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_GraphToGraphDef in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_GraphToGraphDef)
  "_TF_ImportGraphDefOptionsAddInputMapping", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_ImportGraphDefOptionsAddInputMapping in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_ImportGraphDefOptionsAddInputMapping)
  "_TF_ImportGraphDefOptionsSetDefaultDevice", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice)
  "_TF_ImportGraphDefOptionsSetPrefix", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_ImportGraphDefOptionsSetPrefix in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_ImportGraphDefOptionsSetPrefix)
  "_TF_LoadLibrary", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_LoadLibrary in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_LoadLibrary)
  "_TF_LoadSessionFromSavedModel", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_LoadSessionFromSavedModel in 000008.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_LoadSessionFromSavedModel)
  "_TF_Message", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_Message in 000011.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_Message)
  "_TF_NewBuffer", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_NewBuffer in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_NewBuffer)
  "_TF_NewGraph", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_NewGraph in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_NewGraph)
  "_TF_NewImportGraphDefOptions", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_NewImportGraphDefOptions in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_NewImportGraphDefOptions)
  "_TF_NewOperation", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_NewOperation in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_NewOperation)
  "_TF_NewSession", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_NewSession in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_NewSession, __cgo_aec64e91903f_Cfunc_TF_NewSessionOptions )
  "_TF_NewSessionOptions", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_NewSessionOptions in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_NewSessionOptions)
  "_TF_NewStatus", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_NewStatus in 000011.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_NewStatus)
  "_TF_NumDims", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_NumDims in 000012.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_NumDims)
  "_TF_OperationDevice", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationDevice in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationDevice)
  "_TF_OperationGetAttrBool", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrBool in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrBoolList, __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrBool )
  "_TF_OperationGetAttrBoolList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrBoolList in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrBoolList)
  "_TF_OperationGetAttrFloat", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrFloat in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrFloat, __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrFloatList )
  "_TF_OperationGetAttrFloatList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrFloatList in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrFloatList)
  "_TF_OperationGetAttrInt", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrInt in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrIntList, __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrInt )
  "_TF_OperationGetAttrIntList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrIntList in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrIntList)
  "_TF_OperationGetAttrMetadata", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrMetadata in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrMetadata)
  "_TF_OperationGetAttrShape", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrShape in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrShape, __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrShapeList )
  "_TF_OperationGetAttrShapeList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrShapeList in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrShapeList)
  "_TF_OperationGetAttrString", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrString in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrStringList, __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrString )
  "_TF_OperationGetAttrStringList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrStringList in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrStringList)
  "_TF_OperationGetAttrTensor", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrTensor in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrTensor, __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrTensorList )
  "_TF_OperationGetAttrTensorList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrTensorList in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrTensorList)
  "_TF_OperationGetAttrType", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrType in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrType, __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrTypeList )
  "_TF_OperationGetAttrTypeList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrTypeList in 000003.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationGetAttrTypeList)
  "_TF_OperationInput", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationInput in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationInput, __cgo_aec64e91903f_Cfunc_TF_OperationInputType )
  "_TF_OperationInputType", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationInputType in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationInputType)
  "_TF_OperationName", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationName in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationName)
  "_TF_OperationNumInputs", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationNumInputs in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationNumInputs)
  "_TF_OperationNumOutputs", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationNumOutputs in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationNumOutputs)
  "_TF_OperationOpType", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationOpType in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationOpType)
  "_TF_OperationOutputConsumers", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationOutputConsumers in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationOutputConsumers)
  "_TF_OperationOutputListLength", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationOutputListLength in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationOutputListLength)
  "_TF_OperationOutputNumConsumers", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationOutputNumConsumers in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationOutputNumConsumers)
  "_TF_OperationOutputType", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_OperationOutputType in 000007.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_OperationOutputType)
  "_TF_SessionListDevices", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SessionListDevices in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SessionListDevices)
  "_TF_SessionPRun", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SessionPRun in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SessionPRunSetup, __cgo_aec64e91903f_Cfunc_TF_SessionPRun )
  "_TF_SessionPRunSetup", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SessionPRunSetup in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SessionPRunSetup)
  "_TF_SessionRun", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SessionRun in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SessionRun)
  "_TF_SetAttrBool", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrBool in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrBoolList, __cgo_aec64e91903f_Cfunc_TF_SetAttrBool )
  "_TF_SetAttrBoolList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrBoolList in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrBoolList)
  "_TF_SetAttrFloat", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrFloat in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrFloatList, __cgo_aec64e91903f_Cfunc_TF_SetAttrFloat )
  "_TF_SetAttrFloatList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrFloatList in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrFloatList)
  "_TF_SetAttrInt", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrInt in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrIntList, __cgo_aec64e91903f_Cfunc_TF_SetAttrInt )
  "_TF_SetAttrIntList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrIntList in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrIntList)
  "_TF_SetAttrShape", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrShape in 000005.o
     (maybe you meant: _TF_SetAttrShapeList_Helper, __cgo_aec64e91903f_Cfunc_TF_SetAttrShapeList , __cgo_aec64e91903f_Cfunc_TF_SetAttrShapeList_Helper , __cgo_aec64e91903f_Cfunc_TF_SetAttrShape )
  "_TF_SetAttrShapeList", referenced from:
      _TF_SetAttrShapeList_Helper in 000005.o
      __cgo_aec64e91903f_Cfunc_TF_SetAttrShapeList in 000005.o
      __cgo_aec64e91903f_Cfunc_TF_SetAttrShapeList_Helper in 000005.o
     (maybe you meant: _TF_SetAttrShapeList_Helper, __cgo_aec64e91903f_Cfunc_TF_SetAttrShapeList , __cgo_aec64e91903f_Cfunc_TF_SetAttrShapeList_Helper )
  "_TF_SetAttrString", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrString in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrString, __cgo_aec64e91903f_Cfunc_TF_SetAttrStringList )
  "_TF_SetAttrStringList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrStringList in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrStringList)
  "_TF_SetAttrTensor", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrTensor in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrTensor, __cgo_aec64e91903f_Cfunc_TF_SetAttrTensorList )
  "_TF_SetAttrTensorList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrTensorList in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrTensorList)
  "_TF_SetAttrType", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrType in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrTypeList, __cgo_aec64e91903f_Cfunc_TF_SetAttrType )
  "_TF_SetAttrTypeList", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetAttrTypeList in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetAttrTypeList)
  "_TF_SetConfig", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetConfig in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetConfig)
  "_TF_SetDevice", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetDevice in 000005.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetDevice)
  "_TF_SetTarget", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_SetTarget in 000009.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_SetTarget)
  "_TF_TensorBitcastFrom", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_TensorBitcastFrom in 000012.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_TensorBitcastFrom)
  "_TF_TensorByteSize", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_TensorByteSize in 000012.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_TensorByteSize)
  "_TF_TensorData", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_TensorData in 000012.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_TensorData)
  "_TF_TensorType", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_TensorType in 000012.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_TensorType)
  "_TF_Version", referenced from:
      __cgo_aec64e91903f_Cfunc_TF_Version in 000014.o
     (maybe you meant: __cgo_aec64e91903f_Cfunc_TF_Version)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

</p>
</details> 


Moreover, I read in some posts that changing `GOOS` env to `ios` instead of `darwin`, could help, but I got the same error.
This is my go env:
<details><summary>Go env</summary>
<p>

GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/martinjo/Library/Caches/go-build'
GOENV='/Users/martinjo/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/martinjo/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='ios'
GOPATH='/Users/martinjo/go'
GOPRIVATE=''
GOPROXY='“https://proxy.golang.org,direct”'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.3'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/martinjo/go/src/yoti/ai-service-on-device/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/fn/btj24j1n5k3cv201gk1dcgvw0000gq/T/go-build4131197003=/tmp/go-build -gno-record-gcc-switches -fno-common'

</p>
</details> 

As a detail, when I have CGO_ENABLED to 0, I have this error instead that is like the code doesn't recognize well the TensorFlow [library](github.com/wamuir/graft/tensorflow):
<details><summary>Alternative error</summary>
<p>

internal/tensor/prepare_tensor.go:13:77: undefined: tf.Tensor
internal/tensor/prepare_tensor.go:20:22: undefined: tf.NewTensor

</p>
</details>  Finally I got TensorFlow working following this [comment](https://gist.github.com/wangjia184/f9ffb2782d0703ef3dbceec9b2bbc4b4?permalink_comment_id=4269188#gistcomment-4269188). 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/62383">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/62383">No</a>

### Issue type

Bug

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

No

### Source

source

### TensorFlow version

2.14.0

### Custom code

Yes

### OS platform and distribution

MacOS Ventura 13.5

### Mobile device

Mac M1 Pro

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

Apple clang version 14.0.0 (clang-1400.0.29.102)

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I've tried to run my Golang app which uses TensorFlow in Mac ARM-based. I've researched, and in a first glance, it seems TensorFlow is not very supported for Golang apps in this kind of Mac.

Moreover, I've seen there are some fixes for Python but not for Golang.

Would it be possible an alternative to using it?

### Standalone code to reproduce the issue

```shell
I've tested the basic test in C, and the result is exactly the same as Golang:

#include <stdio.h>
#include <tensorflow/c/c_api.h>

int main() {
  printf("Hello from TensorFlow C library version %s\n", TF_Version());
  return 0;
}
```


### Relevant log output

```shell
go run main.go 

# command-line-arguments
/usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
ld: warning: ignoring file /usr/local/lib/libtensorflow.so, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 )
Undefined symbols for architecture arm64:
  "_TFE_ContextListDevices", referenced from:
      __cgo_13f1810e087e_Cfunc_TFE_ContextListDevices in 000004.o
     (maybe you meant: __cgo_13f1810e087e_Cfunc_TFE_ContextListDevices)  
...
```
