Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Nov 2018 13:18:21 +0100
From:      Jan Beich <jbeich@FreeBSD.org>
To:        Palle Girgensohn <girgen@FreeBSD.org>
Cc:        "freebsd-ports\@freebsd.org" <freebsd-ports@freebsd.org>
Subject:   Re: clang, i386 and SSE2
Message-ID:  <a7mf-x0xe-wny@FreeBSD.org>
In-Reply-To: <61781D97-DF35-4365-AAA6-AB1EE6D8D1DB@FreeBSD.org> (Palle Girgensohn's message of "Sun, 11 Nov 2018 12:57:23 %2B0100")
References:  <201811100112.wAA1CMUr010998@beefy10.nyi.freebsd.org> <17F4B2D0-0E52-4672-BFB7-AA4CDDE5399B@FreeBSD.org> <h8gn-zwpl-wny@FreeBSD.org> <61781D97-DF35-4365-AAA6-AB1EE6D8D1DB@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Palle Girgensohn <girgen@FreeBSD.org> writes:

>> 11 nov. 2018 kl. 12:21 skrev Jan Beich <jbeich@FreeBSD.org>:
>> 
>> Palle Girgensohn <girgen@FreeBSD.org> 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 <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.



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