On 12/12/17 10:26, Oliver Schonrock wrote:
> It seems that this file has the
> answer:
> 
> /usr/src/share/mk/bsd.cpu.mk
> 

...

> 
> So I should be able to put CPUTYPE=sandybridge into /etc/make.conf
> and...happy days? No more nasty surprises?

Actually I am not entirely convinced that will work

eventhough /usr/src/share/mk/bsd.cpu.mk does a lovely job of defining
MACHINE_CPU based on what CPUTYPE we put in /etc/make.conf, it does not
appear that this value actually gets user (ie translated into CFLAGS). I
couldn't find anything in /usr/src or /usr/ports which uses MACHINE_CPU.

From a comment at bottom of /usr/src/share/mk/sys.mk, it seems that this
is the responsibility of the ports themselves:

# Hack for ports compatibility. Historically, ports makefiles have


# assumed they can examine MACHINE_CPU without including anything


# because this was automatically included in sys.mk. For /usr/src,


# this file has moved to being included from bsd.opts.mk. Until all


# the ports files are modernized, and a reasonable transition


# period has passed, include it while we're in a ports tree here


# to preserve historic behavior.

and indeed some ports do that, eg

/usr/ports/security/cryptopp/Makefile

.  if ${MACHINE_CPU:Msse2}
USES+=          compiler:c++14-lang
CXXFLAGS+=      -msse2

yet security/libargon2 does not reference MACHINE_CPU at all.

So it might be all for nought?

Does the port maintainer for security/libargon2 need to add such a
CFLAGS switch based on MACHINE_CPU into the Makefile?

Or is there some "magic" which feeds the "feature info" from MACHINE_CPU
into clang via CFLAGS (or some other way) automatically and my grep'ing
didn't find it?

-- 
Oliver Schönrock
email    : oli...@schonrocks.com

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to