Skip to content

Commit

Permalink
[AIX] Fix for AIX build break (#22745)
Browse files Browse the repository at this point in the history
### Description
With recent changes, below build error is found under AIX. 

```
ld: 0706-012 The -p flag is not recognized.
ld: 0706-012 The -a flag is not recognized.
ld: 0706-012 The -t flag is not recognized.
ld: 0706-012 The -h flag is not recognized.
ld: 0706-012 The -= flag is not recognized.
ld: 0706-012 The -$ flag is not recognized.
ld: 0706-012 The -$ flag is not recognized.
ld: 0706-012 The -O flag is not recognized.
ld: 0706-027 The -R IGIN flag is ignored.

collect2: error: ld returned 255 exit status
```

### Motivation and Context
AIX linker doesn't support -rpath option , so blocking this option under
AIX.
  • Loading branch information
ranjitshs authored Nov 7, 2024
1 parent f16036b commit 1936712
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmake/onnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ else()
onnxruntime_add_shared_library(onnxruntime ${CMAKE_CURRENT_BINARY_DIR}/generated_source.c )
endif()
if(NOT APPLE)
target_link_options(onnxruntime PRIVATE "LINKER:-rpath=\$ORIGIN")
include(CheckLinkerFlag)
check_linker_flag(CXX "LINKER:-rpath=\$ORIGIN" LINKER_SUPPORT_RPATH)
if(LINKER_SUPPORT_RPATH)
target_link_options(onnxruntime PRIVATE "LINKER:-rpath=\$ORIGIN")
endif()
endif()
endif()

Expand Down
1 change: 0 additions & 1 deletion cmake/onnxruntime_mlas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ else()
bool HasP10 = ((hwcap2 & PPC_FEATURE2_MMA) && (hwcap2 & PPC_FEATURE2_ARCH_3_1));
return 0;
}
}
#endif"
HAS_P10_RUNTIME
)
Expand Down

0 comments on commit 1936712

Please sign in to comment.