Lld-link warning: section name is longer than 8 characters and will use a non-standard string table

I am getting these lld-link warnings with a recent Swift 6.4 Windows toolchain:

C:\sandbox\ktraunmueller\compositor\Sources\Win\Compositor-Win>cmake --build --preset relwithdebinfo
...
[131/150] Building Swift Module 'WindowsFoundation' with 52 sources
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[135/150] Building Swift Module 'CompositorCore' with 299 sources
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[137/150] Building Swift Module 'UWP' with 98 sources
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[139/150] Building Swift Module 'WinAppSDK' with 35 sources
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[141/150] Building Swift Module 'WinUI' with 63 sources
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[143/150] Building Swift Module 'WinInterop' with 5 sources
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[145/150] Building Swift Module 'Win2D' with 28 sources
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[147/150] Building Swift Module 'WinSupport' with 25 sources
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[149/150] Building Swift Module 'Compositor' with 46 sources
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[150/150] Linking Swift executable Compositor.exe
lld-link: warning: section name .debug_abbrev is longer than 8 characters and will use a non-standard string table
lld-link: warning: section name .debug_info is longer than 8 characters and will use a non-standard string table
lld-link: warning: section name .debug_line is longer than 8 characters and will use a non-standard string table
lld-link: warning: section name .debug_loc is longer than 8 characters and will use a non-standard string table
lld-link: warning: section name .debug_names is longer than 8 characters and will use a non-standard string table
lld-link: warning: section name .debug_ranges is longer than 8 characters and will use a non-standard string table
lld-link: warning: section name .debug_str is longer than 8 characters and will use a non-standard string table

Is there any detrimental impact to this, or can I safely ignore these warnings?

This is largely due to debugging. It is a bug in the DWARF standard and we should address this by changing the DWARF standard (@Adrian_Prantl).

I would simply suggest that you switch to CodeView/PDBs which should address the problem.

Thanks - the output is from a relwithdebinfo build, which actually produces a .pdb.

Here's my top-level CMakeLists.txt (slightly redacted), the RelWithDebInfo flags should be the relevant ones here:

cmake_minimum_required(VERSION 3.29)
project(CompositorWin LANGUAGES C CXX RC Swift)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../CMakeModules")

set(CMAKE_Swift_LANGUAGE_VERSION 5)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")

# Debug
set(CMAKE_Swift_FLAGS_DEBUG
    "-DDEBUG -Onone -g -use-ld=lld -diagnostic-style=llvm -Xlinker /DEBUG:FULL -Xlinker -debug:dwarf"
)
set(CMAKE_CXX_FLAGS_DEBUG "-g -Og")
set(CMAKE_C_FLAGS_DEBUG   "-g -Og")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fuse-ld=lld -Wl,/DEBUG:FULL")

# Release
set(CMAKE_Swift_FLAGS_RELEASE
    "-O -whole-module-optimization -use-ld=lld -Xlinker /INCREMENTAL:NO"
)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE   "-O3 -DNDEBUG")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-fuse-ld=lld -Wl,/INCREMENTAL:NO")

# RelWithDebInfo
set(CMAKE_Swift_FLAGS_RELWITHDEBINFO
    "-O -g -whole-module-optimization -use-ld=lld -diagnostic-style=llvm -Xlinker /DEBUG:FULL"
)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-g -O2 -DNDEBUG")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "-fuse-ld=lld -Wl,/DEBUG:FULL,/INCREMENTAL:NO")

# -- Compositor.exe --
file(GLOB_RECURSE COMPOSITOR_SOURCES
    "${CMAKE_CURRENT_SOURCE_DIR}/Sources/*.swift"
)
add_executable(Compositor
    ${COMPOSITOR_SOURCES}
    Resources/App.rc
)
...

target_link_libraries(Compositor PRIVATE
    CompositorCore
    WinSupport
    WinInterop
    CWinRT
    UWP
    Win2D
    WinAppSDK
    WindowsFoundation
    WinUI
)

-g will generate DWARF. You need -g -debug-info-format=codeview IIRC.

1 Like

That got rid of the warnings, thanks Saleem!