1

I am trying to organize a little 64-bit gnu environment on my Windows PC. I have built 64-bit mingw environment, and went on to build libraries i needed next.

When building libiconv, i have tried following this instruction, which amounted to configuring with supplying --host parameter to configuration cipt. However, build failed with following error:

c:/mingw_mine/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-min gw32/bin/ld.exe: i386 architecture of input file `.libs/libiconv.res.o' is incom patible with i386:x86-64 output

What went wrong?

Some necessary details: i use precompiled 32-bit msys for shell. It includes number of programs, make, install and gcc included. To avoid using wrong gcc, i have first added necessary paths to PATH, C_INCLUDE_PATH and CPLUS_INCLUDE_PATH, then performed configuration with:

$ ../src/configure --prefix=/c/temp/gcc/dest --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 CPPFLAGS="-Wall -I/c/mingw_mine/include" LDFLAGS="-L/c/mingw_mine/lib"

As far as i could tell, configuration script detected compiler i wanted correctly; all in all configuration went through without a problem. Where did i386 binaries came from? Even if configuration detected architecture with uname (/bin/uname in 32-bit msys), why would it matter if the host is defined explicitely?

2
  • I have so many problems with mingw latest years, that finally I changed back to cygwin64. Against mingw it has a unique, standard and working 64-bit version, while the to me important advantage of the mingw (the absence of the /cygdrive .. directories) are from the mingw also long gone.
    – peterh
    Sep 9, 2015 at 11:55
  • i only have problems with building some things so far. What else should i expect? P.S. Oh, and make does not work
    – Srv19
    Sep 9, 2015 at 13:46

1 Answer 1

0

After investigation, i haveresolved the issue. Step-by-step it goes:

  1. I was getting wrong binaries as output of the windres program. Checking with which gave me /bin/windres, that is, one from 32-bit msys environment.
  2. i have compiled bintools for 64-bit mingw, so i did have 64-bit windres in /mingw/bin folder. However, it was not used in the build process.
  3. After checking how configuration process went, i have noticed lines like

checking for x86_64-w64-mingw32-windres.... no

checking for windres.... windres

  1. I have created and put into /mingw folder of msys environment file named x86_64-w64-mingw32-windres with following contents:

    #!/bin/sh script="$0" basename="$(dirname $script)" $basename/windres "$@"

After reconfiguration, build went through smoothly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .