Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 507226 - dev-libs/tinyxml2 - cmake: x86_64-w64-mingw32-gcc: error: unrecognized command line option ‘-rdynamic’
Summary: dev-libs/tinyxml2 - cmake: x86_64-w64-mingw32-gcc: error: unrecognized comman...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-09 10:56 UTC by J.Borme
Modified: 2021-05-18 23:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description J.Borme 2014-04-09 10:56:05 UTC
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