Skip to content

Commit 475c36c

Browse files
charlie-htmagomez
authored andcommitted
Condition section anchoring to ARM/ARM64 platforms
Needed for building on a X86-64 desktop, where the linker complains about this option a lot.
1 parent 3ba9707 commit 475c36c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Source/cmake/OptionsWPE.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,13 @@ include(GStreamerChecks)
476476

477477
# Optimize binary size for release builds by removing dead sections on unix/gcc.
478478
if (COMPILER_IS_GCC_OR_CLANG AND UNIX AND NOT APPLE)
479-
if (CMAKE_COMPILER_IS_GNUCC)
479+
# Conditioned on ARM/ARM64 since those are the targets we know support section
480+
# anchoring, for builds on X86 and X86-64 target, this option is not supported.
481+
# It may be supported on several others aside from ARM*.
482+
# The GCC documentation is poor in that it says the option is target dependent,
483+
# but fails to decribe on which targets it is supported. I didn't fancy reading
484+
# the source to find out.
485+
if (CMAKE_COMPILER_IS_GNUCC AND (WTF_CPU_ARM64 OR WTF_CPU_ARM))
480486
set(CMAKE_COMPILER_SIZE_OPT_FLAGS " -finline-limit=90 -fsection-anchors")
481487
endif ()
482488
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${CMAKE_COMPILER_SIZE_OPT_FLAGS} -ffunction-sections -fdata-sections")

0 commit comments

Comments
 (0)