I have problems compiling code that uses asprintf using crossdev - mingw32 environment. Under xmingw it works when -liberty linker flag was added. Now under crossdev - mingw32 it dosn't work. It is very important to fix it, because xmingw has been removed from portage and new environment that should replaced it is useless for some applications.
currently we do not build binutil libs for use on the target the old xmingw ebuilds did not do this either: $ /opt/xmingw/bin/i386-mingw32msvc-gcc test.c -liberty cannot find -liberty collect2: ld returned 1 exit status
We still don't seem to build liberty the the latest crossdev. Is there a solution to this on Gentoo ?
Mmm, actually libiberty is installed. Just not finding it....
running mingw32-ld --verbose shows this .... GNU ld (GNU Binutils) 2.19.1 Supported emulations: i386pe using internal linker script: ================================================== /* Default linker script, for normal executables */ OUTPUT_FORMAT(pei-i386) SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); and so the SEARCH_DIR doesn't look right to find things. All I did to install was... crossdev -t mingw32 Should I have passed additional flags ?
you're confusing libraries. the ones included with the cross-binutils are not native to the mingw target. if you want native binutils libs, you'll have to build them yourself like any other package.
Bizarre. Because if I add... -L/usr/lib/binutils/mingw32/2.19.1 to my compiler flags it works and finds libiberty.a and links successfully. Not to worry.
you really havent tested it. like i said, those libraries are not native to mingw. they're in ELF format, not PE. so unless you have some magic version of windows that executes ELF objects ...
I did not analyze this problem again, just read new comments... Two years ago, when I reported this bug, crossdev was a new feature, poorly documented (official documentation, faqs, forum threads etc). It is possible that currently these bug reports looks like a nonsense, but a lot have changed probably. I think it would be a good idea to add a link to some crossdev documentation or faq in these bug reports (if you have any). I suppose that there are a lot of people that for example cannot understand easily that a library located in /usr/lib/binutils/mingw32 directory is not native to mingw and they will reopen this issue.
none of this has to do with crossdev. libiberty (nor any other library from binutils) is special. if you want a library native to the target, you must emerge it like any other package.