Add fabi-version=11 to ensure compatibility between gcc7 and gcc9 binaries for _GLIBCXX_USE_CXX11_ABI=1 (#93835)

Fixes #https://github.com/pytorch/pytorch/pull/92550

Pull Request resolved: https://github.com/pytorch/pytorch/pull/93835
Approved by: https://github.com/malfet
This commit is contained in:
zhuhong61
2023-02-07 03:05:37 +00:00
committed by PyTorch MergeBot
parent ca74105377
commit b562be793a

View File

@ -44,11 +44,10 @@ if(DEFINED GLIBCXX_USE_CXX11_ABI)
if(${GLIBCXX_USE_CXX11_ABI} EQUAL 1)
set(CXX_STANDARD_REQUIRED ON)
string(APPEND CMAKE_CXX_FLAGS " -D_GLIBCXX_USE_CXX11_ABI=1")
else()
# Please note this is required in order to ensure compatibility between gcc 9 and gcc 7
# This could be removed when all Linux PyTorch binary builds are compiled by the same toolchain again
string(APPEND CMAKE_CXX_FLAGS " -fabi-version=11")
endif()
# Please note this is required in order to ensure compatibility between gcc 9 and gcc 7
# This could be removed when all Linux PyTorch binary builds are compiled by the same toolchain again
string(APPEND CMAKE_CXX_FLAGS " -fabi-version=11")
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)