[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] GCC 4.2.2 - Keith's Latest Progress (or lack thereof)



Hello Vincent,

The problem is that
you use gcc-4.2.2-mint-20080107 (especially libgcc.a)
with binutils < binutils-2.18-mint-20080106 (especially ld)

You fall into the CONSTRUCTORS problem. I saw in your program that a single "Hello, World !" using cout produces 6 global contructors in the final executable (probably produced inside libstdc++). Shame on me, I didn't check that. I thunk that the usage of global constructors was not usual, I was wrong.

So the new rule is:
When you make C++ programs with gcc >= 4.2.2-mint-20080107,
you MUST use binutils >= 2.18-mint-20080106
If you don't do so, your program will crash at startup.

I definitively should display the patch version with --version !

You can make a quick test by using my cross-compiled binutils for MiNT:
http://vincent.riviere.free.fr/soft/m68k-atari-mint/archives/unsupported/binutils-2.18-mint-20080119-bin-mint-20080119.tar.bz2
For the test purpose, you might only use the ld program from that archive.
Your C++ programs will work immediately (after relink !)

Please give me feedback !

The new Binutils worked for me for that test, and the resulting excutable was much smaller (around 60% to 65% of the size of the previous).

Here is the 'transcript'

bash-2.05a# g++ hello.cpp -o hello.tos -Wl,--traditional-format
bash-2.05a# ./hello.tos
Hello Keith!bash-2.05a# g++ -v
Using built-in specs.
Target: m68k-atari-mint
Configured with: ../gcc-4.2.2/configure --target=m68k-atari-mint --host=m68k-atari-mint --enable-languages=c,c++ --disable-nls --disable-libstdcxx-pch --program-suffix=-4.2.2 --disable-bootstrap --build=i686-pc-cygwin
Thread model: single
gcc version 4.2.2
bash-2.05a# ls -l
total 4556
-rw-rw-rw-    1 root     root           91 Jan 22 12:23 hello.cpp
-rwxrwxrwx    1 root     root      1685621 Jan 22 15:58 hello.tos
-rwxrwxrwx    1 root     root      2964211 Jan 22 12:24 hello.tos-old

So, g++ is working natively!! I will test some more items (my tools I had been using, and then move into ScummVM if successful) and let you know how it does.

I don't know if there is much point in sharing the native GCC 4.2.2 build yet? Its a 15 meg tgz right now.

I will also test the build I made natively on the Falcon (versus the build I did in Cygwin) to see if it works as well.

Thanks Vincent!

Keith