-
Notifications
You must be signed in to change notification settings - Fork 570
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
GMP: New version 6.3.0 #7872
GMP: New version 6.3.0 #7872
Conversation
@maleadt @ViralBShah There is a patch for GMP 6.2.1 that handles "overflow" (out of memory). The respective code changed in GMP 6.3.0. The older patches don't apply, and I don't know whether the patch should be updated or whether it is now superfluous. |
Since Julia Base calls |
I did add tests for the overflow cases I encountered to JuliaLang/julia#51243, so as long as Julia tests pass it should be OK to go with upstream. |
Msan build is failing with
|
Compiling a simple C++ program int main (void) { return 0; } works. Linking it fails:
It is weird that the linker is trying to pull in files ( |
6d4d7f4
to
b95ede1
Compare
That's because you probably didn't get the MSAN runtime from LLVMCompilerRT, we do in our build: https://buildkite.com/julialang/yggdrasil/builds/7762#018d0979-ae62-4dba-89bb-58827f2d5dfe/609-3173. The problem is
somehow the linker is trying to use musl libraries. |
Is this related? |
sandbox:${WORKSPACE}/srcdir/gmp-6.3.0 # echo 'int main (void) { return 0; }' | SUPER_VERBOSE=1 c++ -x c++ - -g -O2
ccache /opt/x86_64-linux-musl/bin/clang++ -target x86_64-linux-gnu --sysroot=/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root -D_GLIBCXX_USE_CXX11_ABI=1 -stdlib=libstdc++ -march=x86-64 -mtune=generic -fsanitize=memory -isystem /opt/x86_64-linux-gnu/x86_64-linux-gnu/include/c++/6.1.0 -isystem /opt/x86_64-linux-gnu/x86_64-linux-gnu/include/c++/6.1.0/x86_64-linux-gnu -isystem /opt/x86_64-linux-gnu/x86_64-linux-gnu/include/c++/6.1.0/backward -isystem /opt/x86_64-linux-gnu/x86_64-linux-gnu/include -isystem /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/include -x c++ - -g -O2 -rtlib=libgcc -L/opt/x86_64-linux-gnu/lib/gcc/opt/x86_64-linux-gnu/lib/gcc -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -L/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/6.1.0 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -fuse-ld=x86_64-linux-gnu -fsanitize=memory
/opt/x86_64-linux-gnu/bin/x86_64-linux-gnu-ld --sysroot=/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root -z now -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib/../lib64/crt1.o /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib/../lib64/crti.o /opt/x86_64-linux-musl/bin/../lib/gcc/x86_64-linux-musl/6.1.0/crtbegin.o -L/opt/x86_64-linux-gnu/lib/gcc/opt/x86_64-linux-gnu/lib/gcc -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -L/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/6.1.0 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -L/opt/x86_64-linux-musl/bin/../lib/gcc/x86_64-linux-musl/6.1.0 -L/opt/x86_64-linux-musl/bin/../lib/gcc/x86_64-linux-musl/6.1.0/../../../../x86_64-linux-musl/lib/../lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib/../lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib/../lib64 -L/opt/x86_64-linux-musl/bin/../lib/gcc/x86_64-linux-musl/6.1.0/../../../../x86_64-linux-musl/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib --whole-archive /opt/x86_64-linux-musl/lib/clang/13.0.1/lib/linux/libclang_rt.msan-x86_64.a --no-whole-archive --dynamic-list=/opt/x86_64-linux-musl/lib/clang/13.0.1/lib/linux/libclang_rt.msan-x86_64.a.syms --whole-archive /opt/x86_64-linux-musl/lib/clang/13.0.1/lib/linux/libclang_rt.msan_cxx-x86_64.a --no-whole-archive --dynamic-list=/opt/x86_64-linux-musl/lib/clang/13.0.1/lib/linux/libclang_rt.msan_cxx-x86_64.a.syms /tmp/--fa2059.o -lstdc++ -lm --no-as-needed -lpthread -lrt -lm -ldl -lgcc_s -lgcc -lc -lgcc_s -lgcc /opt/x86_64-linux-musl/bin/../lib/gcc/x86_64-linux-musl/6.1.0/crtend.o /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib/../lib64/crtn.o
/opt/x86_64-linux-gnu/bin/x86_64-linux-gnu-ld: warning: libc.musl-x86_64.so.1, needed by /opt/x86_64-linux-musl/bin/../lib/gcc/x86_64-linux-musl/6.1.0/../../../../x86_64-linux-musl/lib/../lib64/libstdc++.so, not found (try using -rpath or -rpath-link)
/opt/x86_64-linux-gnu/bin/x86_64-linux-gnu-ld: a.out: hidden symbol `fstat' in /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64/libc_nonshared.a(fstat.oS) is referenced by DSO
/opt/x86_64-linux-gnu/bin/x86_64-linux-gnu-ld: final link failed: Bad value
clang-13: error: linker command failed with exit code 1 (use -v to see invocation) If I understand it correctly, the linker invocation looks extremely wrong, it's mixing up glibc and musl directories and object files. |
Uhm, this works on JuliaPackaging/BinaryBuilderBase.jl@fec32a3, but not JuliaPackaging/BinaryBuilderBase.jl@b52b7a1. It's bisection time. |
@gbaraldi this was broken around JuliaPackaging/BinaryBuilderBase.jl@65d6001 (JuliaPackaging/BinaryBuilderBase.jl#324), but honestly I can't quite tell why. Note that on that specific commit the C compiler is also broken, this was then fixed by JuliaPackaging/BinaryBuilderBase.jl@e76628b (JuliaPackaging/BinaryBuilderBase.jl#332), here only the C++ compiler is broken, so it's a bit complicated to figure out what exactly caused the breakage. Edit: if I manually remove the lines
in the |
@gbaraldi I can confirm restoring Edit: fixed by JuliaPackaging/BinaryBuilderBase.jl#366. |
@eschnett good to go now? |
@giordano Good to go. |
* GMP: New version 6.3.0 * GMP: Don't use clang_use_lld * GMP: Update patches * GMP: Update patches for overflow handling * [GMP] Make copy of files verbose, to ease debugging --------- Co-authored-by: Mosè Giordano <[email protected]>
No description provided.