Date: Sun, 10 Feb 2019 15:14:15 -0800 From: Mark Millard <marklmi@yahoo.com> To: Steve Kargl <sgk@troutmask.apl.washington.edu> Cc: =?utf-8?Q?Lucas_Nali_de_Magalh=C3=A3es?= <rollingbits@gmail.com>, ports-list freebsd <freebsd-ports@freebsd.org> Subject: Re: Building qt5-gui port? Message-ID: <F12D9923-3F62-45D0-9692-C66F69B33C4B@yahoo.com> In-Reply-To: <20190210184352.GC35569@troutmask.apl.washington.edu> References: <2EF34E75-DDBC-4D99-B317-3C8F20725AE5@yahoo.com> <6AFE3B36-FBFA-46AA-81DB-31BB24A5D75E@gmail.com> <20190210151427.GB34772@troutmask.apl.washington.edu> <FFA352D4-39FC-4BCC-A5E8-00076A78A543@yahoo.com> <20190210183250.GB35569@troutmask.apl.washington.edu> <20190210184352.GC35569@troutmask.apl.washington.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2019-Feb-10, at 10:43, Steve Kargl <sgk at = troutmask.apl.washington.edu> wrote: > On Sun, Feb 10, 2019 at 10:32:50AM -0800, Steve Kargl wrote: >> On Sun, Feb 10, 2019 at 10:24:43AM -0800, Mark Millard wrote: >>>=20 >>> My reference to building for armv7 not having a problem in >>> my builds is an example of a 32-bit-target context for >>> qt5-gui. So i386 specific or some other aspect of how its >>> build was attempted might be involved in your context. >>>=20 >>=20 >> Do you use -march=3Dnative -mtune=3Dnative with clang in >> freebsd-current on all those architectures? >>=20 >> I can build qt5-gui with "-march=3Di486", "-march=3Di686" >> "-march=3Di686 -mmmx", "-march=3Di686 -mmmx -msse". I'll >> be adding each of -msse2, -msse3, -mssse3, -mcx16, >> -mfxsr, and -msahf to CFLAGS to see which one is causing >> the problem. >>=20 >> If adding all of the -target-feature options turned on >> by core2 work with i686, I'll then up i686 and repeat. >>=20 >=20 > Well that was quick. Adding -msse2 to CFLAGS causes > qt5-gui to die. I accidentally replied to the wrong (but releated?) message, generating: = https://lists.freebsd.org/pipermail/freebsd-toolchain/2019-February/004323= .html with the following information (with a little added here at the end): /usr/ports/Mk/Uses/qt-dist.mk has: . if ${ARCH} =3D=3D i386 && empty(MACHINE_CPU:Msse2) CONFIGURE_ARGS+=3D -no-sse2 . endif This traces back to: /usr/src/share/mk/bsd.cpu.mk and its: . elif ${MACHINE_CPUARCH} =3D=3D "amd64" MACHINE_CPU =3D amd64 sse2 sse mmx . elif ${MACHINE_CPUARCH} =3D=3D "arm" MACHINE_CPU =3D arm . elif ${MACHINE_CPUARCH} =3D=3D "i386" MACHINE_CPU =3D i486 and (I'll not list it all): ########## i386 . if ${MACHINE_CPUARCH} =3D=3D "i386" . if ${CPUTYPE} =3D=3D "znver1" MACHINE_CPU =3D avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 = i586 . elif ${CPUTYPE} =3D=3D "bdver4" MACHINE_CPU =3D xop avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx = k6 k5 i586 . elif ${CPUTYPE} =3D=3D "bdver3" || ${CPUTYPE} =3D=3D "bdver2" || \ ${CPUTYPE} =3D=3D "bdver1" MACHINE_CPU =3D xop avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 = i586 . elif ${CPUTYPE} =3D=3D "btver2" MACHINE_CPU =3D avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} =3D=3D "btver1" MACHINE_CPU =3D ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} =3D=3D "amdfam10" MACHINE_CPU =3D athlon-xp athlon k7 3dnow sse4a sse3 sse2 sse mmx k6 k5 = i586 . elif ${CPUTYPE} =3D=3D "opteron-sse3" || ${CPUTYPE} =3D=3D = "athlon64-sse3" MACHINE_CPU =3D athlon-xp athlon k7 3dnow sse3 sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} =3D=3D "opteron" || ${CPUTYPE} =3D=3D "athlon64" || \ . . . and: ########## amd64 . elif ${MACHINE_CPUARCH} =3D=3D "amd64" . if ${CPUTYPE} =3D=3D "znver1" MACHINE_CPU =3D avx2 avx sse42 sse41 ssse3 sse4a sse3 . . . . endif MACHINE_CPU +=3D amd64 sse2 sse mmx ########## Mips . elif ${MACHINE_CPUARCH} =3D=3D "mips" So it looks like freeBSD expects CPUTYPE to be set for i368 in order to enable sse2 in MACHINE_CPU . Other things have a similar status for amd64 but amd64 always has sse2 . Looks like when native works and clang is in use, and the context is amd64 (or i386), CPUTYPE could be generated by the likes of (example from my amd64 context): # sh -c "clang -v -fsyntax-only -march=3Dnative -x c /dev/null 2>&1 | = grep -e '-target-cpu' | sed -e 's|.*-target-cpu \([[:alnum:]]*\) = .*|\1|'" znver1 (I got that command from = https://forums.freebsd.org/threads/make-conf-optimizations-optimizing-buil= ds.63461/ .) Trying such on a cortex-a57 (aarch64) got an empty-string result. Same for cortex-a53 (aarch64) and cortex-a7 (armv7). (I do not have a powerpc* available at the moment.) Those result from results like: # clang -v -fsyntax-only -march=3Dnative -x c /dev/null 2>&1 FreeBSD clang version 7.0.1 (tags/RELEASE_701/final 349250) (based on = LLVM 7.0.1) Target: aarch64-unknown-freebsd13.0 Thread model: posix InstalledDir: /usr/bin clang: error: the clang compiler does not support '-march=3Dnative' =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F12D9923-3F62-45D0-9692-C66F69B33C4B>