Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade crosstool-ng and fix 'GLIBCXX_3.4.29' not found #201

Open
GRomR1 opened this issue Jan 11, 2025 · 0 comments
Open

Upgrade crosstool-ng and fix 'GLIBCXX_3.4.29' not found #201

GRomR1 opened this issue Jan 11, 2025 · 0 comments

Comments

@GRomR1
Copy link

GRomR1 commented Jan 11, 2025

First, I wanted to thank you for the great tool that allows you to pack all dependencies into one package. Great job 🤝

Lately I've been trying to rebuild old Salt packages with support for not the latest and not the most popular versions of the Linux OS.

I found that toolchain versions before 0.17 were completely deleted and it was impossible to build Salt version 3006.7 on my own. So I forked this project and started to figure it out.

The first thing that stopped me was zlib download errors. But this is fixed with this PR.

This allowed me to build the toolchain and build old Salt versions. But Salt did not start from this build. This error occurs during startup ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.29' not found (required by /opt/saltstack/salt/lib/python3.10/site-packages/zmq/libzmq.cpython-310-x86_64-linux-gnu.so) and stop me again.

Then I discovered that the old version (1.25.0) of crosstool-ng is used. I decided to update it to the latest 1.26.0

This required updating the config (relenv/_toolchain/x86_64/x86_64-linux-gnu-ct-ng.config) for building the toolchain. I've update it with ct-ng upgradeconfig. It is run upgrade included components.

I can build salt package with updated toolchain but this didn't really help to fix the "GLIBCXX_3.4.29 not found" issue. While searching for a solution, I found that the libzmq.so library depends on another library located in directory that not included in salt-lib directory (system dir):

ldd libzmq.so
   libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6

The system that I run builded salt has libstdc++.so.6 but lacks the required version of GLIBCXX (3.4.29).

So I try to compile toolchain with an oldest and supported gcc. It was 8.5.0 (https://gcc.gnu.org/gcc-8/). With this toolchain (latest relenv - 0.18.0, crosstool-ng - 1.26.0, gcc - 8.5.0) was build needed salt package (3006.7). The builded salt has successfully runs without any errors. Error GLIBCXX_3.4.29 not found was missed. Everything fine at first glance!

So I would like to share some knowledge in this issue and may be make some PRs if it will useful to the project:

  1. Is it need to update crosstool-ng and config from 1.25 to 1.26?
  2. Is it possible to downgrade gcc from 11.2 to 8.5 for wider OS support?
  3. How to confirm that these changes will not break the work of some main function of the salt?

I make a PR in my forked repo to review. I need to edit CI-files because without it I can't run github action to build toolchain, successful run - https://github.com/GRomR1/relenv/actions/runs/12723602202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant