Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

qt 4.8.6 failed to build on 10.6 #28859

Closed
Sean1708 opened this issue Apr 30, 2014 · 34 comments
Closed

qt 4.8.6 failed to build on 10.6 #28859

Sean1708 opened this issue Apr 30, 2014 · 34 comments

Comments

@Sean1708
Copy link

Upgrading qt failed, most likely with the error '_mm_alignr_epi8 not declared in this scope'.

Gist (as per the troubleshooting checklist) is here: https://gist.github.com/Sean1708/ea4873c3899bcd4606bc

@MikeMcQuaid
Copy link
Member

Try and make this change to the formula file and see if that fixes it:

-    args << "-no-3dnow" if superenv?
+    args << '-no-3dnow' << '-no-ssse3' if superenv?

@ryanshaw
Copy link

@MikeMcQuaid that change made it work for me here.

@MikeMcQuaid
Copy link
Member

@dakcarto ☝️

Perhaps we should enable it just for 10.6 (although I've a feeling we perhaps did that before).

@a5sk4s
Copy link

a5sk4s commented Apr 30, 2014

worked for me as well - thanks for such a quick workaround

@dakcarto
Copy link
Contributor

@MikeMcQuaid wrote:

Perhaps we should enable it just for 10.6

Sure. I don't know enough about SSE (or what's supposedly fixed in the latest 4.8.6, but that doesn't work for 10.6) to really have a valid opinion here. Haven't compiled under 10.6 yet.

@ryanshaw @a5sk4s
Is everyone here saying that it is now building specifically for 10.6 (but wasn't before), or did anyone also have trouble with other OS versions?

@a5sk4s
Copy link

a5sk4s commented Apr 30, 2014

it was on 10.6.8 for me

@ryanshaw
Copy link

I misspoke earlier, I'm on 10.9.2 but also could not compile qt 4.8.6. That tweak mentioned by @MikeMcQuaid fixed it for me. Apologies for the confusion.

@dakcarto
Copy link
Contributor

Here's the Qt source commit: https://qt.gitorious.org/qt/qt/commit/1c0a1ebba12c9c1fa02117b9a017c4ed3f7cd7c3

Seems with the cascading, that adding -no-ssse3 should keep any of the 4.x code blocks from being executed in <qt src>/src/corelib/tools/qstring.cpp's mergeQuestionMarks(). So I wonder why I had the opposite error in 10.7.5?

@dakcarto
Copy link
Contributor

Ok, this patch fixed the compiling issue I had on 10.7.5.

Odd, though, because the same qstring.cpp existed in Qt 4.8.5. Something more going on with the SSE defines.

@andreasgerstmayr
Copy link
Contributor

the commit 37c8e4b breaks the build on OS X 10.9.2:

tools/qstring.cpp:3603:22: error: use of undeclared identifier '_SIDD_UWORD_OPS'
    const int mode = _SIDD_UWORD_OPS | _SIDD_CMP_RANGES | _SIDD_UNIT_MASK;
                     ^
tools/qstring.cpp:3603:40: error: use of undeclared identifier '_SIDD_CMP_RANGES'
    const int mode = _SIDD_UWORD_OPS | _SIDD_CMP_RANGES | _SIDD_UNIT_MASK;
                                       ^
tools/qstring.cpp:3603:59: error: use of undeclared identifier '_SIDD_UNIT_MASK'
    const int mode = _SIDD_UWORD_OPS | _SIDD_CMP_RANGES | _SIDD_UNIT_MASK;
                                                          ^
tools/qstring.cpp:3605:34: error: use of undeclared identifier '_mm_cmpestrm'
    const __m128i offLimitMask = _mm_cmpestrm(rangeMatch, 2, chunk, 8, mode);
                                 ^
/private/tmp/qt-6VoF/qt-everywhere-opensource-src-4.8.6/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG_PLUGIN_CHECK -DQT_NO_DEBUG -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/unsupported/macx-clang-libc++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../../tools/shared -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared -D__APPLE__ -D__GNUC__ io/qbuffer.h -o .moc/release-shared/moc_qbuffer.cpp
tools/qstring.cpp:3608:13: error: use of undeclared identifier '_mm_blendv_epi8'
    chunk = _mm_blendv_epi8(chunk, questionMark, offLimitMask);
            ^
clang++ -c -pipe -stdlib=libc++ -mmacosx-version-min=10.7 -I/opt/X11/include -I/usr/local/opt/d-bus/lib/dbus-1.0/include -I/usr/local/opt/d-bus/include/dbus-1.0 -O2 -arch x86_64 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG_PLUGIN_CHECK -DQT_NO_DEBUG -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/unsupported/macx-clang-libc++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../../tools/shared -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared -o .obj/release-shared/qdatastream.o io/qdatastream.cpp
5 errors generated.
make[2]: *** [.obj/release-shared/qstring.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [release] Error 2
make: *** [sub-corelib-make_default-ordered] Error 2

when I revert the changes of this commit the build works.

@dakcarto
Copy link
Contributor

dakcarto commented May 1, 2014

@andihit Try this formula with included patch for that issue (noted above).

However, did not have the issue here on 10.9.2 with current formula.

HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 9362781dd8822650b7e3714cff5d1aa004f116d3
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit haswell
OS X: 10.9.2-x86_64
Xcode: 5.1
CLT: 5.1.0.0.1.1396320587
GCC-4.2: build 5666
Clang: 5.1 build 503
X11: 2.7.5 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby

@MikeMcQuaid
Copy link
Member

@dakcarto I'm guessing it'll depend on your hardware whether you have this problem or not. Could you submit this patch to Qt's Gerrit: https://codereview.qt-project.org/

@dakcarto
Copy link
Contributor

dakcarto commented May 1, 2014

Qt Gerrit patch set uploaded for review and bug report added.

@MikeMcQuaid
Copy link
Member

Perfect, thanks @dakcarto. Happy to apply that patch in a PR too now it's reported. You're a model open-source citizen 👼

@Sean1708
Copy link
Author

Sean1708 commented May 2, 2014

Thanks guys, works perfectly now.

@dakcarto
Copy link
Contributor

dakcarto commented May 2, 2014

@Sean1708 Thanks for the feedback. What worked for you? The current formula in main tap, or did you specifically try the one I noted here?

@dakcarto
Copy link
Contributor

dakcarto commented May 2, 2014

@MikeMcQuaid Do you mind taking some time to review the Qt bug report?

If there is a flaw in my logic, or superenv is doing something I am unaware of, I'd appreciate knowing. Having some difficulty getting the reviewer (who also created the issue with their commit) to understand the situation.

Could be that I just don't know enough about how SS(S)E optimization is triggered at the compiler level. Otherwise, I think my argument/patch in the report is pretty sound.

@GuillaumeDIDIER
Copy link
Contributor

The commit has broken qt for me on 10.9.2
Reverting the changes worked.
It was broken in string.cpp ~3600
Reverting the change made it work.
Having investigated the source code I think that the patch in the formula seems to be the right thing to do.
Also has someone looked into 10.6 breakage to see why qt+superenv gets messed up.

@MikeMcQuaid
Copy link
Member

@GuillaumeDIDIER Can you try @dakcarto's patch.

@MikeMcQuaid
Copy link
Member

@dakcarto Think you're probably fighting a losing battle there. Can we just specify more configure arguments when using superenv to e.g. disable SSE4.2?

@MikeMcQuaid
Copy link
Member

Can anyone still having issues here (@justinclift and @robsonpeixoto too) confirm if this fixes them for you:

-    args << "-no-3dnow" << "-no-ssse3" if superenv?
+    args << "-no-3dnow" << "-no-ssse3" << "-no-sse4.1" << "-no-sse4.2" if superenv?

@MikeMcQuaid
Copy link
Member

I suspect given the resistance of getting this patch merged upstream we may need to remove the no-X superenv args, fix the underlying issue and submit a patch upstream. This should be possible given it's working in Qt5.

@robsonpeixoto
Copy link
Contributor

@MikeMcQuaid same problem

tools/qstring.cpp:3603:22: error: use of undeclared identifier '_SIDD_UWORD_OPS'
    const int mode = _SIDD_UWORD_OPS | _SIDD_CMP_RANGES | _SIDD_UNIT_MASK;
                     ^
tools/qstring.cpp:3603:40: error: use of undeclared identifier '_SIDD_CMP_RANGES'
    const int mode = _SIDD_UWORD_OPS | _SIDD_CMP_RANGES | _SIDD_UNIT_MASK;
                                       ^
tools/qstring.cpp:3603:59: error: use of undeclared identifier '_SIDD_UNIT_MASK'
    const int mode = _SIDD_UWORD_OPS | _SIDD_CMP_RANGES | _SIDD_UNIT_MASK;
                                                          ^
tools/qstring.cpp:3605:34: error: use of undeclared identifier '_mm_cmpestrm'
    const __m128i offLimitMask = _mm_cmpestrm(rangeMatch, 2, chunk, 8, mode);
                                 ^
tools/qstring.cpp:3608:13: error: use of undeclared identifier '_mm_blendv_epi8'
    chunk = _mm_blendv_epi8(chunk, questionMark, offLimitMask);
            ^
5 errors generated.

@MikeMcQuaid
Copy link
Member

I guess we should perhaps just apply @dakcarto's patch in the mean time until we work out a better solution.

@justinclift
Copy link
Contributor

Things still barf on OSX 10.7.5 when using this line:

args << "-no-3dnow" << "-no-ssse3" << "-no-sse4.1" << "-no-sse4.2" if superenv?

@dakcarto's patch worked though.

@dakcarto
Copy link
Contributor

dakcarto commented May 5, 2014

@MikeMcQuaid Regarding the addition of -no-sse4.x flags, due to the cascading-up changes between 4.8.5 and .6 setting any of the lower flags to no automatically sets the higher ones to no as well. Although the compiler may support SSE4.x (and be compiling the rest of Qt that way), having any -no-X effectively negates including the appropriate headers for the SSE-specific code in Qt.

I really have no clue as to the logic of why the patch is not being applied upstream. I can't think of anything to add to the upstream bug report, or any other way to fix it. Removing all -no-ss(s)e flags and trying to patch the specific SSSE3 issue for some compilers may be the only alternative (as you noted).

@MikeMcQuaid
Copy link
Member

People may want to test out #28985 as it seems to fix all these issues.

@dakcarto
Copy link
Contributor

dakcarto commented May 5, 2014

@MikeMcQuaid That PR fixes the build issues here on 10.7.5. Thanks!

@robsonpeixoto
Copy link
Contributor

@MikeMcQuaid That PR fixes the build issues here on 10.9.2. Thanks!

@Sean1708
Copy link
Author

Sean1708 commented May 6, 2014

@dakcarto Sorry I didn't get back to you earlier, the main tap worked for me on the day I posted that comment.

@jacknagel
Copy link
Contributor

Fixes for this just went into master, let us know if there are any further issues.

@mattmartini
Copy link

@jacknagel On 10.8.5 I was seeing the "error: use of undeclared identifier '_mm_blendv_epi8'" issue. After pulling the latest master the build worked.

@justinclift
Copy link
Contributor

Yep, worked here too. qt 4.8.6 compiled fine.

@MikeMcQuaid
Copy link
Member

@jacknagel Thanks for this.

dgoodlad added a commit to boxen/puppet-qt that referenced this issue May 21, 2014
@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests