Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for 32 bit linux builds and gcc 4.9 #291

Merged
merged 3 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ if(MSVC)
option(SENTRY_BUILD_RUNTIMESTATIC "Build sentry-native with static runtime" OFF)
endif()

if(LINUX)
option(SENTRY_BUILD_FORCE32 "Force a 32bit compile on a 64bit host" OFF)
if(SENTRY_BUILD_FORCE32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)
endif()
endif()

# CMAKE_POSITION_INDEPENDENT_CODE must be set BEFORE adding any libraries (including subprojects)
if(SENTRY_PIC)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ stages:
matrix:
Linux (gcc 7, 32-bit):
vmImage: "ubuntu-18.04"
CC: gcc-7 -m32
CXX: g++-7 -m32
CC: gcc-7
CXX: g++-7
TEST_X86: 1
Linux (gcc 9):
vmImage: "ubuntu-latest"
Expand Down
2 changes: 2 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ def cmake(cwd, targets, options=None):
configcmd.append("-D{}={}".format(key, value))
if sys.platform == "win32" and os.environ.get("TEST_X86"):
configcmd.append("-AWin32")
elif sys.platform == "linux" and os.environ.get("TEST_X86"):
configcmd.append("-DSENTRY_BUILD_FORCE32=ON")

cmakelists_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
configcmd.append(cmakelists_dir)
Expand Down
1 change: 1 addition & 0 deletions tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ target_include_directories(sentry_test_unit PRIVATE
target_link_libraries(sentry_test_unit PRIVATE
${SENTRY_LINK_LIBRARIES}
${SENTRY_INTERFACE_LINK_LIBRARIES}
"$<$<PLATFORM_ID:Linux>:rt>"
Swatinem marked this conversation as resolved.
Show resolved Hide resolved
)

if(MINGW)
Expand Down