Skip to content

[MSYS2/Mingw-w64/Clang] duplicate section has different size #439

@Amphaal

Description

@Amphaal

I'm trying to compile the base.zip-like project, but using Clang (via a CMake toolchain file).
Compiling prints a linking warning :

C:/msys64/mingw64/lib/libMagnumGlfwApplication-d.a(GlfwApplication.cpp.obj): duplicate section ".rdata$_ZTSN6Magnum8Platform15GlfwApplicationE[_ZTSN6Magnum8Platform15GlfwApplicationE]" has different size. 

Forcing the usage of LLVM's LLD with -fuse-ld=lld gives me this error :

lld-link: error: duplicate symbol: typeinfo name for Magnum::Platform::GlfwApplication
>>> defined at CMakeFiles/appExec.dir/src/main.cpp.obj
>>> defined at libMagnumGlfwApplication-d.a(GlfwApplication.cpp.obj)

My toolchain file is as simple as :

list(APPEND CMAKE_PREFIX_PATH 
    ${MINGW64_ROOT} 
)
SET(CMAKE_BUILD_TYPE Debug)
SET (CMAKE_C_COMPILER "clang")
SET (CMAKE_CXX_COMPILER "clang++")
SET (CMAKE_C_FLAGS "-fuse-ld=lld")
SET (CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})

I've tried this using the official Magnum MSYS2 package, but also with the latest HEAD (local compilation of Corrade + Magnum). Same issue with both SDL2 and GLFW.

I've had absolutely no issue nor warnings with GNU tho.

Am I doing something wrong here ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions