使用较旧版本的GLIBCXX

时间:2021-06-28 18:23:02

Background: I have AWS Lambda running nodejs 6.10. For my code i need to have a C Library to run algorithms. Which is compiled by node-gyp on my machine.

背景:我有AWS Lambda运行nodejs 6.10。对于我的代码,我需要一个C库来运行算法。这是由我的机器上的node-gyp编译的。

My buildserver was an outdated ubuntu 14.04, on which i was running my node-gyp compiled code and everything was working as expected.

我的buildserver是一个过时的ubuntu 14.04,我正在运行我的node-gyp编译代码,一切都按预期工作。

Now, i have updated my ubuntu to 17.04 version. Which seems to giving me issues with Version of GLIBCXX

现在,我已将我的ubuntu更新为17.04版本。这似乎给了我GLIBCXX版本的问题

I have gathered the versions of GLIBCXX in different environments by running

我通过运行在不同的环境中收集了GLIBCXX的版本

  1. /sbin/ldconfig -p | grep stdc++
  2. / sbin / ldconfig -p | grep stdc ++

  3. (using the path from 1) strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX
  4. (使用1中的路径)字符串/usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX

Here you can see that on Ubuntu 17.04 GLIBCXX is available from v3.4 to 3.4.22, where as the other environments have it only upto 3.4.19.

在这里你可以看到在Ubuntu 17.04上GLIBCXX可以从v3.4到3.4.22,其他环境只有3.4.19。

My code compiled on Ubuntu 17.04 is looking for GLIBCXX_3.4.21 which is not available on the running environments and results in the following error

我在Ubuntu 17.04上编译的代码正在寻找在运行环境中不可用的GLIBCXX_3.4.21并导致以下错误

"errorMessage": "/var/lang/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /var/task/addon.node)",

Request: Is there any method by which (other than using custom dockers / going back to older versions of ubuntu etc) where i can set the compiler to use GLIBCXX_3.4.19, which i can eventually change when the environments (AWS lambda supports the latest version?). Ideally i am looking for a compiler flag that i can set permanently on the machine or via node-gyp that i can pass on so that i use the right version.

请求:是否有任何方法(除了使用自定义docker /返回旧版本的ubuntu等),我可以设置编译器使用GLIBCXX_3.4.19,我最终可以在环境中更改(AWS lambda支持最新版本)版?)。理想情况下,我正在寻找一个编译器标志,我可以永久地在机器上或通过我可以传递的node-gyp设置,以便我使用正确的版本。

Observation: even though I have GLIBCXX_3.4.22 it is only linkling GLIBCXX_3.4.21 ( or they are backward compatible? )

观察:即使我有GLIBCXX_3.4.22它只链接GLIBCXX_3.4.21(或者它们向后兼容?)

1 个解决方案

#1


0  

Is there any method by which (other than using custom dockers / going back to older versions of ubuntu etc) where i can set the compiler to use GLIBCXX_3.4.19, which i can eventually change when the environments (AWS lambda supports the latest version?). Ideally i am looking for a compiler flag that i can set permanently on the machine or via node-gyp that i can pass on so that i use the right version.

是否有任何方法(除了使用自定义docker /返回旧版本的ubuntu等),我可以设置编译器使用GLIBCXX_3.4.19,我最终可以在环境(AWS lambda支持最新版本?)时更改? )。理想情况下,我正在寻找一个编译器标志,我可以永久地在机器上或通过我可以传递的node-gyp设置,以便我使用正确的版本。

You can install an earlier version of g++ on Ubuntu 17.04 and use that toolchain to compile your software. g++-4.7 could work, but I don't know for sure. Check the version that's on your current build machine. You could even stuff this older compiler in a container if you'd like, but it's not necessary.

您可以在Ubuntu 17.04上安装早期版本的g ++,并使用该工具链编译您的软件。 g ++ - 4.7可以工作,但我不确定。检查当前构建计算机上的版本。如果你愿意的话,你甚至可以将这个旧的编译器填充到容器中,但这不是必需的。

even though I have GLIBCXX_3.4.22 it is only linkling GLIBCXX_3.4.21 ( or they are backward compatible? )

即使我有GLIBCXX_3.4.22它只链接GLIBCXX_3.4.21(或者它们向后兼容?)

The whole point of these symbols is to have a well-defined way of designating ABI incompatibility. You just happen to not use any changes introduced by GLIBCXX_3.4.22, but do use changes introduced by GLIBCXX_3.4.21 (when compiled by whatever compiler you are using).

这些符号的重点在于具有明确定义的ABI不兼容性指定方式。您恰好不使用GLIBCXX_3.4.22引入的任何更改,但确实使用GLIBCXX_3.4.21引入的更改(当您使用的任何编译器编译时)。

#1


0  

Is there any method by which (other than using custom dockers / going back to older versions of ubuntu etc) where i can set the compiler to use GLIBCXX_3.4.19, which i can eventually change when the environments (AWS lambda supports the latest version?). Ideally i am looking for a compiler flag that i can set permanently on the machine or via node-gyp that i can pass on so that i use the right version.

是否有任何方法(除了使用自定义docker /返回旧版本的ubuntu等),我可以设置编译器使用GLIBCXX_3.4.19,我最终可以在环境(AWS lambda支持最新版本?)时更改? )。理想情况下,我正在寻找一个编译器标志,我可以永久地在机器上或通过我可以传递的node-gyp设置,以便我使用正确的版本。

You can install an earlier version of g++ on Ubuntu 17.04 and use that toolchain to compile your software. g++-4.7 could work, but I don't know for sure. Check the version that's on your current build machine. You could even stuff this older compiler in a container if you'd like, but it's not necessary.

您可以在Ubuntu 17.04上安装早期版本的g ++,并使用该工具链编译您的软件。 g ++ - 4.7可以工作,但我不确定。检查当前构建计算机上的版本。如果你愿意的话,你甚至可以将这个旧的编译器填充到容器中,但这不是必需的。

even though I have GLIBCXX_3.4.22 it is only linkling GLIBCXX_3.4.21 ( or they are backward compatible? )

即使我有GLIBCXX_3.4.22它只链接GLIBCXX_3.4.21(或者它们向后兼容?)

The whole point of these symbols is to have a well-defined way of designating ABI incompatibility. You just happen to not use any changes introduced by GLIBCXX_3.4.22, but do use changes introduced by GLIBCXX_3.4.21 (when compiled by whatever compiler you are using).

这些符号的重点在于具有明确定义的ABI不兼容性指定方式。您恰好不使用GLIBCXX_3.4.22引入的任何更改,但确实使用GLIBCXX_3.4.21引入的更改(当您使用的任何编译器编译时)。