Skip to content

Commit 1936712

Browse files
authored
[AIX] Fix for AIX build break (microsoft#22745)
### 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.
1 parent f16036b commit 1936712

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cmake/onnxruntime.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ else()
123123
onnxruntime_add_shared_library(onnxruntime ${CMAKE_CURRENT_BINARY_DIR}/generated_source.c )
124124
endif()
125125
if(NOT APPLE)
126-
target_link_options(onnxruntime PRIVATE "LINKER:-rpath=\$ORIGIN")
126+
include(CheckLinkerFlag)
127+
check_linker_flag(CXX "LINKER:-rpath=\$ORIGIN" LINKER_SUPPORT_RPATH)
128+
if(LINKER_SUPPORT_RPATH)
129+
target_link_options(onnxruntime PRIVATE "LINKER:-rpath=\$ORIGIN")
130+
endif()
127131
endif()
128132
endif()
129133

cmake/onnxruntime_mlas.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ else()
453453
bool HasP10 = ((hwcap2 & PPC_FEATURE2_MMA) && (hwcap2 & PPC_FEATURE2_ARCH_3_1));
454454
return 0;
455455
}
456-
}
457456
#endif"
458457
HAS_P10_RUNTIME
459458
)

0 commit comments

Comments
 (0)