Bug 36422

Summary: [Qt] Qt 4.6.2 does not build with ICC (QtWebKit, Ubuntu)
Product: WebKit Reporter: Alex <qtcreatorgeek>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: benjamin, cmarcelo, hausmann, kent.hansen, menard, ogoffart
Priority: P3 Keywords: Qt, QtTriaged
Version: 420+   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Fragment of make output that shows a compilation error. none

Description Alex 2010-03-20 21:07:30 PDT
Compilation of WebKit fails when Qt is compiled with ICC on Ubuntu. Errors are generated when trying to compile "asm volatile" statements. Please see the attached file that has make output for one of the same multiple errors.

Environment: Ubuntu 9.10, Qt 4.6.2, ICC 11.1.069
Comment 1 Simon Hausmann 2010-03-21 16:13:26 PDT
Could you attach the missing file that shows the compilation error messages?
Comment 2 Alex 2010-03-22 20:13:28 PDT
Created attachment 51389 [details]
Fragment of make output that shows a compilation error.
Comment 3 Kent Hansen 2010-04-21 06:57:05 PDT
Yeah, I can reproduce this.
ICC defines __GNUC__, which causes COMPILER(GCC) to be defined. But, as with the MSVC compatibility (see http://trac.webkit.org/changeset/51484), it seems it's not fully compatible.

According to http://software.intel.com/sites/products/documentation/studio/composer/en-us/2009/compiler_c/intref_cls/common/intref_data_align_ma_ia_linux_ia.htm , GNU-style inline assembly should be supported. I tried with __asm and __asm__ as well, no luck.

If Google translated the comment to http://qtcreatorgeek.blogspot.com/2010/03/qt-icc-ubuntu_20.html correctly, it's only a problem with ia32, but I can't confirm that.

I was able to make JavaScriptCore compile by doing the following in JavaScriptCore/wtf/Platform.h:

@@ -73,7 +73,7 @@

 /* COMPILER(GCC) - GNU Compiler Collection */
 /* --gnu option of the RVCT compiler also defines __GNUC__ */
-#if defined(__GNUC__) && !COMPILER(RVCT)
+#if defined(__GNUC__) && !COMPILER(RVCT) && !defined(__INTEL_COMPILER)
 #define WTF_COMPILER_GCC 1
 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
 #endif

i.e. don't define COMPILER(GCC) if we're compiling with Intel Compiler. I don't know how far-reaching that change will be, however. (There are about 40 places besides JITStubs.cpp that check for COMPILER(GCC).) QtScript 4.7 tests all pass.

Doing the __INTEL_COMPILER check locally in JITStubs.cpp is not enough; then you hit #error "JIT not supported on this platform."

So unless somebody knows how to do the inline assembly with ICC, the alternative is to disable the JIT on linux-icc.

Note that other projects have also had problems with ICC defining __GNUC__:
http://groups.google.com/group/perl.perl6.internals/browse_thread/thread/1d658e87ded6601e
http://www.mail-archive.com/perl5-changes@perl.org/msg13780.html
Comment 4 Olivier Goffart 2010-11-23 06:52:28 PST
The fix on x86 is there:

http://gitorious.org/+qtwebkit-developers/webkit/qtwebkit/commit/1f6f32d8010ee71dc33daafc7746ec0f302f26ae

Note that the exact same fix need to be done as well for x86_64
Comment 5 Benjamin Poulain 2011-01-30 09:05:55 PST
Olivier, should we close this bug? Does trunk build on ICC?
Comment 6 Alexis Menard (darktears) 2011-02-23 15:23:11 PST
Qt 4.7 branch doesn't even build on a 64 bits Arch with icc 64 :). I tried the same patch as the 32 bits in the 64 part but no luck. Perhaps I mess up it is late already :). Olivier ?
Comment 7 Alexis Menard (darktears) 2011-02-24 08:12:30 PST
Update : Trunk does not build even with JIT disabled :).
Comment 8 Alexis Menard (darktears) 2011-02-24 13:26:32 PST
My version is 11.1 perhaps I should upgrade to 12.
Comment 9 Alexis Menard (darktears) 2011-02-25 10:18:29 PST
Trunk builds now fine with ICC 12.x (one SVG patch is still pending review). It compiles and seems to run fine with JIT off so I suggest that in order to be safe we should deactivate JIT. If we build with JIT it crashes. We don't have that much resources to track ICC so let's play it safe and let's disable JIT by default. If some Indiana Jones wants to try with JIT then they just pass DEFINES+=ENABLE_JIT=1.

Anyway the long term is perhaps V8 perhaps it's worth to check there too.

Any objections? If not then I will make the patch.
Comment 10 Alexis Menard (darktears) 2011-02-25 10:21:57 PST
Disable JIT for ICC if it was not clear enough :)
Comment 11 Jocelyn Turcotte 2014-02-03 03:16:20 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.