-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[compiler-rt] Fix building on OpenBSD/amd64 #165086
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,7 +213,7 @@ macro(test_targets) | |
| if(COMPILER_RT_DEFAULT_TARGET_ONLY) | ||
| add_default_target_arch(${COMPILER_RT_DEFAULT_TARGET_ARCH}) | ||
| elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "i[2-6]86|x86|amd64") | ||
| if(NOT MSVC) | ||
| if(NOT MSVC AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD") | ||
| test_target_arch(x86_64 "" "-m64") | ||
| test_target_arch(i386 __i386__ "-m32") | ||
| else() | ||
|
|
@@ -234,13 +234,29 @@ macro(test_targets) | |
| elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc64le|ppc64le") | ||
| test_target_arch(powerpc64le "" "-m64") | ||
| elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc") | ||
| test_target_arch(powerpc "" "-m32") | ||
| test_target_arch(powerpc64 "" "-m64") | ||
| if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these needed, my assumption is that test_target_arch should be handling this automatically? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (edit: I had misremembered the x86 path when I wrote the original comment) |
||
| test_target_arch(powerpc "" "-m32") | ||
| test_target_arch(powerpc64 "" "-m64") | ||
| else() | ||
| if (CMAKE_SIZEOF_VOID_P EQUAL 4) | ||
| test_target_arch(powerpc "" "-m32") | ||
| else() | ||
| test_target_arch(powerpc64 "" "-m64") | ||
| endif() | ||
| endif() | ||
| elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "s390x") | ||
| test_target_arch(s390x "" "") | ||
| elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "sparc") | ||
| test_target_arch(sparc "" "-m32") | ||
| test_target_arch(sparcv9 "" "-m64") | ||
| if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
| test_target_arch(sparc "" "-m32") | ||
| test_target_arch(sparcv9 "" "-m64") | ||
| else() | ||
| if (CMAKE_SIZEOF_VOID_P EQUAL 4) | ||
| test_target_arch(sparc "" "-m32") | ||
| else() | ||
| test_target_arch(sparcv9 "" "-m64") | ||
| endif() | ||
| endif() | ||
| elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mips") | ||
| CHECK_SYMBOL_EXISTS (_MIPS_ARCH_MIPS32R6 "" COMPILER_RT_MIPS32R6) | ||
| CHECK_SYMBOL_EXISTS (_MIPS_ARCH_MIPS64R6 "" COMPILER_RT_MIPS64R6) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this OpenBSD specific, or BSD in general and simply hasn't been hit on them yet?
If is OpenBSD specific is there a central config file that is included in all the cmake scripts where you could add something like
Then
OPENBSDandNOT OPENBSDbecome available and the script would read better.Or maybe
OPEN_BSDif that seems more appropriate.I have the existence check because it seems possible that cmake might add a builtin like this in the future?