From nobody@FreeBSD.org  Mon Mar 12 10:56:29 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 1F875106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Mar 2012 10:56:29 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D44D8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Mar 2012 10:56:29 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CAuSrk094816
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Mar 2012 10:56:28 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q2CAuS0u094815;
	Mon, 12 Mar 2012 10:56:28 GMT
	(envelope-from nobody)
Message-Id: <201203121056.q2CAuS0u094815@red.freebsd.org>
Date: Mon, 12 Mar 2012 10:56:28 GMT
From: Shane Ambler <FreeBSD@Shaneware.biz>
To: freebsd-gnats-submit@FreeBSD.org
Subject: clang on i386 tinderbox produces inconsistent defines
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         165968
>Category:       i386
>Synopsis:       clang on i386 tinderbox produces inconsistent defines
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    dim
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 12 11:00:26 UTC 2012
>Closed-Date:    Sat Jul 28 11:52:17 UTC 2012
>Last-Modified:  Sat Jul 28 11:52:17 UTC 2012
>Originator:     Shane Ambler
>Release:        9.0-RELEASE
>Organization:
>Environment:
FreeBSD leader.local 9.0-RELEASE FreeBSD 9.0-RELEASE #1: Wed Feb 15 16:03:18 CST 2012     root@:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
I found a situation where __SSE__ is defined but __MMX__ is not defined. MMX came before SSE and is available on any intel proc that has SSE so there is some mixup to get that define combination.

I have setup tinderbox (on a corei5 with amd64 base system) with several jails, the relevant system versions are 10-CURRENT / 9-STABLE / 9.0-RELEASE. I get the error compiling multimedia/x264 using clang with ARCH=i386. 

i386 with gcc compiles as does amd64 with gcc and clang.

I have set CC/CXX/CPP/ARCH in the builds environment file. As a work around I can also set CPUTYPE to pentium2 or higher and it will compile. Lower CPUTYPE values fail to build. 

Some tinderbox references I found suggest setting MACHINE_ARCH UNAME_m and UNAME_p to i386 - these options don't fix this issue, neither does setting them to pentium2

>How-To-Repeat:
Compile multimedia/x264 within a tinderbox build with arch i386 using FreeBSD v9.0 or higher and setting CC=clang CXX=clang++ CPP=clang-cpp ARCH=i386 in the corresponding build environment file (scripts/etc/env/build.{BUILDNAME}).

>Fix:


Patch attached with submission follows:

building x264-0.119.2113 in directory /usr/local/tinderbox/10-CURRENT-i386-clang
build started at Mon Mar 12 21:18:10 CST 2012
port directory: /usr/ports/multimedia/x264
building for:  10.0-CURRENT i386
maintained by: mm@FreeBSD.org
Makefile ident: $FreeBSD: ports/multimedia/x264/Makefile,v 1.86 2011/12/21 23:49:00 mm Exp $
prefixes: LOCALBASE=usr/local PREFIX=/usr/local
Begin Configuration:
---Begin Environment---
INDEXFILE=INDEX-10
ARCH=i386
PORTOBJFORMAT=elf
CPP=clang-cpp
X_WINDOW_SYSTEM=xorg
PAGER=more
DISTFILE_URI=
TIMEOUT=7200
CCACHE_ENABLED=0
FTP_PASSIVE_MODE=yes
CC=clang
MASTER_SITE_OVERRIDE=file:///distcache/${DIST_SUBDIR}/ 
OPTIONS_ENABLED=0
__MKLVL__=1
DISTCACHE=/distcache
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
EDITOR=vi
pb=/usr/local/tinderbox
HTTP_TIMEOUT=900
PACKAGES=/tmp/packages
LOG_DIRECTORY=
HAVE_MOTIF=1
PKGSUFFIX=.tbz
BATCH=1
__DSVERSION__=3.3
OSREL=10.0
CCACHE_DIR=
LOG_COMPRESSLOGS=0
defaultUpdateType=SVN
OLDPWD=/
DISTFILE_CACHE=/usr/ports/distfiles
USA_RESIDENT=YES
WRKDIRPREFIX=/work
BRANCH=CURRENT
defaultUpdateHost=svn+ssh://leader/usr/local/projectsother/freebsd/code-svn
PWD=/usr/ports/multimedia/x264
HOST_WORKDIR=
OPTIONS_DIR=
PKGZIPCMD=bzip2
USER=root
DISTDIR=/tmp/distfiles
HOME=/root
CCACHE_JAIL=0
TZ=Australia/Adelaide
CXX=clang++
LOG_DOCOPY=0
CCACHE_MAX_SIZE=1G
CCACHE_NOLINK=1
TINDERD_SLEEPTIME=120
UNAME_n=tinderbox.host
FTP_TIMEOUT=900
TINDERD_LOGFILE=/dev/null
PARALLEL_PACKAGE_BUILD=1
CCACHE_LOGFILE=
UNAME_r=10.0-CURRENT
LOCALBASE=/usr/local
UNAME_s=FreeBSD
PACKAGE_BUILDING=1
OSVERSION=1000009
UNAME_v=FreeBSD 10.0-CURRENT #0: Mon Mar 12 21:17:28 CST 2012    root@tinderbox.host:/usr/src/sys/magic/kernel/path
BLOCKSIZE=K
---End Environment---

---Begin OPTIONS List---
===> The following configuration options are available for x264-0.119.2113:
     ASM=On (default) "Assembly optimizations (devel/binutils)"
     DEBUG=Off (default) "Enable Debugging"
     PGO=Off (default) "Enable Profile-Guided Optimization"
     GCC44=Off (default) "Use gcc 4.4+ (implies WITH_ASM)"
     GPAC=On (default) "Enable MPEG-4 Output"
     X11_OUTPUT=Off (default) "Enable X11 Output"
===> Use 'make config' to modify these settings
---End OPTIONS List---

End Configuration.
FETCH_DEPENDS=
PATCH_DEPENDS=
EXTRACT_DEPENDS=
BUILD_DEPENDS=libiconv-1.13.1_2.tbz gettext-0.18.1.1.tbz yasm-1.2.0.tbz bash-4.2.20.tbz binutils-2.22_1.tbz jpeg-8_3.tbz png-1.4.8_1.tbz libGL-7.4.4.tbz libGLU-7.4.4.tbz libdrm-2.4.12_1.tbz expat-2.0.1_2.tbz dri2proto-2.3.tbz libX11-1.4.4,1.tbz libXext-1.3.0_1,1.tbz libXxf86vm-1.1.1.tbz libXdamage-1.1.3.tbz libXfixes-5.0.tbz libpthread-stubs-0.3_3.tbz libxcb-1.7.tbz kbproto-1.0.5.tbz libXau-1.0.6.tbz libXdmcp-1.1.0.tbz xproto-7.0.22.tbz pkg-config-0.25_1.tbz xextproto-7.2.0.tbz xf86vidmodeproto-2.3.1.tbz damageproto-1.2.1.tbz fixesproto-5.0.tbz gpac-libgpac-0.4.5_4,1.tbz gmake-3.82.tbz
RUN_DEPENDS=jpeg-8_3.tbz png-1.4.8_1.tbz libGL-7.4.4.tbz libGLU-7.4.4.tbz libdrm-2.4.12_1.tbz expat-2.0.1_2.tbz dri2proto-2.3.tbz libX11-1.4.4,1.tbz libXext-1.3.0_1,1.tbz libXxf86vm-1.1.1.tbz libXdamage-1.1.3.tbz libXfixes-5.0.tbz libpthread-stubs-0.3_3.tbz libxcb-1.7.tbz kbproto-1.0.5.tbz libXau-1.0.6.tbz libXdmcp-1.1.0.tbz xproto-7.0.22.tbz pkg-config-0.25_1.tbz xextproto-7.2.0.tbz xf86vidmodeproto-2.3.1.tbz damageproto-1.2.1.tbz fixesproto-5.0.tbz gpac-libgpac-0.4.5_4,1.tbz
TEST_DEPENDS=
add_pkg
================================================================
====================<phase 1: make checksum>====================
===>  License GPLv2 accepted by the user
=> x264-snapshot-20111220-2245-stable.tar.bz2 doesn't seem to exist in /tmp/distfiles/x264.
=> Attempting to fetch file:///distcache/x264/x264-snapshot-20111220-2245-stable.tar.bz2
x264-snapshot-20111220-2245-stable.tar.bz2             518 kB  942 MBps
=> SHA256 Checksum OK for x264/x264-snapshot-20111220-2245-stable.tar.bz2.
================================================================
====================<phase 2: make extract>====================
add_pkg
===>  License GPLv2 accepted by the user
===>  Extracting for x264-0.119.2113
=> SHA256 Checksum OK for x264/x264-snapshot-20111220-2245-stable.tar.bz2.
================================================================
====================<phase 3: make patch>====================
add_pkg
===>  Patching for x264-0.119.2113
===>  Applying FreeBSD patches for x264-0.119.2113
================================================================
====================<phase 4: make build>====================
add_pkg libiconv-1.13.1_2.tbz gettext-0.18.1.1.tbz yasm-1.2.0.tbz bash-4.2.20.tbz binutils-2.22_1.tbz jpeg-8_3.tbz png-1.4.8_1.tbz libGL-7.4.4.tbz libGLU-7.4.4.tbz libdrm-2.4.12_1.tbz expat-2.0.1_2.tbz dri2proto-2.3.tbz libX11-1.4.4,1.tbz libXext-1.3.0_1,1.tbz libXxf86vm-1.1.1.tbz libXdamage-1.1.3.tbz libXfixes-5.0.tbz libpthread-stubs-0.3_3.tbz libxcb-1.7.tbz kbproto-1.0.5.tbz libXau-1.0.6.tbz libXdmcp-1.1.0.tbz xproto-7.0.22.tbz pkg-config-0.25_1.tbz xextproto-7.2.0.tbz xf86vidmodeproto-2.3.1.tbz damageproto-1.2.1.tbz fixesproto-5.0.tbz gpac-libgpac-0.4.5_4,1.tbz gmake-3.82.tbz
adding dependencies
pkg_add libiconv-1.13.1_2.tbz
pkg_add gettext-0.18.1.1.tbz
pkg_add yasm-1.2.0.tbz
pkg_add bash-4.2.20.tbz
pkg_add binutils-2.22_1.tbz
pkg_add jpeg-8_3.tbz
pkg_add png-1.4.8_1.tbz
pkg_add libGL-7.4.4.tbz
pkg_add libGLU-7.4.4.tbz
pkg_add libdrm-2.4.12_1.tbz
skipping libdrm-2.4.12_1, already added
pkg_add expat-2.0.1_2.tbz
skipping expat-2.0.1_2, already added
pkg_add dri2proto-2.3.tbz
skipping dri2proto-2.3, already added
pkg_add libX11-1.4.4,1.tbz
skipping libX11-1.4.4,1, already added
pkg_add libXext-1.3.0_1,1.tbz
skipping libXext-1.3.0_1,1, already added
pkg_add libXxf86vm-1.1.1.tbz
skipping libXxf86vm-1.1.1, already added
pkg_add libXdamage-1.1.3.tbz
skipping libXdamage-1.1.3, already added
pkg_add libXfixes-5.0.tbz
skipping libXfixes-5.0, already added
pkg_add libpthread-stubs-0.3_3.tbz
skipping libpthread-stubs-0.3_3, already added
pkg_add libxcb-1.7.tbz
skipping libxcb-1.7, already added
pkg_add kbproto-1.0.5.tbz
skipping kbproto-1.0.5, already added
pkg_add libXau-1.0.6.tbz
skipping libXau-1.0.6, already added
pkg_add libXdmcp-1.1.0.tbz
skipping libXdmcp-1.1.0, already added
pkg_add xproto-7.0.22.tbz
skipping xproto-7.0.22, already added
pkg_add pkg-config-0.25_1.tbz
skipping pkg-config-0.25_1, already added
pkg_add xextproto-7.2.0.tbz
skipping xextproto-7.2.0, already added
pkg_add xf86vidmodeproto-2.3.1.tbz
skipping xf86vidmodeproto-2.3.1, already added
pkg_add damageproto-1.2.1.tbz
skipping damageproto-1.2.1, already added
pkg_add fixesproto-5.0.tbz
skipping fixesproto-5.0, already added
pkg_add gpac-libgpac-0.4.5_4,1.tbz
pkg_add gmake-3.82.tbz
===>   x264-0.119.2113 depends on package: yasm>=0.6.0 - found
===>   x264-0.119.2113 depends on file: /usr/local/bin/bash - found
===>   x264-0.119.2113 depends on file: /usr/local/bin/as - found
===>   x264-0.119.2113 depends on package: gpac-libgpac>=0.4.5,1 - found
===>   x264-0.119.2113 depends on executable: gmake - found
===>   x264-0.119.2113 depends on shared library: gpac.1 - found
===>  Configuring for x264-0.119.2113
===>   FreeBSD 10 autotools fix applied to /work/a/ports/multimedia/x264/work/x264-snapshot-20111220-2245-stable/configure
./version.sh: git: not found
platform:      X86
system:        FREEBSD
cli:           yes
libx264:       internal
shared:        yes
static:        yes
asm:           yes
interlaced:    yes
avs:           no
lavf:          no
ffms:          no
gpac:          yes
gpl:           yes
thread:        posix
filters:       crop select_every 
debug:         no
gprof:         no
strip:         no
PIC:           no
visualize:     no
bit depth:     8
chroma format: all

You can run 'make' or 'make fprofiled' now.
===>  Building for x264-0.119.2113
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/mc.c:27:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/predict.c:32:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/pixel.c:28:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/macroblock.c:29:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/frame.c:28:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/dct.c:28:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/cpu.c:29:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/cabac.c:28:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/common.c:27:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/osdep.c:27:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/rectangle.c:26:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/set.c:27:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/quant.c:29:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/deblock.c:29:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/vlc.c:28:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/mvpred.c:28:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/bitstream.c:27:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from encoder/analyse.c:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from encoder/me.c:28:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from encoder/ratecontrol.c:33:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from encoder/set.c:27:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from encoder/macroblock.c:29:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from encoder/cabac.c:28:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from encoder/cavlc.c:28:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from encoder/encoder.c:28:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from encoder/lookahead.c:39:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/threadpool.c:26:
In file included from common/common.h:938:
In file included from common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/x86/mc-c.c:32:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from common/x86/predict-c.c:28:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from x264.c:33:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from input/input.c:26:
In file included from input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from input/timecode.c:26:
In file included from input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from input/raw.c:28:
In file included from input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from input/y4m.c:27:
In file included from input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from output/raw.c:27:
In file included from output/output.h:30:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from output/matroska.c:26:
In file included from output/output.h:30:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from output/matroska_ebml.c:26:
In file included from output/output.h:30:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from output/flv.c:26:
In file included from output/output.h:30:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from output/flv_bytestream.c:26:
In file included from output/output.h:30:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from filters/filters.c:27:
In file included from filters/filters.h:30:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from filters/video/video.c:26:
In file included from filters/video/video.h:29:
In file included from ./input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from filters/video/source.c:26:
In file included from filters/video/video.h:29:
In file included from ./input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from filters/video/internal.c:26:
In file included from filters/video/internal.h:28:
In file included from filters/video/video.h:29:
In file included from ./input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from filters/video/resize.c:26:
In file included from filters/video/video.h:29:
In file included from ./input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from filters/video/cache.c:26:
In file included from filters/video/video.h:29:
In file included from ./input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from filters/video/fix_vfr_pts.c:26:
In file included from filters/video/video.h:29:
In file included from ./input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from filters/video/select_every.c:26:
In file included from filters/video/video.h:29:
In file included from ./input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from filters/video/crop.c:27:
In file included from filters/video/video.h:29:
In file included from ./input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from filters/video/depth.c:26:
In file included from filters/video/video.h:29:
In file included from ./input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from input/thread.c:27:
In file included from input/input.h:31:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
clang: warning: argument unused during compilation: '-mfpmath=sse'
clang: warning: argument unused during compilation: '-fno-tree-vectorize'
In file included from output/mp4.c:27:
In file included from output/output.h:30:
In file included from ./x264cli.h:30:
In file included from ./common/common.h:938:
In file included from ./common/x86/util.h:31:
In file included from /usr/include/clang/3.0/xmmintrin.h:31:
/usr/include/clang/3.0/mmintrin.h:28:2: error: #error "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
 ^
1 error generated.
gmake: *** [.depend] Error 1
*** [do-build] Error code 1

Stop in /a/ports/multimedia/x264.
================================================================
build of /usr/ports/multimedia/x264 ended at Mon Mar 12 21:18:18 CST 2012


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->dim 
Responsible-Changed-By: remko 
Responsible-Changed-When: Mon Mar 12 12:25:19 UTC 2012 
Responsible-Changed-Why:  
Reassign to dim@ 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165968 

From: Dimitry Andric <dim@FreeBSD.org>
To: bug-followup@FreeBSD.org, FreeBSD@Shaneware.biz
Cc:  
Subject: Re: i386/165968: clang on i386 tinderbox produces inconsistent defines
Date: Mon, 12 Mar 2012 21:43:57 +0100

 This is a multi-part message in MIME format.
 --------------080403030508070105060703
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 For clang 3.0, -msse does not automatically imply -mmmx, unfortunately.
 This was fixed in upstream later on, to better match gcc's behaviour:
 
   http://llvm.org/viewvc/llvm-project?view=rev&revision=145194
 
 You can try the attached patch, which fixes the problem without messing
 around to check for the clang version.
 
 I will also port back the fix to head, and merge it to stable later, but
 it would be a pity if people can't compile x264 unless they upgrade. :)
 
 --------------080403030508070105060703
 Content-Type: text/x-diff;
  name="clangports-multimedia-x264-1.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="clangports-multimedia-x264-1.diff"
 
 Index: multimedia/x264/files/patch-configure
 ===================================================================
 RCS file: multimedia/x264/files/patch-configure
 diff -N multimedia/x264/files/patch-configure
 --- /dev/null	1 Jan 1970 00:00:00 -0000
 +++ multimedia/x264/files/patch-configure	12 Mar 2012 20:22:48 -0000
 @@ -0,0 +1,11 @@
 +--- configure.orig	2012-03-12 21:07:55.000000000 +0100
 ++++ configure	2012-03-12 21:08:40.000000000 +0100
 +@@ -496,7 +496,7 @@ case $host_cpu in
 +                 CFLAGS="$CFLAGS -march=i686"
 +             fi
 +             if [[ "$asm" == auto && "$CFLAGS" != *-mfpmath* ]]; then
 +-                CFLAGS="$CFLAGS -mfpmath=sse -msse"
 ++                CFLAGS="$CFLAGS -mfpmath=sse -msse -mmmx"
 +             fi
 +         else
 +             # icc on linux has various degrees of mod16 stack support
 
 --------------080403030508070105060703--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/165968: commit references a PR
Date: Mon, 12 Mar 2012 21:07:32 +0000 (UTC)

 Author: dim
 Date: Mon Mar 12 21:07:22 2012
 New Revision: 232894
 URL: http://svn.freebsd.org/changeset/base/232894
 
 Log:
   Pull in r145194 from upstream clang trunk:
   
     Make our handling of MMX x SSE closer to what gcc does:
   
     * Enabling sse enables mmx.
     * Disabling (-mno-mmx) mmx, doesn't disable sse (we got this right already).
     * The order in not important. -msse -mno-mmx is the same as -mno-mmx -msse.
   
   Some configure scripts depend on this.
   
   PR:		i386/165968
   MFC after:	3 days
 
 Modified:
   head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
 
 Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
 ==============================================================================
 --- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp	Mon Mar 12 20:59:18 2012	(r232893)
 +++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp	Mon Mar 12 21:07:22 2012	(r232894)
 @@ -1583,23 +1583,26 @@ bool X86TargetInfo::setFeatureEnabled(ll
        (Name != "sse4" && Name != "sse4.2" && Name != "sse4.1"))
      return false;
  
 +  // FIXME: this should probably use a switch with fall through.
 +
    if (Enabled) {
      if (Name == "mmx")
        Features["mmx"] = true;
      else if (Name == "sse")
 -      Features["sse"] = true;
 +      Features["mmx"] = Features["sse"] = true;
      else if (Name == "sse2")
 -      Features["sse"] = Features["sse2"] = true;
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = true;
      else if (Name == "sse3")
 -      Features["sse"] = Features["sse2"] = Features["sse3"] = true;
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
 +        true;
      else if (Name == "ssse3")
 -      Features["sse"] = Features["sse2"] = Features["sse3"] =
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
          Features["ssse3"] = true;
      else if (Name == "sse4" || Name == "sse4.2")
 -      Features["sse"] = Features["sse2"] = Features["sse3"] =
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
          Features["ssse3"] = Features["sse41"] = Features["sse42"] = true;
      else if (Name == "sse4.1")
 -      Features["sse"] = Features["sse2"] = Features["sse3"] =
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
          Features["ssse3"] = Features["sse41"] = true;
      else if (Name == "3dnow")
        Features["mmx"] = Features["3dnow"] = true;
 @@ -1608,10 +1611,11 @@ bool X86TargetInfo::setFeatureEnabled(ll
      else if (Name == "aes")
        Features["aes"] = true;
      else if (Name == "avx")
 -      Features["avx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
 -        Features["ssse3"] = Features["sse41"] = Features["sse42"] = true;
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
 +        Features["ssse3"] = Features["sse41"] = Features["sse42"] =
 +        Features["avx"] = true;
      else if (Name == "sse4a")
 -      Features["sse4a"] = true;
 +      Features["mmx"] = Features["sse4a"] = true;
    } else {
      if (Name == "mmx")
        Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = false;
 @@ -3779,13 +3783,32 @@ TargetInfo *TargetInfo::CreateTargetInfo
    Target->getDefaultFeatures(Features);
  
    // Apply the user specified deltas.
 +  // First the enables.
    for (std::vector<std::string>::const_iterator it = Opts.Features.begin(),
           ie = Opts.Features.end(); it != ie; ++it) {
      const char *Name = it->c_str();
  
 +    if (Name[0] != '+')
 +      continue;
 +
 +    // Apply the feature via the target.
 +    if (!Target->setFeatureEnabled(Features, Name + 1, true)) {
 +      Diags.Report(diag::err_target_invalid_feature) << Name;
 +      return 0;
 +    }
 +  }
 +
 +  // Then the disables.
 +  for (std::vector<std::string>::const_iterator it = Opts.Features.begin(),
 +         ie = Opts.Features.end(); it != ie; ++it) {
 +    const char *Name = it->c_str();
 +
 +    if (Name[0] == '+')
 +      continue;
 +
      // Apply the feature via the target.
 -    if ((Name[0] != '-' && Name[0] != '+') ||
 -        !Target->setFeatureEnabled(Features, Name + 1, (Name[0] == '+'))) {
 +    if (Name[0] != '-' ||
 +        !Target->setFeatureEnabled(Features, Name + 1, false)) {
        Diags.Report(diag::err_target_invalid_feature) << Name;
        return 0;
      }
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: Shane Ambler <FreeBSD@ShaneWare.Biz>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/165968: clang on i386 tinderbox produces inconsistent defines
Date: Tue, 13 Mar 2012 12:37:16 +1030

 The x264 patch allows x264 to compile on i386 with clang.
 
 I had thought it would go to the configure tests detecting sse and not
 mmx. Which may be a mute point though - does anyone have a non-sse cpu
 still running? Maybe the minimum cpu of i686 for x86 could be raised?
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/165968: commit references a PR
Date: Mon, 19 Mar 2012 08:10:44 +0000 (UTC)

 Author: dim
 Date: Mon Mar 19 08:10:23 2012
 New Revision: 233166
 URL: http://svn.freebsd.org/changeset/base/233166
 
 Log:
   MFC r232894:
     Pull in r145194 from upstream clang trunk:
   
       Make our handling of MMX x SSE closer to what gcc does:
   
       * Enabling sse enables mmx.
       * Disabling (-mno-mmx) mmx, doesn't disable sse (we got this right already).
       * The order in not important. -msse -mno-mmx is the same as -mno-mmx -msse.
   
     Some configure scripts depend on this.
   
     PR:		i386/165968
   
   MFC r232933:
     Update comments and CFLAGS in sys/conf/kern.mk, introduced in r221879,
     to match reality: clang does _not_ disable SSE automatically when
     -mno-mmx is used, you have to specify -mno-sse explicitly.
   
     Note this was the case even before r232894, which only makes a change in
     the 'positive' flag case; e.g. when you specify -msse, MMX gets enabled
     too.
 
 Modified:
   stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
   stable/9/sys/conf/kern.mk
 Directory Properties:
   stable/9/contrib/llvm/   (props changed)
   stable/9/contrib/llvm/tools/clang/   (props changed)
   stable/9/sys/   (props changed)
   stable/9/sys/conf/   (props changed)
 
 Modified: stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
 ==============================================================================
 --- stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp	Mon Mar 19 07:34:09 2012	(r233165)
 +++ stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp	Mon Mar 19 08:10:23 2012	(r233166)
 @@ -1583,23 +1583,26 @@ bool X86TargetInfo::setFeatureEnabled(ll
        (Name != "sse4" && Name != "sse4.2" && Name != "sse4.1"))
      return false;
  
 +  // FIXME: this should probably use a switch with fall through.
 +
    if (Enabled) {
      if (Name == "mmx")
        Features["mmx"] = true;
      else if (Name == "sse")
 -      Features["sse"] = true;
 +      Features["mmx"] = Features["sse"] = true;
      else if (Name == "sse2")
 -      Features["sse"] = Features["sse2"] = true;
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = true;
      else if (Name == "sse3")
 -      Features["sse"] = Features["sse2"] = Features["sse3"] = true;
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
 +        true;
      else if (Name == "ssse3")
 -      Features["sse"] = Features["sse2"] = Features["sse3"] =
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
          Features["ssse3"] = true;
      else if (Name == "sse4" || Name == "sse4.2")
 -      Features["sse"] = Features["sse2"] = Features["sse3"] =
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
          Features["ssse3"] = Features["sse41"] = Features["sse42"] = true;
      else if (Name == "sse4.1")
 -      Features["sse"] = Features["sse2"] = Features["sse3"] =
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
          Features["ssse3"] = Features["sse41"] = true;
      else if (Name == "3dnow")
        Features["mmx"] = Features["3dnow"] = true;
 @@ -1608,10 +1611,11 @@ bool X86TargetInfo::setFeatureEnabled(ll
      else if (Name == "aes")
        Features["aes"] = true;
      else if (Name == "avx")
 -      Features["avx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
 -        Features["ssse3"] = Features["sse41"] = Features["sse42"] = true;
 +      Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
 +        Features["ssse3"] = Features["sse41"] = Features["sse42"] =
 +        Features["avx"] = true;
      else if (Name == "sse4a")
 -      Features["sse4a"] = true;
 +      Features["mmx"] = Features["sse4a"] = true;
    } else {
      if (Name == "mmx")
        Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = false;
 @@ -3779,13 +3783,32 @@ TargetInfo *TargetInfo::CreateTargetInfo
    Target->getDefaultFeatures(Features);
  
    // Apply the user specified deltas.
 +  // First the enables.
    for (std::vector<std::string>::const_iterator it = Opts.Features.begin(),
           ie = Opts.Features.end(); it != ie; ++it) {
      const char *Name = it->c_str();
  
 +    if (Name[0] != '+')
 +      continue;
 +
 +    // Apply the feature via the target.
 +    if (!Target->setFeatureEnabled(Features, Name + 1, true)) {
 +      Diags.Report(diag::err_target_invalid_feature) << Name;
 +      return 0;
 +    }
 +  }
 +
 +  // Then the disables.
 +  for (std::vector<std::string>::const_iterator it = Opts.Features.begin(),
 +         ie = Opts.Features.end(); it != ie; ++it) {
 +    const char *Name = it->c_str();
 +
 +    if (Name[0] == '+')
 +      continue;
 +
      // Apply the feature via the target.
 -    if ((Name[0] != '-' && Name[0] != '+') ||
 -        !Target->setFeatureEnabled(Features, Name + 1, (Name[0] == '+'))) {
 +    if (Name[0] != '-' ||
 +        !Target->setFeatureEnabled(Features, Name + 1, false)) {
        Diags.Report(diag::err_target_invalid_feature) << Name;
        return 0;
      }
 
 Modified: stable/9/sys/conf/kern.mk
 ==============================================================================
 --- stable/9/sys/conf/kern.mk	Mon Mar 19 07:34:09 2012	(r233165)
 +++ stable/9/sys/conf/kern.mk	Mon Mar 19 08:10:23 2012	(r233166)
 @@ -46,16 +46,16 @@ CWARNEXTRA?=	-Wno-error-tautological-com
  # Setting -mno-sse implies -mno-sse2, -mno-sse3 and -mno-ssse3
  #
  # clang:
 -# Setting -mno-mmx implies -mno-3dnow, -mno-3dnowa, -mno-sse, -mno-sse2,
 -#                          -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42
 +# Setting -mno-mmx implies -mno-3dnow and -mno-3dnowa
 +# Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42
  #
  .if ${MACHINE_CPUARCH} == "i386"
  .if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang"
 -CFLAGS+=	-mno-align-long-strings -mpreferred-stack-boundary=2 -mno-sse
 +CFLAGS+=	-mno-align-long-strings -mpreferred-stack-boundary=2
  .else
  CFLAGS+=	-mno-aes -mno-avx
  .endif
 -CFLAGS+=	-mno-mmx -msoft-float
 +CFLAGS+=	-mno-mmx -mno-sse -msoft-float
  INLINE_LIMIT?=	8000
  .endif
  
 @@ -93,17 +93,15 @@ INLINE_LIMIT?=	15000
  # Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3 and -mfpmath=387
  #
  # clang:
 -# Setting -mno-mmx implies -mno-3dnow, -mno-3dnowa, -mno-sse, -mno-sse2,
 -#                          -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42
 +# Setting -mno-mmx implies -mno-3dnow and -mno-3dnowa
 +# Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42
  # (-mfpmath= is not supported)
  #
  .if ${MACHINE_CPUARCH} == "amd64"
 -.if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang"
 -CFLAGS+=	-mno-sse
 -.else
 +.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang"
  CFLAGS+=	-mno-aes -mno-avx
  .endif
 -CFLAGS+=	-mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float \
 +CFLAGS+=	-mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float \
  		-fno-asynchronous-unwind-tables
  INLINE_LIMIT?=	8000
  .endif
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: dim 
State-Changed-When: Sat Jul 28 11:51:39 UTC 2012 
State-Changed-Why:  
Fixed in head (r232894) and stable/9 (r233166). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165968 
>Unformatted:
