MayamaTakeshi / sip-lab

A node module that helps to write SIP functional tests
3 stars 2 forks source link

Build and statically link to openssl #37

Closed MayamaTakeshi closed 2 years ago

MayamaTakeshi commented 2 years ago

This is to avoid problems with different versions of openssl available in the OS.

MayamaTakeshi commented 2 years ago

I built openssl from source and linked the addon statically to it on ubuntu 22.04. But trying to run it on debian 10 failed:

[root@lab002139-basix-fe t1]$ node node_modules/sip-lab/samples/simple.js 
node:internal/modules/cjs/loader:1239
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /root/tmp/t1/node_modules/sip-lab/build/Release/addon.node)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1239:18)
    at Module.load (node:internal/modules/cjs/loader:1033:32)
    at Function.Module._load (node:internal/modules/cjs/loader:868:12)
    at Module.require (node:internal/modules/cjs/loader:1057:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at load (/root/tmp/t1/node_modules/node-gyp-build/index.js:22:10)
    at Object.<anonymous> (/root/tmp/t1/node_modules/sip-lab/index.js:1:40)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
    at Module.load (node:internal/modules/cjs/loader:1033:32) {
  code: 'ERR_DLOPEN_FAILED'
}

[root@lab002139-basix-fe t1]$ cat /etc/issue
Debian GNU/Linux 10 \n \l

Also the size of the addon increased from 7MB to 18MB:

[root@lab002139-basix-fe t1]$ ls -l node_modules/sip-lab/build_old/Release/addon.node 
-rwxr-xr-x 2 root root 7409904 10月 26 10:28 node_modules/sip-lab/build_old/Release/addon.node

[root@lab002139-basix-fe t1]$ ls -l node_modules/sip-lab/build/Release/addon.node 
-rwxr-xr-x 1 root root 18495000 11月 13 15:17 node_modules/sip-lab/build/Release/addon.node

So we will give up on this.