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

CompilerSupportLibraries_jll v0.5.0 from GCC 11 breaks some platforms #163

Closed
giordano opened this issue Jul 9, 2021 · 1 comment · Fixed by #164
Closed

CompilerSupportLibraries_jll v0.5.0 from GCC 11 breaks some platforms #163

giordano opened this issue Jul 9, 2021 · 1 comment · Fixed by #164

Comments

@giordano
Copy link
Member

giordano commented Jul 9, 2021

% julia -e 'using BinaryBuilderBase; BinaryBuilderBase.runshell(Platform("i686", "linux"))'
sandbox:${WORKSPACE} # mkdir -p ${prefix}
sandbox:${WORKSPACE} # wget -qO - 'https://github.com/JuliaBinaryWrappers/CompilerSupportLibraries_jll.jl/releases/download/CompilerSupportLibraries-v0.5.0%2B0/CompilerSupportLibraries.v0.5.0.i686-linux-gnu-libgfortran3.tar.gz' | tar xzf - -C ${prefix}
sandbox:${WORKSPACE} # echo 'int main() { return 0; }' | g++ -x c++ - -Wl,--trace -o sanitycheckcpp.exe -L${libdir}
/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/../../../../i686-linux-gnu/bin/ld: mode elf_i386
/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/usr/lib/crt1.o
/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/usr/lib/crti.o
/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/crtbegin.o
/tmp/ccnJKpAc.o
-lstdc++ (/workspace/destdir/lib/libstdc++.so)
-lm (/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/usr/lib/libm.so)
-lgcc_s (/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/../../../../i686-linux-gnu/lib/libgcc_s.so)
/lib/libc.so.6 (/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/lib/libc.so.6)
(/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/usr/lib/libc_nonshared.a)elf-init.oS
/lib/ld-linux.so.2 (/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/lib/ld-linux.so.2)
-lgcc_s (/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/../../../../i686-linux-gnu/lib/libgcc_s.so)
/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/crtend.o
/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/usr/lib/crtn.o
/workspace/destdir/lib/libstdc++.so: undefined reference to `__divmoddi4@GCC_7.0.0'
/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/../../../../i686-linux-gnu/bin/ld: link errors found, deleting executable `sanitycheckcpp.exe'
collect2: error: ld returned 1 exit status
sandbox:${WORKSPACE} # echo 'int main() { return 0; }' | g++ -x c++ - -Wl,--trace -o sanitycheckcpp.exe
/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/../../../../i686-linux-gnu/bin/ld: mode elf_i386
/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/usr/lib/crt1.o
/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/usr/lib/crti.o
/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/crtbegin.o
/tmp/ccMjMAnj.o
-lstdc++ (/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/../../../../i686-linux-gnu/lib/libstdc++.so)
-lm (/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/usr/lib/libm.so)
-lgcc_s (/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/../../../../i686-linux-gnu/lib/libgcc_s.so)
/lib/libc.so.6 (/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/lib/libc.so.6)
(/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/usr/lib/libc_nonshared.a)elf-init.oS
/lib/ld-linux.so.2 (/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/lib/ld-linux.so.2)
-lgcc_s (/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/../../../../i686-linux-gnu/lib/libgcc_s.so)
/opt/i686-linux-gnu/bin/../lib/gcc/i686-linux-gnu/4.8.5/crtend.o
/opt/i686-linux-gnu/bin/../i686-linux-gnu/sys-root/usr/lib/crtn.o
sandbox:${WORKSPACE} # ./sanitycheckcpp.exe 
sandbox:${WORKSPACE} # nm ${libdir}/libstdc++.so | grep divmoddi4
         U __divmoddi4@GCC_7.0.0

So, when using CompilerSupportLibraries_jll v0.5.0 from GCC 11 and ${libdir} is in the linker search path of libraries g++ can't compile the simple program because ${libdir}/libstdc++.so has an undefined symbol __divmoddi4@GCC_7.0.0. We don't have any issues if ${libdir} isn't in the linker search path and /opt/${target}/${target}/lib/libstdc++.so is picked up

@giordano
Copy link
Member Author

As far as I understand, the issue is that the undefined symbol __divmoddi4@GCC_7.0.0 found in libstdc++.so should come from libgcc_so.1, but in the CompilerSupportLibraries_jll recipe libgcc_s.so.1 comes from the second iteration, constrained by libgfortran version, so that in the i686-linux-*-libgfortran3 tarballs libstdc++.so has this symbol undefined, but the necessary libgcc_s.so.1 isn't there.

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

Successfully merging a pull request may close this issue.

1 participant