Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 159144 - crossdev - mingw32, asprintf problem
Summary: crossdev - mingw32, asprintf problem
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-26 09:09 UTC by Adrian Smarzewski
Modified: 2009-08-29 21:09 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 Adrian Smarzewski 2006-12-26 09:09:24 UTC
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.
Comment 1 SpanKY gentoo-dev 2006-12-26 13:41:24 UTC
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
Comment 2 Alan Hourihane 2009-07-15 10:50:47 UTC
We still don't seem to build liberty the the latest crossdev.

Is there a solution to this on Gentoo ?
Comment 3 Alan Hourihane 2009-07-15 12:15:05 UTC
Mmm, actually libiberty is installed. Just not finding it....
Comment 4 Alan Hourihane 2009-07-15 12:16:55 UTC
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 ?
Comment 5 SpanKY gentoo-dev 2009-08-27 10:10:35 UTC
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.
Comment 6 Alan Hourihane 2009-08-27 10:21:38 UTC
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.
Comment 7 SpanKY gentoo-dev 2009-08-27 10:47:35 UTC
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 ...
Comment 8 Adrian Smarzewski 2009-08-28 09:52:47 UTC
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.
Comment 9 SpanKY gentoo-dev 2009-08-29 21:09:04 UTC
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.