Building Asterisk from source under De{bi,vu}an

These notes relate to Asterisk 16.28.0 for Devuan Beowulf (Debian Buster).

I was building Asterisk from source specifically for https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace because I suspect a bug in Asterisk's ODBC handling, and was advised that this was the way to go about investigating it.

After having verified that dpkg-buildpackage -b -uc -us did indeed create me a binary file (albeit an extremely large one - why isn't it the same as the one in the binary package for Asterisk?), I then proceeded to run make menuselect, enabled the Compiler Flags DONT_OPTIMIZE, DEBUG_THREADS and MALLOC_DEBUG and then ran make.

Results:

  1. Standard /sbin/asterisk installed from the binary package
    • Size: 3057784 bytes
    • Output of file: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=bca5c23ab46cabfba3829bd2e9e4c775b3adc502, stripped
  2. Build using dpkg-buildpackage -b -uc -us
    • Size: 14398296 bytes
    • Output of file: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=34c3e31098866fcf1c5591eeb193f5efe77ff704, with debug_info, not stripped
  3. Build using make:
    • Size: 10010928 bytes (amazingly, even smaller than the Debian build, but still significantly larger than the standard Debian binary)
    • Output of file: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=87045e41a44c64e55a926fb9bc74a7ae7f83f30e, with debug_info, not stripped

The first obvious difference between these three binaries is that the standard one is "stripped" whereas the other two have debug_info and are not stripped.

So, let's strip those and see what comes out:

  1. Standard /sbin/asterisk installed from the binary package
    • Size: 3057784 bytes
  2. Build using dpkg-buildpackage -b -uc -us and then strip
    • Size: 3057752 bytes
  3. Build using make and then strip
    • Size: 3559024 bytes

Those first two are so close to each other that I'm convinced I'm on to the right thing.

Unfortunately, as soon as I move on to the next stage of this endeavour - trying to build a binary with DEB_BUILD_OPTIONS="debug" set - it fails in a most unhelpful way:

../src/pjmedia/resample_resample.c:31:10: fatal error: 
third_party/resample/include/resamplesubs.h: No such file or directory

It's not at all clear why this file is missing, or how to put it where it needs to be. I found a copy on the PJSIP project, but putting this into my best guess at the correct location: third-party/pjproject/source/third_party/resample/include/resamplesubs.h resulted in (a) precisely the same error, and (b) the file disappearing. Something clearly doesn't want it there.


Go up
Return to main index.