Bug #962 4.0.14 compile error on m68040 Debian
Submitted: 30 Jul 2003 16:25 Modified: 26 Aug 2003 2:13
Reporter: Ryan Schmidt Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.0.14 OS:Linux (Debian Linux 3.0)
Assigned to: Lenz Grimmer CPU Architecture:Any

[30 Jul 2003 16:25] Ryan Schmidt
Description:
Last year I set up an elderly Mac as a server. It has been running Apache 1.3.27, PHP 4.3.1, and 
MySQL 3.23.52 without problems. I am now trying to upgrade to MySQL 4.0.14 and cannot get 
through the compilation.

The exact hardware is: Mac Quadra 630 (Apple's business machine from 1994), 33 MHz Motorola 
68040 processor (with integrated FPU), 36 MB RAM, 6 GB HD (65% free)

The operating system is Debian Linux, the only Unix-like operating system that works on this 
hardware, to the best of my research and knowledge. Debian has a nice package manager but I 
have been largely unable to make use of it because (understandably) nobody pre-compiles 
binaries for m68k anymore. But I don't mind compiling things myself from source, and have had 
little trouble doing so thus far. Apache and PHP have compiled without errors for several versions, 
and MySQL 3.23.52 also compiled and installed just fine, with InnoDB added in. MySQL 4.0.14 is 
giving me trouble though, seemingly regardless of ./configure setting. (I've tried 4 variants, 
described below.) The output, after 5 hours of deep though, is always this:

item_sum.cc: In method `void Item_sum_hybrid::min_max_update_int_field(int)':
item_sum.cc:764: Internal compiler error:
item_sum.cc:764: internal error--unrecognizable insn:
(insn 327 115 117 (set (reg/v:QI 0 %d0)
        (gt:QI (reg/v:DI 3 %d3)
            (reg/v:DI 1 %d1))) -1 (nil)
    (nil))

Here's some output from the 3.23.52 version of mysqlbug (since I can't yet get the 4.0.14 version 
compiled):

System: Linux quadra 2.2.20 #1 Mon Nov 26 09:26:36 GMT 2001 m68k unknown
Architecture: m68k

Some paths:  /usr/local/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/m68k-linux/2.95.4/specs
gcc version 2.95.4 20011002 (Debian prerelease)
Compilation info: CC='gcc'  CFLAGS=''  CXX='g++'  CXXFLAGS=''  LDFLAGS=''
LIBC:
lrwxrwxrwx    1 root     root           13 Nov 20  2002 /lib/libc.so.6 -> libc-2.2.5.so
-rwxr-xr-x    1 root     root       952156 Sep 18  2002 /lib/libc-2.2.5.so
-rw-r--r--    1 root     root      2230110 Sep 18  2002 /usr/lib/libc.a
-rw-r--r--    1 root     root          178 Sep 18  2002 /usr/lib/libc.so
-rw-r--r--    1 root     root       673924 Jan 15  2002 /usr/lib/libc-client.so.2001
Configure command: ./configure --prefix=/usr/local/mysql --with-innodb

How to repeat:
Based on recommendations in the MySQL manual, both the section on compiling and the one on 
how the pre-built binaries were compiled, I tried four different sets of ./configure parameters, but 
the result was the same in each case. Here's what I tried:

CFLAGS="-O3 -m68040" CXX=gcc CXXFLAGS="-O3 -m68040 -felide-constructors -fno-
exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-local-infile --without-
debug

./configure --prefix=/usr/local/mysql

./configure --prefix=/usr/local/mysql --with-low-memory 

CFLAGS="-O3 -m68040" CXX=gcc CXXFLAGS="-O3 -m68040 -felide-constructors -fno-
exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --
enable-local-infile --with-low-memory --without-debug --enable-assembler --enable-thread-
safe-client --disable-shared --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static

In all 4 cases, the ./configure runs for about ten minutes and reports no errors. There are two 
warnings but I don't understand them and they don't seem relevant. I then run...

nohup make &

...and 5 hours later I get this at the end of the nohup.out file:

source='item.cc' object='item.o' libtool=no \
depfile='.deps/item.Po' tmpdepfile='.deps/item.TPo' \
depmode=gcc /bin/sh ../depcomp \
gcc -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr/local/mysql\"" -DDATADIR="\"/usr/
local/mysql/var\"" -DSHAREDIR="\"/usr/local/mysql/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. 
-I../innobase/include -I./../include -I./../regex -I. -I../include -I.     -O3 -DDBUG_OFF -O3 -
m68040 -felide-constructors -fno-exceptions -fno-rtti  -fno-implicit-templates -fno-exceptions 
-fno-rtti -c -o item.o `test -f item.cc || echo './'`item.cc
source='item_sum.cc' object='item_sum.o' libtool=no \
depfile='.deps/item_sum.Po' tmpdepfile='.deps/item_sum.TPo' \
depmode=gcc /bin/sh ../depcomp \
gcc -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr/local/mysql\"" -DDATADIR="\"/usr/
local/mysql/var\"" -DSHAREDIR="\"/usr/local/mysql/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. 
-I../innobase/include -I./../include -I./../regex -I. -I../include -I.     -O3 -DDBUG_OFF -O3 -
m68040 -felide-constructors -fno-exceptions -fno-rtti  -fno-implicit-templates -fno-exceptions 
-fno-rtti -c -o item_sum.o `test -f item_sum.cc || echo './'`item_sum.cc
item_sum.cc: In method `void Item_sum_hybrid::min_max_update_int_field(int)':
item_sum.cc:764: Internal compiler error:
item_sum.cc:764: internal error--unrecognizable insn:
(insn 327 115 117 (set (reg/v:QI 0 %d0)
        (gt:QI (reg/v:DI 3 %d3)
            (reg/v:DI 1 %d1))) -1 (nil)
    (nil))
make[4]: *** [item_sum.o] Error 1
make[4]: Leaving directory `/usr/src/mysql-4.0.14/sql'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/src/mysql-4.0.14/sql'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/mysql-4.0.14/sql'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/mysql-4.0.14'
make: *** [all] Error 2

Suggested fix:
Unknown
[1 Aug 2003 3:27] Lenz Grimmer
Thank you for reporting this!

I am sorry, but I fear we can't help you much here. MySQL 4.0 compiles fine on 
many other platforms with gcc and several other compilers. It's hard to track 
down this problem without actually having access to such a system.

Are you sure the compiler is not simply running out of memory here?
What are the exact compile and configure flags you are using?
Have you tried using "./configure --with-low-memory"?
[1 Aug 2003 4:52] Ryan Schmidt
I am rarely sure about things in the Linux world, so it could be that the compiler is running out of 
memory. I'm not sure how I would determine if that is the case. However I did try --with-low-
memory and it did not change the error message.

My exact compile and configure flags were submitted in my original bug report. I tried four 
different configure strings in various combinations of optimization and low-memory flags; the 
error message was always the same.

I can provide you with ssh access to my computer, but it will take me a moment to ensure that 
permissions on sensitive files are set appropriately. Please let me know if this would be of help to 
you.
[26 Aug 2003 2:13] Lenz Grimmer
Some more comments/hints from our developers in addition to our private mail exchange:

 - you seem to use a pre-release compiler. Would it be possible for you to
   try to downgrade to gcc 2.95.3 and see if this makes a difference?
 - Try to compile with a lower optimization level (e.g. -O instead of -O3)
   by setting CFLAGS="-O" CXXFLAGS="-O".
 - Alternatively, just try to manually compile the offending file with -O
   instead.

But we still suspect a true gcc bug here (which probably only manifests on m86k)
- we're able to compile MySQL with gcc on many platforms without running into 
ICEs.