This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ -m32 option causes an error


What I am trying to do is to cross-compile to a 32-bit system and get 4-byte longs, 8-byte doubles and 4-byte pointers instead of 8-byte longs, 16-byte doubles and pointers. I have 11 compilers downloaded as part of the standard download from cygwin, with some being duplicates. Some of the compiler names seemed to be cross-compiled to a 32-bit CPU, and in checking this out this guess turns out to be untrue. What I want is the compiler to generate 32-bit code loadable on a 64-bit and a 32-bit platform. This is possible using the 32-bit cygwin compilers.
 
 I am using Netbeans as my development IDE. The compilers used and the results of compilation are given below.
 
 I don't understand why there is not x86_64-pc-cygwin assembler and I don't understand why the builds link to the wrong libraries. I'm going to cross-mail this letter to Netbeans to see if they can give some help.
 
 Sorry about the delay, I've trying to find out what is going on.
 
 art
 
compile command g++ -w   -c -g -MMD -MP -MF 
link command    g++ -o 


gcc.exe                          4.8.1      64-bits
i686-pc-cygwin-gcc.exe           4.8.1      linking w/x86_64-pc-cygwin/4.8.1
i686-pc-cygwin-gcc-4.7.3.exe     4.7.3      linking w/x86_64-pc-cygwin/4.8.1
x86_64-pc-cygwin-gcc.exe         4.8.1      64-bits
x86_64-pc-cygwin-gcc-4.8.1.exe   4.8.1      64-bits

i686-pc-mingw32-gcc.exe          4.7.3      linking w/x86_64-pc-cygwin/4.8.1
i686-pc-mingw32-gcc-4.7.3.exe    4.7.3      linking w/x86_64-pc-cygwin/4.8.1
i686-w64-mingw32-gcc.exe         4.8.1      linking w/x86_64-pc-cygwin/4.8.1
i686-w64-mingw32-gcc-4.8.1.exe   4.8.1      linking w/x86_64-pc-cygwin/4.8.1
x86_64-w64-mingw32-gcc.exe       4.8.1      compiler incompatibilities
x86_64-w64-mingw32-gcc-4.8.1.exe 4.8.1      compiler incompatibilities

Some compiler statistics.
compiler command -v | tr ' ' '\n' | egrep 'build|target|host'

gcc.exe                          build=x86_64-pc-cygwin host=x86_64-pc-cygwin target=x86_64-pc-cygwin
i686-pc-cygwin-gcc.exe           build=x86_64-pc-cygwin host=x86_64-pc-cygwin target=i686-pc-cygwin
i686-pc-cygwin-gcc-4.7.3.exe     build=x86_64-pc-cygwin host=x86_64-pc-cygwin target=i686-pc-cygwin
x86_64-pc-cygwin-gcc.exe         build=x86_64-pc-cygwin host=x86_64-pc-cygwin target=x86_64-pc-cygwin
x86_64-pc-cygwin-gcc-4.8.1.exe   build=x86_64-pc-cygwin host=x86_64-pc-cygwin target=x86_64-pc-cygwin
i686-pc-mingw32-gcc.exe          build=x86_64-pc-cygwin host=x86_64-pc-cygwin target=i686-pc-mingw32
i686-pc-mingw32-gcc-4.7.3.exe    build=x86_64-pc-cygwin host=x86_64-pc-cygwin target=i686-pc-mingw32
i686-w64-mingw32-gcc.exe         build=x86_64-pc-cygwin host=x86_64-pc-cygwin target=i686-w64-mingw32
i686-w64-mingw32-gcc-4.8.1.exe   build=x86_64-pc-cygwin host=x86_64-pc-cygwin target=i686-w64-mingw32
x86_64-w64-mingw32-gcc.exe       build=x86_64-pc-cygwin host=x86_64-pc-cygwin target=x86_64-w64-mingw32
x86_64-w64-mingw32-gcc-4.8.1.exe build=x86_64-pc-cygwin host=x86_64-pc-cygwin target=x86_64-w64-mingw32 

as.exe
i686-pc-cygwin-as.exe
i686-pc-mingw32-as.exe
i686-w64-mingw32-as.exe
x86_64-w64-mingw32-as.exe

 
----- Original Message -----

On 10/18/2013 16:38, Arthur Schwarz wrote:


    No error occurs during compilation with i686-pc-mingw32-g++ (GCC) 4.7.3.


Why are you using both -m32 *and* a cross-compiler? If you're running 64-bit Cygwin and need to make a 32-bit Cygwin program, use the cross-compiler. Passing -m32 to the 32-bit Cygwin compiler shouldn't be necessary.


I wouldn't expect -m32 to work for Cygwin since it's not like other 64-bit *ixes where 32-bit programs are expected to work side-by-side with 64-bit ones. So, while any problem in -m32 handling could doubtless be fixed, there isn't a whole lot of incentive to do it. Cross-compiling fits the two-se

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]