Building Static Image

vmummer
2008-10-11
2013-05-30
  • vmummer
    vmummer
    2008-10-11

    When I attempt to configure for a static image, configure does not like my sqlite3. But this works fine with out the --enable-static.

    Suggestions pointers?

    TIA

    V.

    ./configure --enable-static

    <CUT>

    checking for uncompress in -lz... yes
    checking sqlite3.h usability... yes
    checking sqlite3.h presence... yes
    checking for sqlite3.h... yes
    checking for sqlite3_open in -lsqlite3... no
    checking for sqlite3_open in -lsqlite3... no
    checking for mysql_config... no
    checking for mysql_config... no

    ./configure

    <CUT>

    checking for uncompress in -lz... yes
    checking sqlite3.h usability... yes
    checking sqlite3.h presence... yes
    checking for sqlite3.h... yes
    checking for sqlite3_open in -lsqlite3... yes
    checking for mysql_config... no
    checking for mysql_config... no

     
    • Thibor
      Thibor
      2008-10-12

      this is also happening to me when trying to configure with the --enable-static option

       
    • Jin
      Jin
      2008-10-12

      Are you sure that you actually do have the static sqlite libraries on your system (i.e. libsqlite3.a)?

      Have a look at the config.log file for more details, if you see some pthread related errors you may need to add " -pthread "to CFLAGS and CXXFLAGs, but check the config.log first.

      Btw, I added a static 0.11.0 packge for i386 two days ago.

      Kind regards,
      Jin

       
    • boilerjt
      boilerjt
      2008-10-12

      I tried compiling SVN 1899 with --enable-static and I am have an sqlite problem as well.  I do have libsqlite3.a in /usr/lib.  The first time I ran it, I had the pthreads errors when checking for sqlite3_open.  In configure, I then added -pthread to CFLAGS and CXXFLAGS right before checking for sqlite3_open.  I now get these errors in config.log:

      configure:20987: checking for sqlite3_open in -lsqlite3
      configure:21022: g++ -o conftest  -static -pthread    -lrt conftest.cpp -lsqlite3   >&5
      /usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libsqlite3.a(os_unix.o): In function `sqlite3UnixDlopen':
      (.text+0x305): undefined reference to `dlopen'
      /usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libsqlite3.a(os_unix.o): In function `sqlite3UnixDlclose':
      (.text+0x2d5): undefined reference to `dlclose'
      /usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libsqlite3.a(os_unix.o): In function `sqlite3UnixDlsym':
      (.text+0x2e5): undefined reference to `dlsym'

       
    • Jin
      Jin
      2008-10-12

      dlopen... I do not know if adding "-ldl" to LDFLAGS will help. You must also keep in mind that there is no static linking with glibc - it will still try to use dlopen (you will have all other libs linked in statically, but you will still have a dependency on glibc).

      If you really want a completely independent static binary you should link it vs. uclibc.

       
    • boilerjt
      boilerjt
      2008-10-12

      Adding -ldl to LIBS seemed to have worked.  The only time I would need this capability is if you do not provide a static binary for the NAS I have (DNS-323) which has an armv5tejl CPU.  I am using a uclibc toolchain to compile apps for this NAS so I hope the glicb linking is not an issue.  I'll try compiling a static binary for the NAS sometime this week and see if there are any issues.

       
    • Jin
      Jin
      2008-10-12

      Did you try the armv4 static binary and can you confirm that it does not work on your device?

      If you are using uclibc - how did you run into the dlopen problem then? Or did you try the static build for i386 first?

       
    • boilerjt
      boilerjt
      2008-10-12

      I was playing with the static build on my i386, just to see how it works.  It takes far longer to build on my NAS and I wanted some practice first :)

      I tried the armv4 0.11.0 static build on the NAS, but it didn't work.  It starts up OK with no errors, but is not visible to my HR-20.  Another user in the DNS-323 community built 0.11.0 (non-static and provided libs), and it was seen by the HR-20.  If you recall, the HR20 does not work with 0.11.0, but 0.12.0 works great :)  Right now, I an running 0.12.0 on my NAS and have even got a few libs linked to it. 

       
    • Jin
      Jin
      2008-10-12

      Oh hmm, is the DNS-323 also Marvell Orion based? I remember there was a thread about this, but I guess I simply forgot and assumed that it worked.

      Hmm...

       
    • boilerjt
      boilerjt
      2008-10-12

      Here is some DNS-323 info:

      CPU      500 Mhz Marvell 88F5181 proprietary Feroceon ARM CPU architecture
      RAM     Two 32 MB Nanya NT5DS16M16CS-6K
      Flash ROM     8 MB Spansion S29GL064M90TFIR4
      USB     1 port USB2.0
      IDE controller     Marvell 88X7042
      LAN     Marvell 88E1111
      Cooling     Speed controlled 40 mm fan
      Serial     115200 8N1 TTL

       
    • Jin
      Jin
      2008-10-12

      Crap, I thought it was based on a different hardware, I guess I remembered it all wrong.

      Yep.. this is the hardware where my static packages do not work - SSDP stuff is not being sent out.