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

Requires GLIBCXX 3.4.32 #10

Open
SoapSpangledGames opened this issue Sep 9, 2024 · 22 comments
Open

Requires GLIBCXX 3.4.32 #10

SoapSpangledGames opened this issue Sep 9, 2024 · 22 comments

Comments

@SoapSpangledGames
Copy link

I am trying to use Tree3D on Ubuntu 20.04, which has glibc 2.31, but the Tree3D Linux binaries are built against glib 3.4.32. Is there a way to get libraries compatible with Ubuntu 20.04?

@FibreFoX
Copy link
Contributor

FibreFoX commented Sep 9, 2024

Ubuntu 20 LTS will drop support in 2025 (see https://ubuntu.com/about/release-cycle), so keep in mind that they will remove their support too in half a year.
grafik

Godot itself does not have any requirements to the used OS (see https://docs.godotengine.org/en/stable/about/system_requirements.html#desktop-or-laptop-pc-recommended):
grafik

Right now we use Ubuntu 24 for compiling the binaries (see

FROM ubuntu:24.04
). I was not aware of such a problem, will check if this can be easily downgraded.

@FibreFoX
Copy link
Contributor

FibreFoX commented Sep 9, 2024

Which Godot version are you using? @SoapSpangledGames

@FibreFoX
Copy link
Contributor

FibreFoX commented Sep 9, 2024

Note to self: needs some more work than just switching to Ubuntu 20.04 inside the Dockerfile:

root@d75a78707437:/source# scons target=template_debug arch=x86_64
scons: Reading SConscript files ...
SCons 4.0 or greater required, but you have SCons 3.1.2

Will check if using PIP for installing SCons will help, and I will check if generated binaries still work with later glibc version. (I hate these version conflicts)

@SoapSpangledGames
Copy link
Author

I'm using Godot 4.3. I am planning on building Tree3D myself in order to get the correct binaries for Ubuntu 20.04.

@SoapSpangledGames
Copy link
Author

I downloaded SCons 4.8.1, so I think I will be able to build it.

@SoapSpangledGames
Copy link
Author

It's building now.

@FibreFoX
Copy link
Contributor

FibreFoX commented Sep 9, 2024

I've found an issue over at the Godot project regarding glibc, but they are discussion glibc 2.x stuff,: godotengine/godot#95182

Not sure if we need to supply special versions here, I would prefer to glibc 3, but it needs to be documented. I'm building the extension on my local machine too and will then push through all the test-devices I have.

@SoapSpangledGames
Copy link
Author

The build completed, but I don't know what to do now. Since you're building, perhaps I should just wait for you to finish.

@FibreFoX
Copy link
Contributor

FibreFoX commented Sep 9, 2024

Depending on how you've built it, look into the demo/addons/Tree3D directory, the binaries should be placed there. I will report back when I've found a proper way for having the binary working 😺

@SoapSpangledGames
Copy link
Author

I built it with "scons target=template_release arch=x86_64 platform=linux", and I found it under demo/addons/Tree3D. However, I need to build the debug version.

@FibreFoX
Copy link
Contributor

FibreFoX commented Sep 9, 2024

I am a bit puzzled, I have rechecked the build system, the glibc installed there is having glibc 2.39 installed:

root@a5ca9727583b:/source# /lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu GLIBC 2.39-0ubuntu8.3) stable release version 2.39.
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 13.2.0.
libc ABIs: UNIQUE IFUNC ABSOLUTE
Minimum supported kernel: 3.2.0
For bug reporting instructions, please see:
<https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>.

When switching to Ubuntu 20.04 it states the following:

root@3bdb336af230:/source# /lib/x86_64-linux-gnu/lib
libc-2.31.so        libc.so.6           libfakeroot/        libpthread-2.31.so  libpthread.so       libpthread.so.0
root@3bdb336af230:/source# /lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu GLIBC 2.31-0ubuntu9.16) stable release version 2.31.
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 9.4.0.
libc ABIs: UNIQUE IFUNC ABSOLUTE
For bug reporting instructions, please see:
<https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>.

Can you show me, what lib the .so file is showing to on your system?
ldd demo/addons/Tree3D/libTree3D.linux.template_debug.x86_64.so

How did you get the information about glibc 3.4.32 ?

@SoapSpangledGames
Copy link
Author

Woohoo! It worked! I have a default tree in my scene now:

image

@SoapSpangledGames
Copy link
Author

ldd libTree3D.linux.template_debug.x86_64.so

linux-vdso.so.1 (0x00007ffcdd0eb000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f406a6cf000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f406a57f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f406a387000)
/lib64/ld-linux-x86-64.so.2 (0x00007f406a9af000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f406a367000)

@FibreFoX
Copy link
Contributor

FibreFoX commented Sep 9, 2024

I am looking back to the original report: #2 (comment)

Can you please change the title of this issue to Requires GLIBCXX 3.4.32 please? Because that's a different library ;)

Just to make sure, can you post me which version it is (ls -althr /lib/x86_64-linux-gnu/libstdc++.so.6) ?

EDIT:
Can you post what versions your system supports?

strings /lib/x86_64-linux-gnu/libstdc++.so.6  | grep GLIBCXX

@SoapSpangledGames SoapSpangledGames changed the title Requires glibc 3.4.32 Requires GLIBCXX 3.4.32 Sep 9, 2024
@SoapSpangledGames
Copy link
Author

I got the information about the library when I ran Godot from the command line.

@SoapSpangledGames
Copy link
Author

ls -althr /lib/x86_64-linux-gnu/libstdc++.so.6

lrwxrwxrwx 1 root root 19 Jul 9 2023 /lib/x86_64-linux-gnu/libstdc++.so.6 -> libstdc++.so.6.0.28

strings /lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX

GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_DEBUG_MESSAGE_LENGTH

@FibreFoX
Copy link
Contributor

FibreFoX commented Sep 9, 2024

Compiled with Ubuntu 20.04

root@9029fe173472:/source# strings demo/addons/Tree3D/libTree3D.linux.template_release.x86_64.so | grep GLIBCXX
GLIBCXX_3.4.18
GLIBCXX_3.4.11
GLIBCXX_3.4.15
GLIBCXX_3.4

Compiled with Ubuntu 22.04

GLIBCXX_3.4.18
GLIBCXX_3.4.29
GLIBCXX_3.4.11
GLIBCXX_3.4.15
GLIBCXX_3.4

Compiled with Ubuntu 24.04

root@9029fe173472:/source# strings demo/addons/Tree3D/libTree3D.linux.template_release.x86_64.so | grep GLIBCXX
GLIBCXX_3.4.32
GLIBCXX_3.4.18
GLIBCXX_3.4.29
GLIBCXX_3.4.11
GLIBCXX_3.4.15
GLIBCXX_3.4

When compiled with Ubuntu 24.04 the generated SO file is 4kb less in size for the template_release-version.

@JekSun97 What versions of Ubuntu do you want to support? Right now there are no proper restrictions from Godot itself, so there are no checks available. There is another issue at the Godot project, where static linking was discussed: godotengine/godot#3468
We might be able to create a special version for these kind of Linux versions (not only Ubuntu) that have a pretty old version of libstdc++6. I am not sure about the implications (because I am not a C/C++ programmer).

For me there are now multiple options:

  • compile with lower version "in general" for linux binaries
  • additionally compile with lower version "for older Linux distros" for linux binaries (makes separate release ZIP)
  • static linking libstdc++6 into Tree3D (dont know yet how to do this)
  • drop support for older versions (aka "do nothing"), as users could compile via SCons on their own system

EDIT: as far as I can see, the generated .so files with the older libstdc++6 do work on more modern Ubuntu-versions, so maybe we "just" need make a change to the Dockerfile

Example:

FROM ubuntu:20.04

RUN apt-get update && apt-get install -y \
# linux build dependencies
gcc g++ gcc-multilib g++-multilib \
# windows build dependencies
mingw-w64 \
# build system
python3 python3-pip

# use specific SCons version
# Godot 4.0 needs a specific version
# see https://github.com/godotengine/godot-cpp/issues/1518
# see https://github.com/godotengine/godot-cpp/pull/1526
RUN python3 -m pip install scons==4.7.0

WORKDIR /source

@FibreFoX
Copy link
Contributor

FibreFoX commented Sep 9, 2024

@FibreFoX
Copy link
Contributor

FibreFoX commented Sep 9, 2024

@SoapSpangledGames An alternative, that came up very frequently while researching:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y

This adds a repository to your Ubuntu-system ... but there might be a lot of other packages, that you would "by accident" replace. So I am not sure if that solution would fit your needs.

EDIT:

1. Nobody wants backup, everybody wants restore.
2. To restore, you need a backup.
3. Have a backup. 

https://adminzen.org/backup/

@SoapSpangledGames
Copy link
Author

My personal opinion is to avoid statically linking system libraries, as security fixes in system libraries are too important to rely on application programmers to apply.

I've always been fine with statically linking application libraries, though.

@SoapSpangledGames
Copy link
Author

SoapSpangledGames commented Sep 9, 2024

I will upgrade to the latest Ubuntu (I actually use Kubuntu) shortly before end of life. I'm just waiting for Wayland to not suck. It seems to be getting there quickly, so I'm crossing my fingers that it will be ready before 20.04 support ends. With X11 on life support, there will soon be no other choice. The last time I tried to install Kubuntu with Wayland video on my three-monitor setup, it was an adventure that didn't end well.

I'm VERY wary of using system PPA's. I tried it once, and it completely hosed my system. I will likely not try them a second time.

@FibreFoX
Copy link
Contributor

FibreFoX commented Sep 9, 2024

In the meantime, you just can use your custom compiled binaries ;) at least that works

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

2 participants