From owner-freebsd-toolchain@freebsd.org Sun Feb 10 19:24:37 2019 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7972A14D8133 for ; Sun, 10 Feb 2019 19:24:37 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0085B8D2AD; Sun, 10 Feb 2019 19:24:34 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id x1AJOWDL035982 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 10 Feb 2019 11:24:33 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id x1AJOWwA035981; Sun, 10 Feb 2019 11:24:32 -0800 (PST) (envelope-from sgk) Date: Sun, 10 Feb 2019 11:24:32 -0800 From: Steve Kargl To: Mark Millard Cc: Dimitry Andric , freebsd-toolchain@freebsd.org Subject: Re: clang broken on current? Message-ID: <20190210192432.GA35876@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <20190210050003.GA31811@troutmask.apl.washington.edu> <20190210184656.GD35569@troutmask.apl.washington.edu> <59881520-AB59-49C3-810F-C0676C3B037C@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59881520-AB59-49C3-810F-C0676C3B037C@yahoo.com> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 0085B8D2AD X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [3.52 / 15.00]; HAS_REPLYTO(0.00)[sgk@troutmask.apl.washington.edu]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCVD_IN_DNSWL_MED(-0.20)[21.76.95.128.list.dnswl.org : 127.0.11.2]; MX_GOOD(-0.01)[cached: troutmask.apl.washington.edu]; FREEMAIL_TO(0.00)[yahoo.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.11)[ip: (0.23), ipnet: 128.95.0.0/16(0.29), asn: 73(0.08), country: US(-0.07)]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:73, ipnet:128.95.0.0/16, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.84)[0.838,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[washington.edu]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.36)[0.357,0]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.53)[0.533,0]; R_SPF_NA(0.00)[] X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Feb 2019 19:24:37 -0000 On Sun, Feb 10, 2019 at 11:13:09AM -0800, Mark Millard wrote: > > On 2019-Feb-10, at 10:46, Steve Kargl wrote: > > > > On Sun, Feb 10, 2019 at 12:03:55PM +0100, Dimitry Andric wrote: > >> On 10 Feb 2019, at 06:00, Steve Kargl 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