Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Feb 2023 14:07:11 -0800
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        freebsd-ports@freebsd.org
Subject:   devel/llvm16 -- flang is still broken
Message-ID:  <Y%2BVuj8AUo47vMHtv@troutmask.apl.washington.edu>

next in thread | raw e-mail | index | archive | help
TL:DR: Please disable building flang in devel/llvm16.


I was hoping to test the to Fortran compilers included in
devel/llvm16.  Unfortunately, neither flang16 nor flang-new16
are usable.

%  flang16 -o z a.f90
ld: error: undefined symbol: _FortranAioBeginExternalFormattedOutput
>>> referenced by FIRModule
>>>               /mnt3/kargl/tmp/a-c99267.o:(_QQmain)
>>> referenced by FIRModule
>>>               /mnt3/kargl/tmp/a-c99267.o:(_QQmain)
>>> referenced by FIRModule
>>>               /mnt3/kargl/tmp/a-c99267.o:(_QQmain)
>>> referenced 1 more times
<snipped>

% flang-new16 -o z a.f90
ld: error: undefined symbol: main
>>> referenced by crt1_c.c:73 (/usr/src/lib/csu/amd64/crt1_c.c:73)
>>>               /usr/lib/crt1.o:(_start)

ld: error: undefined symbol: _FortranAioBeginExternalFormattedOutput
>>> referenced by FIRModule
>>>               /mnt3/kargl/tmp/a-9d28a3.o:(_QQmain)
>>> referenced by FIRModule
>>>               /mnt3/kargl/tmp/a-9d28a3.o:(_QQmain)
>>> referenced by FIRModule
>>>               /mnt3/kargl/tmp/a-9d28a3.o:(_QQmain)
<snipped>

So support libraries appear to be missing during the link stage,
and looking at the verbose output shows that none of the libraries
are actually given to the linker.  To compound the matter, the
libraries are static.  There are no shared libraries.

% find /usr/local/llvm16 -name \*Fortran\* | grep "\.a"
/usr/local/llvm16/lib/libFortranCommon.a
/usr/local/llvm16/lib/libFortranDecimal.a
/usr/local/llvm16/lib/libFortranEvaluate.a
/usr/local/llvm16/lib/libFortranLower.a
/usr/local/llvm16/lib/libFortranParser.a
/usr/local/llvm16/lib/libFortranRuntime.a
/usr/local/llvm16/lib/libFortranSemantics.a
/usr/local/llvm16/lib/libFortran_main.a
% find /usr/local/llvm16 -name \*flang\* | grep "\.a"
/usr/local/llvm16/lib/libflangFrontend.a
/usr/local/llvm16/lib/libflangFrontendTool.a

So building devel/llvm16 is a waste of cpu cycles
and threshes memory.

-- 
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Y%2BVuj8AUo47vMHtv>