Date: Mon, 28 Jun 2010 07:41:22 +0400 From: Anonymous <swell.k@gmail.com> To: Eitan Adler <lists@eitanadler.com> Cc: freebsd ports <freebsd-ports@freebsd.org> Subject: Re: flag to tell ports that you are only building for yourself Message-ID: <86pqzbbz8d.fsf@gmail.com> In-Reply-To: <AANLkTimVsVusLDbfQxUegnSMVsWdw7KL_jOpkgT7SG0e@mail.gmail.com> (Eitan Adler's message of "Sun, 27 Jun 2010 23:09:47 -0400") References: <AANLkTimVsVusLDbfQxUegnSMVsWdw7KL_jOpkgT7SG0e@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Eitan Adler <lists@eitanadler.com> writes: > I'd like to add a flag to tell ports that you are building only for > yourself that and optimizations that typically are not enabled could > be turned on. There is already MACHINE_CPU. Depending on CPUTYPE it's set to supported SIMD instructions. But it doesn't recognize CPUTYPE=native currently. Until conf/112997 is resolved you can add smth like this to make.conf CPUTYPE ?= native MACHINE_CPU != echo ${MACHINE_ARCH}; ${CC} -E -dM -v -march=${CPUTYPE} - </dev/null 2>&1 \ | awk '/SSE|MMX/ && !/MATH/ { FS="__"; gsub("_",".",$$2); print tolower($$2) }' Then you can start adding in your port (ex. for multimedia/mplayer) .if ${MACHINE_CPU:Mssse3} CONFIGURE_ARGS += --enable-ssse3 .else CONFIGURE_ARGS += --disable-ssse3 .endif > The first two that come to mind are -mtune=native and -march=native. _CPUCFLAGS are set by CPUTYPE. $ make -V CPUTYPE native $ make -V _CPUCFLAGS -march=native $ make -V MACHINE_CPU amd64 sse4.1 mmx sse2 ssse3 sse sse3 amd64 sse2 sse mmx Besides, gcc(1) says -march=cpu-type Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mtune. Moreover, specifying -march=cpu-type implies -mtune=cpu-type. -mcpu=cpu-type A deprecated synonym for -mtune. So, you don't need -mtune and -mcpu. > Ports would be able to add more flags as needed. This could allow > ports to optimize themselves to the architecture they on without > losing the ability to cross build or have build clusters. Any case where it would be useful besides -march/-mtune/-mmmx/-msse*?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86pqzbbz8d.fsf>