dist: fix mlnx driver compile error on oc9

When building kernel rpm on oc9, will have error as below:
cc1: error: code model kernel does not support PIC mode
OFED_topdir/BUILD/mlnx-ofa_kernel-23.10/obj/default/compat/main.o] Error 1

Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
Reviewed-by: Yongliang Gao <leonylgao@tencent.com>
This commit is contained in:
Jianping Liu 2024-08-26 19:26:46 +08:00
parent 63e2660c48
commit 4d78ab6896
1 changed files with 1 additions and 1 deletions

View File

@ -1215,7 +1215,7 @@ BuildInstMLNXOFED() {
# We need to jump the root privilege because we'll assign a normal tmpdir
sed -i 's/$UID -ne 0/! -z $JUMP_ROOT/g' mlnx_add_kernel_support.sh
if [ "${DISTRO}" == "tl4" ]; then
if [ "${DISTRO}" != "tl3" ]; then
sed -i '/# Check for needed packages by install.pl/a sed -i "s/rpmbuild --rebuild/rpmbuild --define '\''rhel 9'\'' --define '\''_lto_cflags -fno-lto'\'' --define '\''_hardened_cflags -fPIE'\'' --rebuild/g" ${ofed}/install.pl' mlnx_add_kernel_support.sh
fi
sed -i 's/\(ex ${ofed}\/install\.pl\)/\1 --without-mlnx-nvme/g' mlnx_add_kernel_support.sh