posted by Tony Bourke on Thu 18th Mar 2004 18:16 UTC

"NetBSD on SPARC, Page 3/3"
Appendix A: MySQL Odyssey

MySQL was particularly troublesome with NetBSD 1.6.1 and 1.6.2; so much so that I couldn't get it to compile in either environment. I've detailed my journey here, perhaps someone can offer up a suggestion. The experience was identical for both 1.6.1 and 1.6.2.

Remembering the the problems I had with OpenSSL, I started off my MySQL compilation attempt from pkgsrc instead of a source tarball from It started its compilation run, and after a while it died at this error: In function 'void lex_init()': 'symbols' undeclared (first use this function) (Each undeclared identifier is reported only once for each function it appears in.) 'sql_functions' undeclared (first use this function) In function 'int find_keyword(LEX *, unsigned int, bool)': implicit declaration of function 'int get_hash_symbol(...)' initialization to 'SYMBOL *' from 'int' lacks a cast
gmake[4]: *** [sql_lex.o] Error 1
gmake[4]: Leaving directory '/usr/local/src/pkgsrc/databases/mysql4-server/work/mysql-4.0.17/sql'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory '/usr/local/src/pkgsrc/databases/mysql4-server/work/mysql-4.0.17/sql'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory '/usr/local/src/pkgsrc/databases/mysql4-server/work/mysql-4.0.17/sql'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/usr/local/src/pkgsrc/databases/mysql4-server/work/mysql-4.0.17'
gmake: *** [all] Error 2
*** Error code 2
I had about the same issue with that gen_lex_hash binary when compiling MySQL for 64-bit on Solaris. I found this Google listing. Apparently, the gen_lex_hash binary wasn't creating a lex_hash.h header file correctly. When I ran gen_lex_hash by itself, I got this error:
netbsd1# ./gen_lex_hash > lex_hash.h
Fatal error when generating hash for symbols
Didn't find suitable values for perfect hashing:
You have to edit to generate a new hashing function.
You can try running gen_lex_hash with --search to find a suitable value
Symbol array size = 8000
A Google search on that error showed a dead end.

But the Google search also showed source code and a diff file for from MySQL 4.1 and looked like it included quite a few changes, so I downloaded the source from MySQL 4.1.1 and recompiled gen_lex_hash. It compiled fine, the binary work, and I continued the build.

Until... I got this:

/usr/lib/ warning: reference to compatibility vfork(); include
 for correct reference

Followed by a whole mess of errors:

../innobase/trx/libtrx.a(trx0roll.o): In function 'trx_roll_pop_top_rec_of_trx':
trx0roll.o(.text+0x4d30): undefined reference to 'trx_undo_build_roll_ptr'
trx0roll.o(.text+0x4d78): undefined reference to 'trx_undo_rec_get_undo_no'
../innobase/trx/libtrx.a(trx0rseg.o): In function 'trx_rseg_mem_create':
trx0rseg.o(.text+0xbdc): undefined reference to 'flst_get_last'
trx0rseg.o(.text+0xbe8): undefined reference to 'trx_purge_get_log_from_hist'
../innobase/trx/libtrx.a(trx0sys.o): In function 'trx_sysf_create':
trx0sys.o(.text+0x20e8): undefined reference to 'ut_dulint_create'
(continues for quite a while)
I tried GCC 2.95.3 and 3.3.2's version of C++, and to no avail.

So I tried addding this to

While this got rid of the libstdc++ error, the other errors still persisted. I used /usr/pkg/gcc3/lib to look at GCC 3's, but that didn't help either.

So I tried downloading the plain source from MySQL's site. Running the configure script initially complained about -pthreads, so I used the configure script invocation that was used in pkgsrc and the configure script completed.

Then it complained about readline (which allows up-arrow last-command in the MySQL client), so I downloaded readline's source and adjusted the ldflags to include /usr/local/lib in the client subdirectory.

Then I got this:

my_pthread.c: In function 'my_pthread_setprio':
my_pthread.c:38: error: storage size of 'tmp_sched_param' isn't known
my_pthread.c:41: error: 'SCHED_OTHER' undeclared (first use in this function)
my_pthread.c:41: error: (Each undeclared identifier is reported only once
my_pthread.c:41: error: for each function it appears in.)
my_pthread.c: In function 'my_pthread_getprio':
my_pthread.c:50: error: storage size of 'tmp_sched_param' isn't known
my_pthread.c: In function 'my_pthread_attr_setprio':
my_pthread.c:67: error: storage size of 'tmp_sched_param' isn't known
At that point, I gave up. It's listed as a bug, and apparently it's been fixed by a patch already in pkgsrc, but then I'd hit the same walls I hit earlier. I had the same problems with both NetBSD 1.6.1 and 1.6.2.

Appendix B: dmesg

Here is the dmesg from my Ultra 5 running NetBSD 1.6.1. I forgot to grab the dmesg for 1.6.2 before I installed the next operating system.

NetBSD 1.6.1 (GENERIC) #0: Mon Apr  7 10:27:16 UTC 2003
total memory = 256 MB
avail memory = 228 MB
using 1651 buffers containing 13208 KB of memory
bootpath: /pci@1f,0/pci@1,1/ide@3,0/disk@0,0
mainbus0 (root): SUNW,Ultra-5_10
cpu0 at mainbus0: SUNW,UltraSPARC-IIi @ 333 MHz, version 0 FPU
cpu0: physical 32K instruction (32 b/l), 16K data (32 b/l), 2048K external (64 b/l)
psycho0 at mainbus0 addr 0xfffc4000
SUNW,sabre: impl 0, version 0: ign 7c0 bus range 0 to 2; PCI bus 0
DVMA map: c0000000 to e0000000
IOTSB: 12be000 to 133e000
pci0 at psycho0
pci0: i/o space, memory space enabled
ppb0 at pci0 dev 1 function 1: Sun Microsystems Simba PCI bridge (rev. 0x13)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
ebus0 at pci1 dev 1 function 0
ebus0: Sun Microsystems PCIO Ebus2, revision 0x01
auxio0 at ebus0 addr 726000-726003, 728000-728003, 72a000-72a003, 72c000-72c003, 72f000-72f003
power at ebus0 addr 724000-724003 ipl 37 not configured
SUNW,pll at ebus0 addr 504000-504002 not configured
se at ebus0 addr 400000-40007f ipl 43 not configured
com0 at ebus0 addr 3083f8-3083ff ipl 41: ns16550a, working fifo
com0: console
kbd0 at com0 (console input)
com1 at ebus0 addr 3062f8-3062ff ipl 42: ns16550a, working fifo
ms0 at com1
lpt0 at ebus0 addr 3043bc-3043cb, 30015c-30015d, 700000-70000f ipl 34
fdthree at ebus0 addr 3023f0-3023f7, 706000-70600f, 720000-720003 ipl 39 not configured
clock0 at ebus0 addr 0-1fff: mk48t59: hostid 80a829a6
flashprom at ebus0 addr 0-fffff not configured
audiocs0 at ebus0 addr 200000-2000ff, 702000-70200f, 704000-70400f, 722000-722003 ipl 35 ipl 36: CS4231A
audio0 at audiocs0: full duplex
hme0 at pci1 dev 1 function 1: Sun Happy Meal Ethernet, rev. 1
hme0: interrupting at ivec 3021
hme0: Ethernet address 08:00:20:a8:29:a6
nsphy0 at hme0 phy 1: DP83840 10/100 media interface, rev. 1
nsphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ATI Technologies 3D Rage Pro (VGA display, revision 0x5c) at pci1 dev 2 function 0 not configured
pciide0 at pci1 dev 3 function 0: CMD Technology PCI0646 (rev. 0x03)
pciide0: bus-master DMA support present
pciide0: primary channel configured to native-PCI mode
pciide0: using ivec 1820 for native-PCI interrupt
wd0 at pciide0 channel 0 drive 0: 
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 8693 MB, 17662 cyl, 16 head, 63 sec, 512 bytes/sect x 17803440 sectors
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
wd0(pciide0:0:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
pciide0: secondary channel configured to native-PCI mode
atapibus0 at pciide0 channel 1: 2 targets
cd0 at atapibus0 drive 0:  type 5 cdrom removable
cd0: drive supports PIO mode 4, DMA mode 2
cd0(pciide0:1:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
ppb1 at pci0 dev 1 function 0: Sun Microsystems Simba PCI bridge (rev. 0x13)
pci2 at ppb1 bus 2
pci2: i/o space, memory space enabled
fxp0 at pci2 dev 3 function 0: i82559 Ethernet, rev 8
fxp0: interrupting at ivec 18
fxp0: Ethernet address 00:90:27:c2:88:5e
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pcons at mainbus0 not configured
No counter-timer -- using %tick at 333MHz as system clock.
Kernelized RAIDframe activated
root on wd0a dumps on wd0b
root file system type: ffs
Table of contents
  1. "NetBSD on SPARC, Page 1/3"
  2. "NetBSD on SPARC, Page 2/3"
  3. "NetBSD on SPARC, Page 3/3"
e p (0)    29 Comment(s)

Technology White Papers

See More