I prepared a toolchain to cross-compile for mingw using the command: crossdev --ov-output /usr/local/portage mingw64 (I could cross-emerge several packages with it). Cross-compiling tinyxml2 however stops in the configure step with the following error: -- Check for working C compiler: /usr/bin/x86_64-w64-mingw32-gcc -- broken x86_64-w64-mingw32-gcc: erreur: unrecognized command line option ‘-rdynamic’ -rdynamic has to be removed for mingw. I'm just beginning with cmake, but I think this option is removed by cmake when it has CMAKE_SYSTEM_NAME="Windows" (or "generic"). The cmake command-line for gentoo is complex… After a failed build, if I go to: /usr/x86_64-w64-mingw32/tmp/portage/dev-libs/tinyxml2-2.0.2/work/tinyxml2-2.0.2_build and then add a personal toolchain file on the command-line with the option: -DCMAKE_TOOLCHAIN_FILE=/tmp/Toolchain_gentoo_crossdev_mingw.cmake (I found out the option has to appear before -DCMAKE_USER_MAKE_RULES_OVERRIDE), then cmake correctly configures and builds tinyxml2 using the cross-compiler. Full configure command is then: cmake -C /usr/x86_64-w64-mingw32/tmp/portage/dev-libs/tinyxml2-2.0.2/work/tinyxml2-2.0.2_build/gentoo_common_config.cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_STATIC_LIBS=ON -DBUILD_TEST=OFF -DCMAKE_INSTALL_DO_STRIP=OFF -DCMAKE_TOOLCHAIN_FILE=/tmp/Toolchain_gentoo_crossdev_mingw.cmake -DCMAKE_USER_MAKE_RULES_OVERRIDE=/usr/x86_64-w64-mingw32/tmp/portage/dev-libs/tinyxml2-2.0.2/work/tinyxml2-2.0.2_build/gentoo_rules.cmake /usr/x86_64-w64-mingw32/tmp/portage/dev-libs/tinyxml2-2.0.2/work/tinyxml2-2.0.2 Contents of my personal toolchain file is cat /tmp/Toolchain_gentoo_crossdev_mingw.cmake set (CMAKE_SYSTEM_NAME Windows) set (CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) set (CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) Then one would need to integrate the correct options within the ebuild or crossdev itself, and I don't know how to do that. Reproducible: Always Steps to Reproduce: 1. crossdev --ov-output /usr/local/portage mingw64 2. add arch="amd64" to the file /usr/portage/profiles/embedded/make.defaults 3. emerge-x86_64-w64-mingw32 tinyxml2
Obsolete with https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dab0c933c1c8cb795ccc0b406c49bbf6f2f45f1a (meson)?