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

std::__throw_bad_array_new_length build failure on Fedora 34/GCC11 #40703

Closed
nalimilan opened this issue May 4, 2021 · 8 comments · Fixed by #41292
Closed

std::__throw_bad_array_new_length build failure on Fedora 34/GCC11 #40703

nalimilan opened this issue May 4, 2021 · 8 comments · Fixed by #41292
Labels
domain:building Build system, or building Julia or its dependencies

Comments

@nalimilan
Copy link
Member

git master fails to build on Fedora 34 (with GCC 11). This happens even with a fresh clone.

$ make
[...]
    LINK usr/lib/libjulia-internal.so.1.7
/usr/bin/ld: ./codegen.o: in function `__gnu_cxx::new_allocator<llvm::Type*>::allocate(unsigned long, void const*)':
/usr/include/c++/11/ext/new_allocator.h:110: undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: ./llvm-late-gc-lowering.o: in function `__gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*)':
/usr/include/c++/11/ext/new_allocator.h:110: undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: ./llvm-late-gc-lowering.o: in function `__gnu_cxx::new_allocator<unsigned int>::allocate(unsigned long, void const*)':
/usr/include/c++/11/ext/new_allocator.h:110: undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: ./llvm-late-gc-lowering.o: in function `__gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*)':
/usr/include/c++/11/ext/new_allocator.h:110: undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: /usr/include/c++/11/ext/new_allocator.h:110: undefined reference to `std::__throw_bad_array_new_length()'
/usr/bin/ld: ./llvm-late-gc-lowering.o:/usr/include/c++/11/ext/new_allocator.h:110: more undefined references to `std::__throw_bad_array_new_length()' follow
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:300: /home/milan/julia/usr/lib/libjulia-internal.so.1.7] Error 1
make: *** [Makefile:76: julia-src-release] Error 2
@sostock
Copy link
Contributor

sostock commented May 20, 2021

It happens on Arch Linux as well (also GCC 11).

Edit: It works fine with GCC 10.

@DoktorMike
Copy link

This happens on my Arch linux as well with

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.1.0 (GCC)

@DoktorMike
Copy link

It happens on Arch Linux as well (also GCC 11).

Edit: It works fine with GCC 10.

@sostock May I ask how you selected gcc-10 on arch to compile julia? I was looking in the Makefile for a CC alias cut couldn't find one.

@sostock
Copy link
Contributor

sostock commented May 24, 2021

@DoktorMike I didn’t edit the makefile, I just downgraded the gcc packages. However, it seems like one needs to be careful with that, since SDDM and KDE Plasma wouldn’t start for me after I did that.

@jmert
Copy link
Contributor

jmert commented May 24, 2021

I've added to my Make.user the following and did a full clean build after to have compilation work again.

# 2021-05-22 — Needed at least temporarily after Arch upgraded to GCC 11 with a new         
# libstdc++ version.                                                                     
#   - Build error on unresolved symbol during linking for                                   
#       std::__throw_bad_array_new_length                                                   
USE_SYSTEM_CSL=1                                                                            

@maleadt
Copy link
Member

maleadt commented May 25, 2021

@sostock May I ask how you selected gcc-10 on arch to compile julia? I was looking in the Makefile for a CC alias cut couldn't find one.

You can put override CC=gcc-10 and override CXX=g++-10 in your Make.user.

@albinahlback
Copy link
Contributor

I'm having problems as well on Arch.

@cvanelteren
Copy link

Having a similar issue (also on arch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:building Build system, or building Julia or its dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants