sqlite3

prpr

Well-Known Member
When I try using sqlite3 interactively, it just prints stuff like ^[[C and similar when I try to use the arrow keys, which is mega-annoying.
Informed wisdom seems to suggest that it needs building with "readline" support.
Would it be possible to update it to do this please af123?
 
OP
prpr

prpr

Well-Known Member
I pulled the latest sqlite3 (3.8.3) and readline 6.2, turned the compile handle and out popped a 2.5MB executable which seems to work.
Stripping reduces it to about 850KB but it's still vastly bigger than the one in the official package.

Compiling this monster on the Humax took a while and needed swap space :)
 

af123

Administrator
Staff member
Is it dynamically linked?

Code:
humax# ldd /mod/bin/sqlite3
        libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x2aab3000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x2ab56000)
        libc.so.0 => /lib/libc.so.0 (0x2ab6a000)
        libdl.so.0 => /lib/libdl.so.0 (0x2ac0f000)
        ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x2aaa8000)
 
OP
prpr

prpr

Well-Known Member
Code:
humax# file sqlite3
sqlite3: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically l
inked (uses shared libs), with unknown capability 0xf41 = 0x756e6700, with unkno
wn capability 0x70100 = 0x3040000, stripped

If it's a valid thing to do, I copied it to an Ubuntu box and ran "ldd" on it there and it said "not a dynamic executable".
If that's true, then what's the next step please?
 
OP
prpr

prpr

Well-Known Member
Code:
humax# ldd sqlite3
        libreadline.so.6 => not found
        libncurses.so.5 => not found
        libpthread.so.0 => /lib/libpthread.so.0 (0x2aab3000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2aac7000)
        libc.so.0 => /lib/libc.so.0 (0x2aad8000)
        libdl.so.0 => /lib/libdl.so.0 (0x2ab7d000)
        ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x2aaa8000)
Code:
Dynamic section at offset 0x180 contains 30 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libreadline.so.6]
 0x00000001 (NEEDED)                     Shared library: [libncurses.so.5]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.0]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.0]
 0x0000000c (INIT)                       0x401f00
 0x0000000d (FINI)                       0x4b5a20
 0x00000004 (HASH)                       0x400298
 0x00000005 (STRTAB)                     0x4013c0
 0x00000006 (SYMTAB)                     0x4007b0
 0x0000000a (STRSZ)                      2324 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x70000016 (MIPS_RLD_MAP)               0x4d4e90
 0x00000015 (DEBUG)                      0x0
 0x00000003 (PLTGOT)                     0x4d4ea0
 0x00000011 (REL)                        0x401e78
 0x00000012 (RELSZ)                      136 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x70000001 (MIPS_RLD_VERSION)           1
 0x70000005 (MIPS_FLAGS)                 NOTPOT
 0x70000006 (MIPS_BASE_ADDRESS)          0x400000
 0x7000000a (MIPS_LOCAL_GOTNO)           104
 0x70000011 (MIPS_SYMTABNO)              193
 0x70000012 (MIPS_UNREFEXTNO)            40
 0x70000013 (MIPS_GOTSYM)                0x68
 0x6ffffffe (VERNEED)                    0x401e58
 0x6fffffff (VERNEEDNUM)                 1
 0x6ffffff0 (VERSYM)                     0x401cd4
 0x00000000 (NULL)                       0x0
 

af123

Administrator
Staff member
Yep, no libsqlite so that bit is statically linked into it. Explains the size. (Doesn't really matter though, as long as it works for you : ))
 

af123

Administrator
Staff member
I've rebuilt the sqlite3 package with readline support. Not the latest verson as I have it linked to the libraries in /usr/lib which are part of the firmware.
 
OP
prpr

prpr

Well-Known Member
Thanks.
I persisted with my build attempts on the T2 and wasted lots of time trying to make the useless configure stuff work. It just doesn't.
(I tried building it with the useless configure stuff on the Ubuntu box and it died with an internal compiler error <sigh>.)
So I gave up and, after a bit of research, built it manually and now have a shared library of 1.2MB and an executable of about 96kB.

It solves the Sudoku in about 45s :)
 
Top