coopermaa / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

Creating Linux SOs (shared libs) appropriately #372

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Accordingly to Linux Documentation, mongoose does not create its shared 
properly.

Referring to what is stated at the following link on this matter, the attached 
patch provides a way to create mongoose's SO accordingly for Linux:

http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

Cheers!

Original issue reported on code.google.com by raaquini on 6 Jul 2012 at 12:39

Attachments:

GoogleCodeExporter commented 8 years ago
Sorry, I forgot to mention the method used for issuing Make, though.

i.e. to build mongoose-3.1 on a Linux Box:

$ VERSION=3.1; make VER="$VERSION" SOVER="${VERSION%.?}" CFLAGS="-lssl -lcrypto 
-DNO_SSL_DL" linux

It will produce:
$ ls
bindings  libmongoose.so.3.1  main.c    mongoose    mongoose.c  test
examples  LICENSE             Makefile  mongoose.1  mongoose.h  win32

ELF dumping the SO:

$ readelf -d libmongoose.so.3.1 

Dynamic section at offset 0x11dc8 contains 32 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libssl.so.10]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.10]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000e (SONAME)             Library soname: [libmongoose.so.3]
 0x000000000000000c (INIT)               0x34c8
 0x000000000000000d (FINI)               0xe570
 0x0000000000000019 (INIT_ARRAY)         0x211880
 0x000000000000001b (INIT_ARRAYSZ)       8 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x211888
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x1b8
 0x0000000000000005 (STRTAB)             0x10c0
 0x0000000000000006 (SYMTAB)             0x268
 0x000000000000000a (STRSZ)              1749 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000003 (PLTGOT)             0x212040
 0x0000000000000002 (PLTRELSZ)           3096 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x28b0
 0x0000000000000007 (RELA)               0x1968
 0x0000000000000008 (RELASZ)             3912 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffe (VERNEED)            0x18c8
 0x000000006fffffff (VERNEEDNUM)         4
 0x000000006ffffff0 (VERSYM)             0x1796
 0x000000006ffffff9 (RELACOUNT)          155
 0x0000000000000000 (NULL)               0x0

Original comment by raaquini on 6 Jul 2012 at 12:44

GoogleCodeExporter commented 8 years ago
Pushed 79cdb77.
I've made Makefile configurable MONGOOSE_LIB_SUFFIX for the library suffix, if 
one chooses to use it.

Original comment by valenok on 22 Sep 2012 at 11:53