Have tried compiling 3.23.51 with gcc 2.95.2 on both solaris x86
2.7 and
solaris sparc 2.7. on both systems configure is fine (using
both my own
configuration and that recommended in your README for solaris
2.7) but
when compiling sql_lex.cc compilation fails when attempting to
implement the inline function get_hash_symbol().
specifically:
sql_lex.cc: In function `int find_keyword(LEX *, unsigned int,
bool)':
sql_lex.cc:168: implicit declaration of function `int
get_hash_symbol(...)'
sql_lex.cc:168: initialization to `SYMBOL *' from `int' lacks a
cast
Further investigation shows that get_hash_symbol() is an inline
function that appears to be 'generated' dynamically during
configuration from file gen_lex_hash.cc. (Interesting
technique).
This is a clear demonstration of a confused compiler. I thought
adding
a prototype for the function get_hash_symbol() might help:
Adding the prototype ahead of the function find_keyword() in
sql_lex.cc as follows:
SYMBOL *get_hash_symbol(const char*tok,uint len,bool
function);
allows compile to continue (now that the compiler understands
what
the function is supposed to be passing/returning). HOWEVER it
fails at
link time, of course, because there is no function
get_hash_symbol()
defined in any of the searched libraries.
My ./configure options are as follows:
2.7 x86:
CC=gcc CFLAGS="-O3 -fomit-frame-pointer -DHAVE_CURSES_H"
\
CXX=gcc \
CXXFLAGS="-O3 -fomit-frame-pointer
-felide-constructors \
-fno-exceptions -fno-rtti -DHAVE_CURSES_H" \
./configure --prefix=/usr/local/mysql
2.7 sparc:
CC=gcc CFLAGS="-O3" \
CXX=gcc CXXFLAGS="-O3 -felide-constructors \
-fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql \
--with-low-memory --enable-assembler
Should I go ahead and code the function get_hash_symbol() inline
based on your clever printf example in gen_lex_hash.cc?? I am
so
Should I go ahead and code the function get_hash_symbol() inline
based on your clever printf example in gen_lex_hash.cc?? I am
so
impressed by your database engine and am afraid to implement
this
Should I go ahead and code the function get_hash_symbol() inline
based on your clever printf example in gen_lex_hash.cc?? I am
so
impressed by your database engine and am afraid to implement
this
function myself without your thoughts as it might jeopardize the
integrity of your application.
Bottom line, what am I doing wrong. :)
Humbly in awe,
Dave
>How-To-Repeat:
compile with gcc 2.95.2 on either sun solaris 2.7 x86 or sparc.
>Fix:
not sure, I suspect I am not including a library that is missed
in ./configure or I need to code the function inline myself or
something-- guessing at this point, desperately need a solution.
>Submitter-Id: <submitter ID>
>Originator: LC
>Organization:
>MySQL support: [none]
>Synopsis: I am making some kind if idiotic mistake.
>Severity: serious
>Priority: medium
>Category: mysql
>Class: sw-bug
>Release: mysql-3.23.51 (Source distribution)
>Environment:
<machine, os, target, libraries (multiple lines)>
System: SunOS hercules 5.7 Generic_106541-08 sun4c sparc SUNW,Sun_4_75
Architecture: sun4
Some paths: /usr/bin/perl /usr/ccs/bin/make /usr/local/bin/gcc
GCC: Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/specs
gcc version 2.95.3 20010315 (release)
Compilation info: CC='gcc' CFLAGS='' CXX='gcc' CXXFLAGS=''
LDFLAGS=''
LIBC:
-rw-r--r-- 1 bin bin 1690732 Oct 14 1999 /lib/libc.a
lrwxrwxrwx 1 root root 11 Sep 7 16:26 /lib/libc.so ->
./libc.so.1
-rwxr-xr-x 1 bin bin 1109336 Oct 14 1999 /lib/libc.so.1
-rw-r--r-- 1 bin bin 1690732 Oct 14 1999 /usr/lib/libc.a
lrwxrwxrwx 1 root root 11 Sep 7 16:26 /usr/lib/libc.so
-> ./libc.so.1
-rwxr-xr-x 1 bin bin 1109336 Oct 14 1999 /usr/lib/libc.so.1
Configure command: ./configure
--with-unix-socket-path=/var/tmp/mysql.sock --with-low-memory
--with-mit-threads=ye
s --without-perl --enable-thread-safe-client --with-berkeley-db
--enable-local-infile --with-innodb CC=gcc CXX=gcc
Perl: This is perl, version 5.005_03 built for sun4-solaris
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php