From owner-freebsd-ports@freebsd.org Sun Nov 11 12:18:25 2018 Return-Path: Delivered-To: freebsd-ports@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 50CC611027BF for ; Sun, 11 Nov 2018 12:18:25 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D25AD7DCC1; Sun, 11 Nov 2018 12:18:24 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id A6A3DA3CA; Sun, 11 Nov 2018 12:18:24 +0000 (UTC) From: Jan Beich To: Palle Girgensohn Cc: "freebsd-ports\@freebsd.org" Subject: Re: clang, i386 and SSE2 References: <201811100112.wAA1CMUr010998@beefy10.nyi.freebsd.org> <17F4B2D0-0E52-4672-BFB7-AA4CDDE5399B@FreeBSD.org> <61781D97-DF35-4365-AAA6-AB1EE6D8D1DB@FreeBSD.org> Date: Sun, 11 Nov 2018 13:18:21 +0100 In-Reply-To: <61781D97-DF35-4365-AAA6-AB1EE6D8D1DB@FreeBSD.org> (Palle Girgensohn's message of "Sun, 11 Nov 2018 12:57:23 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: D25AD7DCC1 X-Spamd-Result: default: False [-106.79 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; R_SPF_SOFTFAIL(0.00)[~all]; IP_SCORE(-3.68)[ip: (-9.62), ipnet: 96.47.64.0/20(-4.81), asn: 11403(-3.90), country: US(-0.09)]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2018 12:18:25 -0000 Palle Girgensohn writes: >> 11 nov. 2018 kl. 12:21 skrev Jan Beich : >> >> Palle Girgensohn writes: >> >> >>>> Log URL: http://beefy10.nyi.freebsd.org/data/112i386-default/484565/logs/postgresql95-client-9.5.15_1.log >> [...] >>>> checking whether the C compiler still works... yes >>>> configure: error: Compiling PostgreSQL with clang, on 32bit x86, requires SSE2 support. Use -msse2 or use gcc. >>>> ===> Script "configure" failed unexpectedly. >>> >>> Can someone shed some light on this error. It can't be reproduced when >>> cross compiling using poudriere on an amd64 hardware. "It just works" >>> for me. >> >> Can you share a poudriere build log for successful build? Maybe you have >> CPUTYPE defined in make.conf e.g., CPUTYPE >= pentium4 implies SSE2. >> >> 11.2 i386 jail on 13.0 amd64 host fails here as well: https://ptpb.pw/n8lF > > Enclosed is the build log for 11.2-i386 crossbuilt with an amd64 kernel and hardware. [...] > building for: FreeBSD 112-i386-default 11.2-RELEASE-p4 FreeBSD 11.2-RELEASE-p4 amd64 [...] > ARCH=amd64 [...] > checking build system type... amd64-portbld-freebsd11.2 > checking host system type... amd64-portbld-freebsd11.2 Looks like your 112-i386 jail actually targets amd64. >>> How do I fix this without breaking for CPU's that don't support sse2 >> >> By researching upstream rationale: in code comment, upstream commit and >> associated bug(s). If Clang on FreeBSD is not affected comment out the >> configure error, otherwise switch to USES=compiler:gcc-c++11-lib. > > It seems at first that a simple fix would be to just add -msse2 to > CFLAGS, but that seems deceptive since it would still fail on CPUs > that don't support SSE2, rigth? It's not a fix. When -msse2 is passed the compiler is allowed to inject SSE2 code as part of auto-vectorization. I'm not sure why you've dismissed using GCC as a workaround.