Many ports have -msse2 on 32-bit version FreeBSD. I think it's incorrect, many modern 32-bit processor have SSE but SSE2 isn't. As example affected many QT4/5 ports: From devel/qt5-core: c++ -c -O2 -pipe -fstack-protector -fno-strict-aliasing -msse2 -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -O3 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -Wall -W -pthread -D_THREAD_SAFE -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_GLIB -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_USE_ICU -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -I. -I../../include -I../../include/QtCore -I../../include/QtCore/5.4.1 -I../../include/QtCore/5.4.1/QtCore -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I.moc -I/usr/local/lib/qt5/mkspecs/freebsd-clang -o .obj/qabstractanimation.o animation/qabstractanimation.cpp Even is define (in make.conf as CPUTYPE) processor without SSE2 support: c++ -c -O2 -pipe -march=athlon-xp -fstack-protector -fno-strict-aliasing -msse2 -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -O3 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -Wall -W -pthread -D_THREAD_SAFE -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_GLIB -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_USE_ICU -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -I. -I../../include -I../../include/QtCore -I../../include/QtCore/5.4.1 -I../../include/QtCore/5.4.1/QtCore -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I.moc -I/usr/local/lib/qt5/mkspecs/freebsd-clang -o .obj/qdatetime.o tools/qdatetime.cpp
A similar bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198296
devel/sdl20 have same issue: libtool: compile: cc -O2 -pipe -march=athlon-xp -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing -I/usr/local/include -DLIBICONV_PLUG -DUSING_GENERATED_CONFIG_H -Iinclude -I/usr/ports/devel/sdl20/work/SDL2-2.0.3/include -mmmx -msse -msse2 -fvisibility=hidden -I/usr/local/include -DHAVE_USBHID_H -DUSBHID_NEW -D_REENTRANT -D_THREAD_SAFE -Wall -MMD -MT build/SDL_sysfilesystem.lo -c /usr/ports/devel/sdl20/work/SDL2-2.0.3/src/filesystem/unix/SDL_sysfilesystem.c -fPIC -DPIC -o build/.libs/SDL_sysfilesystem.o libtool: compile: cc -O2 -pipe -march=athlon-xp -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing -I/usr/local/include -DLIBICONV_PLUG -DUSING_GENERATED_CONFIG_H -Iinclude -I/usr/ports/devel/sdl20/work/SDL2-2.0.3/include -mmmx -msse -msse2 -fvisibility=hidden -I/usr/local/include -DHAVE_USBHID_H -DUSBHID_NEW -D_REENTRANT -D_THREAD_SAFE -Wall -MMD -MT build/SDL_sysfilesystem.lo -c /usr/ports/devel/sdl20/work/SDL2-2.0.3/src/filesystem/unix/SDL_sysfilesystem.c -o build/SDL_sysfilesystem.o >/dev/null 2>&1
Created attachment 156602 [details] sdl20 cpu autodetect patch This patch replaces MMX and SSE options in devel/sdl20 with autodetection based on CPUTYPE.
I think this may depend entirely on the port. In your example of devel/sdl20, its Makefile contains: OPTIONS_DEFINE= ALSA ASM DLOPEN ESOUND MMX NAS OSS \ PULSEAUDIO PTHREADS SSE SDL_ATOMIC SDL_AUDIO \ SDL_CPUINFO SDL_EVENTS SDL_FILE SDL_HAPTIC \ SDL_JOYSTICK SDL_LOADSO SDL_POWER SDL_RENDER \ SDL_THREADS SDL_TIMERS SDL_VIDEO VIDEO_OPENGL VIDEO_X11 OPTIONS_DEFAULT= ASM DLOPEN OSS PTHREADS SDL_ATOMIC SDL_AUDIO \ SDL_CPUINFO SDL_EVENTS SDL_FILE SDL_HAPTIC \ SDL_JOYSTICK SDL_LOADSO SDL_POWER SDL_RENDER \ SDL_THREADS SDL_TIMERS SDL_VIDEO VIDEO_OPENGL VIDEO_X11 OPTIONS_DEFAULT_i386= MMX SSE OPTIONS_DEFAULT_amd64= MMX SSE and then later on: SSE_CONFIGURE_ENABLE= sse sse2 ssemath this causes bsd.options.mk to pass all three as 'enable' options to sdl20's configure script: # ${opt}_CONFIGURE_ENABLE Will add to CONFIGURE_ARGS: # Option enabled --enable-${content} # Option disabled --disable-${content} So in case of the sdl20 port, enabling the *port* SSE option will enable both the SSE and SSE2 *configure* options. This is probably debatable. But it is trickier to have two separate port options for SSE and SSE2, I guess.
Created attachment 156606 [details] qt5 cpu autodetect patch Qt 5.3 uses SSE2 by default. Pass -no-sse2 to configure on i386 when SSE2 isn't supported.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200234 opencv-core sse2 and even sse3 on i386
Can you please create a separate bug for that? It will be auto-assigned to the maintainer so he can have a look.
(In reply to Tijl Coosemans from comment #7) devel/qt5-core https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200258
Here is idea of universal solution for incorrect vendor optimization: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200262
A commit references this bug: Author: tijl Date: Sun May 24 16:41:18 UTC 2015 New revision: 387281 URL: https://svnweb.freebsd.org/changeset/ports/387281 Log: Qt 5.3 removed runtime detection of SSE2 so it needs to be configured with -no-sse2 at buildtime on i386. PR: 198738, 200258 Reported by: sasamotikomi@gmail.com Approved by: maintainer timeout (2 weeks) Changes: head/Mk/bsd.qt.mk head/devel/qt5-core/Makefile head/x11-toolkits/qt5-declarative/Makefile head/x11-toolkits/qt5-gui/Makefile
A commit references this bug: Author: tijl Date: Sun May 24 16:48:41 UTC 2015 New revision: 387283 URL: https://svnweb.freebsd.org/changeset/ports/387283 Log: Replace MMX and SSE options with CPU autodetection such that they aren't enabled by default on i386. PR: 198738 Approved by: maintainer timeout (2 weeks) Changes: head/devel/sdl20/Makefile
I reopen bug until problem with sdl2,opencv-core, fftw3 isn't fixed: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194861 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200234 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198296
There's nothing more to work on in this bug. It provides no additional information over those three bugs you mention. The problem of incorrect compiler flags is also different for every port with patches that are entirely different for every port so there's no point in keeping a general bug like this. Please close it again.
(In reply to Tijl Coosemans from comment #13) I use this bug as aggregator for similar issues. I can close it but I afraid we can forgot about this issue type. I don't know how much ports affected it issue, I think better close this pr when all similar issues will be solved.(It's give time to find more of similar issues.)
Close: such problems should individually for each affected port