Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error compiling MySql 3.23.51

Status
Not open for further replies.

paladin256

Technical User
Apr 16, 2002
189
US
I am compiling Mysql 3.23.51 on a Solaris 9 Sparc system and get the
following error:

ld: illegal option -- -
ld: fatal: option -d has illegal argument `efsym'

I have checked and I do have Zlib installed and it is in both my path and LD_LIBRARY_PATH. I am installing with the following options:

CFLAGS="-O3 -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc
CXXFLAGS="-O3 -mcpu=v8 -Wa,-xarch=v8plusa -felide-constructors -fno-exceptio
ns -fno-rtti" ./configure --prefix=/usr/mysql
--localstatedir=/mysql/data

The whole line reads:

mkdir .libs
gcc -O3 -DDBUG_OFF -O3 -mcpu=v8 -Wa,-xarch=v8plusa -felide-constructors -fno
-exceptions -fno-rtti -fno-implicit-templates -fno-exceptions -fno-rtti -DUS
E_MYSYS_NEW -DHAVE_RWLOCK_T -o .libs/mysql mysql.o readline.o sql_string.o
completion_hash.o ../readline/libreadline.a -lcurses
../libmysql/.libs/libmysqlclient.so -lz -lcrypt -lgen -lsocket -lnsl -lm -Wl
,--defsym -Wl,__cxa_pure_virtual=0 -lz -lcrypt -lgen -lsocket -lnsl -lm -R/u
sr/local/mysql/lib/mysql
/usr/ccs/bin/ld: illegal option -- -
ld: fatal: option -d has illegal argument `efsym'
usage: ld [-6:abc:d:e:f:h:il:mo:p:rstu:z:B:CD:F:GI:L:M:N:p:Q:R:S:VY:?]
file(s)
[-64] enforce a 64-bit link-edit
[-a] create an absolute file
[-b] do not do special PIC relocations in a.out
[-B direct] specify `direct' bindings for executable when run
[-B dynamic | static]
search for shared libraries|archives
[-B eliminate] eliminate unqualified global symbols from the
symbol table
[-B group] relocate object from within group
[-B local] reduce unqualified global symbols to local
[-B reduce] process symbol reductions
[-B symbolic] bind external references to definitions when
creating
shared objects
[-c name] record configuration file `name'
[-C] demangle C++ symbol name diagnostics
[-d y | n] operate in dynamic|static mode
[-D token,...] print diagnostic messages
[-e epsym] use `epsym' as entry point address
[-f name] specify library for which this file is an auxiliary
filter
[-F name] specify library for which this file is a filter
[-G] create a shared object
[-h name] use `name' as internal shared object identifier
[-i] ignore LD_LIBRARY_PATH setting
[-I name] use `name' as path of interpreter
[-l x] search for libx.so or libx.a
[-L path] search for libraries in directory `path'
[-m] print memory map
[-M mapfile] use processing directives contained in `mapfile'
[-N string] create a dynamic dependency for `string'
[-o outfile] name the output file `outfile'
[-p auditlib] identify audit library to accompany this object
[-P auditlib] identify audit library for processing the
dependencies
of this object
[-Q y | n] do|do not place version information in output file
[-r] create a relocatable object
[-R path] specify a library search path to be used at run time
[-s] strip any symbol and debugging information
[-S supportlib]
specify a link-edit support library
[-t] do not warn of multiply-defined symbols that have
different sizes or alignments
[-u symname] create an undefined symbol `symname'
[-V] print version information
[-Y P,dirlist] use `dirlist' as a default path when searching for
libraries
[-z absexec] when building an executable absolute symbols
referenced in dynamic objects are promoted to
the executable
[-z allextract | defaultextract | weakextract]
extract all member files, only members that resolve
undefined tor tentative symbols, or allow extraction
of
archive members to resolvetweak references from
archive files
[-z combreloc] combine multiple relocation sections
[-z defs] tdisallow undefined symbol references
[-z endfiltee] marks a filtee such that it will terminate a filters
search
[-z finiarray=function]
name of function to be appended to the .finiarray
[-z groupperm | nogroupperm]
enable|disable setting of group permissions
on dynamic dependencies
[-z ignore | record]
ignore|record unused dynamic dependencies
[-z initarray=function]
name of function to be appended to the .initarray
[-z initfirst] mark object to indicate that its .init section
should
be executed before the .init section of any other
objects
[-z interpose] dynamic object is to be an `interposer' on direct
bindings
[-z lazyload | nolazyload]
enable|disable delayed loading of shared objects
[-z ld32=arg1,arg2,...]
define arguments applicable to the 32-bit class of
ld(1)
[-z ld64=arg1,arg2,...]
define arguments applicable to the 64-bit class of
ld(1)
[-z loadfltr] mark filter as requiring immediate loading of its
filtees at runtime
[-z muldefs] allow multiply-defined symbols
[-z nodefs] allow undefined symbol references
[-z nodefaultlib]
mark object to ignore any default library search
path
[-z nodelete] mark object as non-deletable
[-z nodlopen] mark object as non-dlopen()'able
[-z nodump] mark object as non-dldump()'able
[-z nopartial] expand any partially initialized symbols
[-z noversion] don't record any version sections
[-z now] mark object as requiring non-lazy binding
[-z origin] mark object as requiring $ORIGIN processing
[-z preinitarray=function]
name of function to be appended to the .preinitarray
[-z redlocsym] reduce local syms in .symtab to a minimum
[-z rescan] rescan archive list until no further member
extraction occurs
[-z text] disallow output relocations against text
[-z textoff] allow output relocations against text
[-z textwarn] warn if there are relocations against text
[-z verbose] generate warnings for suspicious processings
collect2: ld returned 1 exit status
make[2]: *** [mysql] Error 1
make[2]: Leaving directory `/mysql-3.23.51/client'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mysql-3.23.51'
make: *** [all-recursive-am] Error 2

Any input to solve this issue would be appreciated.
 
I solved this problem also. Though the mysql site tell you to compile with the options:
CFLAGS="-O3 -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc
CXXFLAGS="-O3 -mcpu=v8 -Wa,-xarch=v8plusa -felide-constructors -fno-exceptio
ns -fno-rtti"

it will cause the problems I have shown above. Removing those options I was able to compile, make, make test, and make install fine.

Note I am running Solaris 9 sparc with gcc 3.1 and you may need those option for older versions of gcc. I did notice that it did add the -felide-constructors -fno-exceptio
ns -fno-rtti" on its own.
 
I forgot one minor note. I found this on my search to fix my problem.
Excerpt below:

The problem occurs because size_socket is made a typedef of type
SOCKET_SIZE_TYPE when it should be a define of socklen_t under
Solaris. I made the following change to make things happy though
I'm not sure that this is the best way to handle the problem since it
makes an assumption based on a Solaris include file.

Flow:
HAVE_mit_thread - undefined
HAVE_SYS_SOCKET_H - defined
_SOCKLEN_t - defined in sys/socket.h

Changed it to:

global.h - starting at line 360
----
#ifdef HAVE_mit_thread
#define qsort_t void
#undef QSORT_TYPE_IS_VOID
#define QSORT_TYPE_IS_VOID
#else
#define qsort_t RETQSORTTYPE /* Broken GCC cant handle typedef !!!! */
#endif
#ifdef HAVE_mit_thread
#define size_socket socklen_t /* Type of last arg to accept */
#else
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef _SOCKLEN_T
#define size_socket socklen_t /* Type of last arg to accept */
#else
typedef SOCKET_SIZE_TYPE size_socket;
#endif
#endif
----

I did it this way so that if this section of code works on other
platforms, it will only have the new behavior under Solaris where
the _SOCKLEN_T C preprocessor variable is defined.

Dean

I had to also make this change for it to compile
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top