Skip to content

terminalemulator.cpp:715:17: error: 'malloc_trim' was not declared in this scope #441

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

Closed
robotamer opened this issue Apr 22, 2025 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@robotamer
Copy link

I am getting following error.
Running an up to date Void Linux with musl on AMD64

terminalemulator.cpp
../../src/modules/eterm/src/eterm/terminal/terminalemulator.cpp: In member function 'void eterm::Terminal::TerminalEmulator::trimMemory()':
../../src/modules/eterm/src/eterm/terminal/terminalemulator.cpp:715:17: error: 'malloc_trim' was not declared in this scope
  715 |                 malloc_trim( 0 );
      |                 ^~~~~~~~~~~
make[1]: *** [eterm-static.make:142: ../../obj/linux/debug/eterm-static/terminalemulator.o] Error 1
make: *** [Makefile:93: eterm-static] Error 2

By the way. I had to install SOIL2. A little help on where to put that folder would save us time.

@SpartanJ
Copy link
Owner

Running an up to date Void Linux with musl on AMD64

Oh ok, malloc_trim is a glibc extension, let me patch it so it does not try to call it when building with something different than glibc.

By the way. I had to install SOIL2. A little help on where to put that folder would save us time.

I don't follow. You shouldn't install SOIL2, SOIL2 is statically built with the project. You just need to pull all the sub-modules from the repository.

@SpartanJ
Copy link
Owner

Patched in the latest commit, it should build with musl, I don't think I'm using any other glibc extension.

@SpartanJ SpartanJ self-assigned this Apr 22, 2025
@chadchoi
Copy link

chadchoi commented Apr 23, 2025

Please fix your AppImage for Linux.

They used to run on my system, but now they are no longer:

$ ./ecode-linux-0.7.1-x86_64.AppImage
/tmp/.mount_ecode-hdOy94/ecode.bin: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.31' not found (required by /tmp/.mount_ecode-hdOy94/ecode.bin)
/tmp/.mount_ecode-hdOy94/ecode.bin: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /tmp/.mount_ecode-hdOy94/ecode.bin)
/tmp/.mount_ecode-hdOy94/ecode.bin: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.31' not found (required by /tmp/.mount_ecode-hdOy94/libs/libeepp.so)
/tmp/.mount_ecode-hdOy94/ecode.bin: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /tmp/.mount_ecode-hdOy94/libs/libeepp.so)

My system is a normal glibc-based Linux, not musl-based like the OP.

@SpartanJ
Copy link
Owner

@chadchoi This is unrelated to the issue. Sadly this started happening since GitHub decided deprecating Ubuntu 20.04 in the CIs last week. The oldest Linux distribution available to build is Ubuntu 22.04, which uses a newer glibc for building. This is an old problem of Linux builds, glibc is versioned and binaries are built always against the host system glibc, this is why the usual solution is trying to build against the oldest system possible. Although these days it is quite easy to keep a Linux system up to date, users shouldn't have problems with glibc versions older than 3 years, but there's always an exception. Please provide which distribution you're using and its version, also please provide the result of ldd --version. I'll see what can be done.

@chadchoi
Copy link

I actually have a newer glibc. Your AppImage requires glibc 2.31 or 2.32 as the error message said. I have glibc 2.36.

@SpartanJ
Copy link
Owner

Yeah but no, it's built against glibc 2.39, that's the problem. Before it was building against glibc 2.31. I'm checking options, I'll probably use this and patch the binary after built, I want to use 2.31 but patching isn't working for that version, but at least I can patch for 2.32, so for your particular case it will work again.

@SpartanJ
Copy link
Owner

@chadchoi glibc patch is being applied to nightlys, minimum required glibc is 2.34 (couldn't get below that without getting errors).

@SpartanJ SpartanJ added the enhancement New feature or request label Apr 25, 2025
@chadchoi
Copy link

Nothing changed. I guess I will have to build from source. This is Linux so build from source will be easy. Thank you anyway.

$ ./ecode-linux-nightly-x86_64.AppImage
/tmp/.mount_ecode-OXXb85/ecode.bin: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.31' not found (required by /tmp/.mount_ecode-OXXb85/ecode.bin)
/tmp/.mount_ecode-OXXb85/ecode.bin: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /tmp/.mount_ecode-OXXb85/ecode.bin)
/tmp/.mount_ecode-OXXb85/ecode.bin: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.31' not found (required by /tmp/.mount_ecode-OXXb85/libs/libeepp.so)
/tmp/.mount_ecode-OXXb85/ecode.bin: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /tmp/.mount_ecode-OXXb85/libs/libeepp.so)

@SpartanJ
Copy link
Owner

SpartanJ commented Apr 25, 2025

Oh, true, it does patch it but does not work, I just realized that you're on a debian 12 based distro, so I can test myself. For the moment polyfill-glibc does not seem to work (even though I forgot to patch the libeepp too but it's not having any effect).

@Curculigo
Copy link

The fastest solution: switch from ubuntu-22.04 to ubuntu-20.04 since Github Actions still supports it.

@SpartanJ
Copy link
Owner

Sadly no, 20.04 has been already deprecated on April 15 and builds won't run, that's why I changed it since the moment I saw the error in eepp CI.

@SpartanJ
Copy link
Owner

@chadchoi @Curculigo Nightly fixed for Debian 12 and older GLIBC and GLIBCXX (for both AppImage and tar.gz). Now builds from a docker container, using an Ubuntu 20.04 image, and also, statically builds libstdc++.

@SpartanJ
Copy link
Owner

@robotamer thread got out of control, let me know if you need any help, I'll close the issue for the moment.

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

No branches or pull requests

4 participants