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

Use custom gcc version for dockcross/linux-arm64-full #663

Open
Pibmy opened this issue Feb 10, 2022 · 12 comments
Open

Use custom gcc version for dockcross/linux-arm64-full #663

Pibmy opened this issue Feb 10, 2022 · 12 comments

Comments

@Pibmy
Copy link

Pibmy commented Feb 10, 2022

Hello,

I'm trying to compile an application with the dockcross/linux-arm64-full for a raspberry-pi4. But compiling with the default configuration it uses gcc 11.2.0 version of the compiler and when I run the compiled code in the raspberry I get the message:

  • /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found
  • /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29'

The ldd version on raspberry is:

ubuntu@ubuntu:~$ ldd --version
ldd (Ubuntu GLIBC 2.31-0ubuntu9.2) 2.31

The os-release is:

ubuntu@ubuntu:~$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"

Is it possible to get dockcross/linux-arm64-full with gcc 9.3 ?
I tried to recompile the image modifying the BR2_GCC_VERSION parameter of buildroot.config file but it fails :(

An other solution would be to use the dockcross/linux-arm64-lts image but i need the qt5-core qt5-network dependencies and i failed to compile them for the image.

Thank for your help.

@bensuperpc
Copy link
Member

bensuperpc commented Feb 21, 2022

I'm thinking maybe downgrading the GLIBC version, unfortunately it is not possible to change some GLIBC options (Like version...) with buildroot, it is possible crosstool-ng, I'll look into it when I have time.

I can advise you to use buildroot (Vers. Buildroot 2021.08) rather than modifying directly in the configuration file, but otherwise:

There are several other lines to change to go back to GCC 9.3:

#
# GCC Options
#
# BR2_GCC_VERSION_9_X is not set
# BR2_GCC_VERSION_10_X is not set
BR2_GCC_VERSION_11_X=y
BR2_GCC_SUPPORTS_DLANG=y
BR2_GCC_VERSION="11.2.0"
BR2_EXTRA_GCC_CONFIG_OPTIONS=""
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TOOLCHAIN_BUILDROOT_FORTRAN=y
# BR2_TOOLCHAIN_BUILDROOT_DLANG is not set
BR2_GCC_ENABLE_LTO=y
BR2_GCC_ENABLE_OPENMP=y
BR2_GCC_ENABLE_GRAPHITE=y
BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS=y

BR2_TOOLCHAIN_GCC_AT_LEAST_9=y
BR2_TOOLCHAIN_GCC_AT_LEAST_10=y
BR2_TOOLCHAIN_GCC_AT_LEAST_11=y
BR2_TOOLCHAIN_GCC_AT_LEAST="11"

There may be other lines to change and possible compatibility issues with other software in buildroot, going through buildroot GUI is easier to configure the toolchain.

I hope this will help you,

@github-actions
Copy link

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Jun 22, 2022
@github-actions github-actions bot removed the Stale label Jul 15, 2022
@github-actions
Copy link

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Nov 13, 2022
@saxbophone
Copy link

As an aside, it would be helpful for the versions of C/C++ compilers that are shipped with the images to be documented.

My use case: I'm using C++20 and the exact features of this new dialect of the language that are available depends on the compiler version.

@github-actions github-actions bot removed the Stale label Nov 30, 2022
@github-actions
Copy link

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Mar 30, 2023
@saxbophone
Copy link

This issue is still valid

@github-actions github-actions bot removed the Stale label Mar 31, 2023
@github-actions
Copy link

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Jul 29, 2023
@saxbophone
Copy link

This issue is still valid

@github-actions github-actions bot removed the Stale label Jul 29, 2023
@baiwfg2
Copy link

baiwfg2 commented Nov 5, 2023

As an aside, it would be helpful for the versions of C/C++ compilers that are shipped with the images to be documented.

My use case: I'm using C++20 and the exact features of this new dialect of the language that are available depends on the compiler version.

Yes, I agree. If the version of gcc is tagged into image name, we can identify which image is suitable for download.

@baiwfg2
Copy link

baiwfg2 commented Nov 5, 2023

My raspbian gcc version is :

pi@raspberrypi:~ $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (Raspbian 4.9.2-10)
pi@raspberrypi:~ $ strings /lib/arm-linux-gnueabihf/libc.so.6 | grep GLIBC_
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_2.18
GLIBC_PRIVATE

Apprently the latest image of dockcross/linux-armv6 cannot generate binary whose GLIBC version is lower than GLIBC_2.18

@baiwfg2
Copy link

baiwfg2 commented Nov 5, 2023

Finally I found dockcross/linux-armv6:20200324-880bfd0 which contains gcc 4.8 rather than 11.3 in newest images. I think you can also find your gcc version from https://hub.docker.com/r/dockcross/linux-arm64-full/tags @Pibmy

Copy link

github-actions bot commented Mar 4, 2024

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Mar 4, 2024
@bensuperpc bensuperpc removed the Stale label Mar 4, 2024
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

4 participants