Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mattias Ellert
CMake
Commits
958f858a
Commit
958f858a
authored
5 years ago
by
Alexander Grund
Committed by
Brad King
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Check for support before adding bigtoc linker flag
Fixes:
#20076
parent
8c7b7df7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CompileFlags.cmake
+10
-2
10 additions, 2 deletions
CompileFlags.cmake
Source/Modules/CheckCXXLinkerFlag.cmake
+29
-0
29 additions, 0 deletions
Source/Modules/CheckCXXLinkerFlag.cmake
with
39 additions
and
2 deletions
CompileFlags.cmake
+
10
−
2
View file @
958f858a
...
...
@@ -54,12 +54,20 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc")
endif
()
# Workaround for TOC Overflow on ppc64
set
(
bigTocFlag
""
)
if
(
CMAKE_SYSTEM_NAME STREQUAL
"AIX"
AND
CMAKE_SYSTEM_PROCESSOR MATCHES
"powerpc"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
-Wl,-bbigtoc"
)
set
(
bigTocFlag
"
-Wl,-bbigtoc"
)
elseif
(
CMAKE_SYSTEM_NAME STREQUAL
"Linux"
AND
CMAKE_SYSTEM_PROCESSOR MATCHES
"ppc64"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
-Wl,--no-multi-toc"
)
set
(
bigTocFlag
"-Wl,--no-multi-toc"
)
endif
()
if
(
bigTocFlag
)
include
(
CheckCXXLinkerFlag
)
check_cxx_linker_flag
(
${
bigTocFlag
}
BIG_TOC_FLAG_SUPPORTED
)
if
(
BIG_TOC_FLAG_SUPPORTED
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
${
bigTocFlag
}
"
)
endif
()
endif
()
if
(
CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND
...
...
This diff is collapsed.
Click to expand it.
Source/Modules/CheckCXXLinkerFlag.cmake
0 → 100644
+
29
−
0
View file @
958f858a
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
include_guard
(
GLOBAL
)
include
(
CheckCXXSourceCompiles
)
include
(
CMakeCheckCompilerFlagCommonPatterns
)
function
(
check_cxx_linker_flag _flag _var
)
if
(
CMAKE_VERSION VERSION_LESS
"3.14"
)
set
(
CMAKE_REQUIRED_LIBRARIES
"
${
_flag
}
"
)
else
()
set
(
CMAKE_REQUIRED_LINK_OPTIONS
"
${
_flag
}
"
)
endif
()
# Normalize locale during test compilation.
set
(
_locale_vars LC_ALL LC_MESSAGES LANG
)
foreach
(
v IN LISTS _locale_vars
)
set
(
_locale_vars_saved_
${
v
}
"$ENV{
${
v
}
}"
)
set
(
ENV{
${
v
}
} C
)
endforeach
()
check_compiler_flag_common_patterns
(
_common_patterns
)
check_cxx_source_compiles
(
"int main() { return 0; }"
${
_var
}
${
_common_patterns
}
)
foreach
(
v IN LISTS _locale_vars
)
set
(
ENV{
${
v
}
}
${
_locale_vars_saved_
${
v
}}
)
endforeach
()
set
(
${
_var
}
"
${${
_var
}}
"
PARENT_SCOPE
)
endfunction
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment