Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Feb 2019 11:24:32 -0800
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Mark Millard <marklmi@yahoo.com>
Cc:        Dimitry Andric <dim@freebsd.org>, freebsd-toolchain@freebsd.org
Subject:   Re: clang broken on current?
Message-ID:  <20190210192432.GA35876@troutmask.apl.washington.edu>
In-Reply-To: <59881520-AB59-49C3-810F-C0676C3B037C@yahoo.com>
References:  <20190210050003.GA31811@troutmask.apl.washington.edu> <F26ACA01-4132-4020-8089-FB862347F37E@FreeBSD.org> <20190210184656.GD35569@troutmask.apl.washington.edu> <59881520-AB59-49C3-810F-C0676C3B037C@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 10, 2019 at 11:13:09AM -0800, Mark Millard wrote:
> 
> On 2019-Feb-10, at 10:46, Steve Kargl <sgk at troutmask.apl.washington.edu> wrote:
> > 
> > On Sun, Feb 10, 2019 at 12:03:55PM +0100, Dimitry Andric wrote:
> >> On 10 Feb 2019, at 06:00, Steve Kargl <sgk at troutmask.apl.washington.edu> wrote:
> >> 
> >> How did you arrive at the conclusion that this has anything to do with
> >> the specific compiler?  From these errors, I think it is more likely
> >> something in Qt5 that is erroneously convinced that those qt_memfillXY
> >> functions exist.  Or they get referenced, but not compiled at all, for
> >> some reason.
> >> 
> > 
> > If I have "CFLAGS+= -march=i686 -mmmx -msse" in /etc/make.conf
> > qt5-gui builds without issue.  If I add -msse2 to CFLAGS, then
> > the build dies.
> > 
> > So, either clang is miscompiling qt5-gui with -mmse2 or the
> > qt5-gui port is being too smart for its own good.
> 
> That lead to an old memory of getting results like ((armv6
> time frame I think, before the armv7 addition to FreeBSD):
> 
> image/qimage.cpp:(.text+0x1e14): undefined reference to `qt_memfill32(unsigned int*, unsigned int, int)'
> image/qimage.cpp:(.text+0x1f34): undefined reference to `qt_memfill32(unsigned int*, unsigned int, int)'
> 
> where it turned out that arm NEON was not supported by various
> parts of qt5.
> 

It is definitely some problem between clang and the qt5-gui
port.  It seems qt5-gui tries to auto-detect sse2.  Don't
know if qt5-gui has a bogus auto-detect code, clang miscompiles
the auto-detect code, or FreeBSD is lying about the features
of my cpu (although x86info says it found sse2).   In poking
around the qt5-gui sources, I found that configure can be 
given a -sse2 argument.  I tried to force sse2, but I'm seeing
qt5-gui is doing

% find qtbase-everywhere-src-5.12.0 -name config.\* | xargs grep -i sse2
qtbase-everywhere-src-5.12.0/config.log:Command line: -no-eglfs -sse2 -no-evdev -no-libudev -system-harfbuzz -c++std c++14 -opensource -confirm-license -no-pch -prefix /usr/local -bindir /usr/local/lib/qt5/bin -headerdir /usr/local/include/qt5 -libdir /usr/local/lib/qt5 -plugindir /usr/local/lib/qt5/plugins -importdir /usr/local/lib/qt5/imports -datadir /usr/local/share/qt5 -docdir /usr/local/share/doc/qt5 -translationdir /usr/local/share/qt5/translations -sysconfdir /usr/local/etc/xdg -nomake examples -nomake tests -platform freebsd-clang -archdatadir /usr/local/lib/qt5 -libexecdir /usr/local/libexec/qt5 -qmldir /usr/local/lib/qt5/qml -examplesdir /usr/local/share/examples/qt5 -testsdir /usr/local/share/qt5/tests -no-sse2 -no-use-gold-linker -recheck-all -release -no-separate-debug-info
qtbase-everywhere-src-5.12.0/config.opt:-sse2
qtbase-everywhere-src-5.12.0/config.opt:-no-sse2

Note my -sse2 is followed by a -no-sse2!

-- 
Steve
20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4
20161221 https://www.youtube.com/watch?v=IbCHE-hONow



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190210192432.GA35876>