Bug 235891

Summary: lang/julia: link errors on stable/11 after clang 7.0.1
Product: Ports & Packages Reporter: Trond Endrestøl <Trond.Endrestol>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: iblis.dif01, jhibbits, lwhsu, rene
Priority: --- Flags: bugzilla: maintainer-feedback? (iblis.dif01)
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 237068    
Bug Blocks:    

Description Trond Endrestøl 2019-02-20 18:05:41 UTC
After clang 7.0.1 was introduced in base/stable/11, r344213, building lang/julia exhibits the following link errors:

[ 85%] Linking CXX shared library ../../lib/libLTO.so
gmake[5]: Entering directory '/construction/xports/lang/julia/work/julia-1.0.3/deps/scratch/llvm-6.0.0/build_Release'
/usr/local/bin/ld: BFD (GNU Binutils) 2.32 assertion fail elflink.c:2935
/usr/local/bin/ld: BFD (GNU Binutils) 2.32 assertion fail elflink.c:2935
/usr/local/bin/ld: BFD (GNU Binutils) 2.32 assertion fail elflink.c:2935
/usr/local/bin/ld: BFD (GNU Binutils) 2.32 assertion fail elflink.c:2935
Scanning dependencies of target llvm-lto
gmake[5]: Leaving directory '/construction/xports/lang/julia/work/julia-1.0.3/deps/scratch/llvm-6.0.0/build_Release'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[5]: *** [tools/llvm-config/CMakeFiles/llvm-config.dir/build.make:86: bin/llvm-config] Error 1
gmake[5]: Leaving directory '/construction/xports/lang/julia/work/julia-1.0.3/deps/scratch/llvm-6.0.0/build_Release'
gmake[4]: *** [CMakeFiles/Makefile2:10863: tools/llvm-config/CMakeFiles/llvm-config.dir/all] Error 2
gmake[4]: *** Waiting for unfinished jobs....
gmake[5]: Entering directory '/construction/xports/lang/julia/work/julia-1.0.3/deps/scratch/llvm-6.0.0/build_Release'
[ 87%] Building CXX object tools/llvm-lto/CMakeFiles/llvm-lto.dir/llvm-lto.cpp.o
/usr/local/bin/ld: BFD (GNU Binutils) 2.32 assertion fail elflink.c:2935
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[5]: *** [tools/llvm-ar/CMakeFiles/llvm-ar.dir/build.make:85: bin/llvm-ar] Error 1
gmake[5]: Leaving directory '/construction/xports/lang/julia/work/julia-1.0.3/deps/scratch/llvm-6.0.0/build_Release'
gmake[4]: *** [CMakeFiles/Makefile2:10774: tools/llvm-ar/CMakeFiles/llvm-ar.dir/all] Error 2
/usr/local/bin/ld: BFD (GNU Binutils) 2.32 assertion fail elflink.c:2935
[ 87%] Linking CXX executable ../../bin/llvm-lto
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[5]: *** [tools/lto/CMakeFiles/LTO.dir/build.make:100: lib/libLTO.so.6.0.0] Error 1
gmake[5]: Leaving directory '/construction/xports/lang/julia/work/julia-1.0.3/deps/scratch/llvm-6.0.0/build_Release'
gmake[4]: *** [CMakeFiles/Makefile2:10307: tools/lto/CMakeFiles/LTO.dir/all] Error 2
/usr/local/bin/ld: BFD (GNU Binutils) 2.32 assertion fail elflink.c:2935
/usr/local/bin/ld: BFD (GNU Binutils) 2.32 assertion fail elflink.c:2935
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[5]: *** [tools/llvm-lto/CMakeFiles/llvm-lto.dir/build.make:85: bin/llvm-lto] Error 1

Previously the link errors was limited to base/head, but now I fear base/stable/12 is equally affected.

lang/julia pulls in lang/gcc8, presumably as a build tool, yet it proceeds to use cc (clang 7.0.1) as its compiler.

Maybe an adjustment of LD is all that's required.

Full build log is available at https://ximalas.info/~trond/julia-stable-11/lang___julia.log
Comment 1 Iblis Lin 2019-02-22 09:19:13 UTC
Hi,
Seems the error is from the build process of private LLVM build.
Are you able to build devel/llvm60 on your environment?
Comment 2 Trond Endrestøl 2019-02-22 11:20:27 UTC
(In reply to Iblis Lin from comment #1)
Yes, graphics/mesa-libs depends on lang/llvm60, and they are both well and alive.
Comment 3 Iblis Lin 2019-02-23 06:48:19 UTC
what is your malloc.conf setting?
Comment 4 Trond Endrestøl 2019-02-23 15:33:43 UTC
(In reply to Iblis Lin from comment #3)
It's non-existent.
Comment 5 Trond Endrestøl 2019-02-23 15:43:02 UTC
This failure is consistent with that of https://www.mail-archive.com/freebsd-pkg-fallout@freebsd.org/msg1022301.html
However, in my case both kernel and world are in sync.
Comment 6 Iblis Lin 2019-02-24 02:54:04 UTC
well, I installed a vm from the 11.2-STABLE snapshot.
(https://download.freebsd.org/ftp/snapshots/VM-IMAGES/11.2-STABLE/amd64/Latest/)

Found that if I build Julia v1.0 from github source,
it builds without error.
But the one in ports failed.
I'm investigating the environment variables set by ports framework.
Comment 7 Justin Hibbits freebsd_committer freebsd_triage 2019-02-27 16:13:13 UTC
This looks to be a bug in binutils 2.32.  I see the exact same assertion failure when building devel/llvm60 on powerpcspe, but it succeeds on powerpc64.  Unfortunately for me it takes 20 hours to reproduce for that target.
Comment 8 Rene Ladan freebsd_committer freebsd_triage 2021-01-02 14:43:58 UTC
lang/julia10, the only consumer left of lang/julia, expired two days ago and this port is useless without lang/julia10. Please open a new PR for new similar issues.