From owner-freebsd-toolchain@freebsd.org Sun Feb 10 15:25:46 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 D72B514CFB60 for ; Sun, 10 Feb 2019 15:25:45 +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 75A9784093; Sun, 10 Feb 2019 15:25:45 +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 x1AFPhb3034951 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 10 Feb 2019 07:25:43 -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 x1AFPhYq034950; Sun, 10 Feb 2019 07:25:43 -0800 (PST) (envelope-from sgk) Date: Sun, 10 Feb 2019 07:25:43 -0800 From: Steve Kargl To: Dimitry Andric Cc: freebsd-toolchain@freebsd.org Subject: Re: clang broken on current? Message-ID: <20190210152543.GD34772@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <20190210050003.GA31811@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 75A9784093 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.977,0] 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 15:25:46 -0000 On Sun, Feb 10, 2019 at 12:03:55PM +0100, Dimitry Andric wrote: > On 10 Feb 2019, at 06:00, Steve Kargl = wrote: > >=20 > > I have > >=20 > > % uname -a > > FreeBSD mobile 13.0-CURRENT FreeBSD 13.0-CURRENT r343477 MOBILE i386 > >=20 > > % dmesg | more > > ... > > FreeBSD clang version 7.0.1 (tags/RELEASE_701/final 349250) (based on L= LVM 7.0.1) > > VT(vga): resolution 640x480 > > CPU: Intel(R) Core(TM)2 Duo CPU T7250 @ 2.00GHz (1995.05-MHz 686-c= lass CPU) > > Origin=3D"GenuineIntel" Id=3D0x6fd Family=3D0x6 Model=3D0xf Steppi= ng=3D13 > > Features=3D0xbfebfbff > > Features2=3D0xe3bd > > AMD Features=3D0x20000000 > > AMD Features2=3D0x1 > > VT-x: (disabled in BIOS) HLT,PAUSE > > TSC: P-state invariant, performance statistics > > ... > >=20 > > If I add 'CFLAGS+=3D-march=3Dnative -mtune=3Dnative', I can build > > world and kernel without a problem. If I try to build > > x11-toolkits/qt5-gui the build dies with > >=20 > > c++ -Wl,--as-needed -fstack-protector -Wl,--no-undefined > > -Wl,--version-script,QtGui.version -pthread -Wl,-rpath,/usr/local/lib/q= t5 > > -shared -Wl,-Bsymbolic-functions > > -Wl,--dynamic-list,/usr/ports/x11-toolkits/qt5-gui/work/qtbase-everywhe= re-src- > > 5.12.0/src/gui/QtGui.dynlist -Wl,-soname,libQt5Gui.so.5 -o libQt5Gui.so= =2E5.12.0 > >=20 > > (long list of *.o files) > >=20 > > -L/usr/ports/x11-toolkits/qt5-gui/work/qtbase-everywhere-src-5.12.0/lib= -L/lib > > -L/usr/local/lib/qt5 -lQt5Core -L/usr/local/lib -lGL -lpng16 -lharfbuzz= -lz > > .obj/qimage.o: In function `QImage::fill(unsigned int)': > > qimage.cpp:(.text+0x2442): undefined reference to `qt_memfill32(unsigne= d int*, > > unsigned int, int)' > > qimage.cpp:(.text+0x2477): undefined reference to `qt_memfill16(unsigned > > short*, unsigned short, int)' >=20 > 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. >=20 If I have "CFLAGS+=3D-march=3Dnative -mtune=3Dnative" in /etc/make.conf, the building of qt5-gui dies. If I remove "CFLAGS+=3D-march=3Dnative -mtune=3Dnative" from /etc/make.conf, the bulding of qt5-gui completes without incidence. The only difference in command lines is the inclusion/exclusion of -march=3Dnative -mtune=3Dnative. I came to my conclusion by noticing noticing argv[0], argv[4] and argv[5] below. c++ -c -O2 -pipe -march=3Dnative -mtune=3Dnative -fstack-protector -isystem= /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -O3 -s= td=3Dc++1y -fvisibility=3Dhidden -fvisibility-inlines-hidden -fno-exception= s -Wall -W -Wdate-time -Winconsistent-missing-override -pthread -fPIC -DQT_= ACCESSIBILITY -DQT_DBUS -DQT_FONTCONFIG -DQT_FREETYPE -DQT_GLIB -DQT_IMAGEF= ORMAT_PNG -DQT_OPENGL -DQT_SHAPE -DQT_XCB -DQT_XKB -DQT_XKBCOMMON -DQT_XREN= DER -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DENABLE_PIXMAN_DRAWHELPERS -DQ= T_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_GUI_LIB -DQT_BUILDING_QT -= DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTR= INGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=3D0x0500= 00 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEB= UG -DQT_CORE_LIB -I. -I../../include -I../../include/QtGui -I../../include/= QtGui/5.12.0 -I../../include/QtGui/5.12.0/QtGui -I.tracegen -I/usr/local/in= clude -I/usr/local/include/libdrm -I/usr/local/include/qt5/QtCore/5.12.0 -I= /usr/local/include/qt5/QtCore/5.12.0/QtCore -I/usr/local/include/qt5 -I/usr= /local/include/qt5/QtCore -I.moc -I/usr/local/include/libpng16 -I/usr/local= /include -I/usr/local/lib/qt5/mkspecs/freebsd-clang -o .obj/qdrawhelper.o p= ainting/qdrawhelper.cpp --=20 Steve