Skip to content

Commit a606907

Browse files
charlie-htpgorszkowski-igalia
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 ce6e581 commit a606907

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
@@ -454,7 +454,13 @@ include(GStreamerChecks)
454454

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

0 commit comments

Comments
 (0)