Bug 25654 - Does not compile on X86_64
Summary: Does not compile on X86_64
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-08 15:57 PDT by Sebastian
Modified: 2009-05-10 07:31 PDT (History)
0 users

See Also:


Attachments
fix patch (1.20 KB, patch)
2009-05-08 15:58 PDT, Sebastian
ggaren: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian 2009-05-08 15:57:07 PDT
Build fails on x86_64

/doltlibtool --tag=CXX   --mode=compile g++ -Wl,--as-needed -DHAVE_CONFIG_H -I. -I..  -DWTF_USE_ICU_UNICODE=1 -DBUILDING_CAIRO__=1 -DBUILDING_GTK__=1 -DWTF_CHANGES -DPACKAGE_LOCALE_DIR=\"/usr/share/locale\"  -DXP_UNIX -DNDEBUG    -I../JavaScriptCore -I../JavaScriptCore/ForwardingHeaders -I../JavaScriptCore/parser -I../JavaScriptCore/wtf -I./DerivedSources -I../JavaScriptCore/API -I../JavaScriptCore/ForwardingHeaders -I../JavaScriptCore/interpreter -I../JavaScriptCore/bytecode -I../JavaScriptCore/bytecompiler -I../JavaScriptCore/debugger -I../JavaScriptCore/jit -I../JavaScriptCore/pcre -I../JavaScriptCore/profiler -I../JavaScriptCore/runtime -I../JavaScriptCore/wrec -I../JavaScriptCore/jit -I../JavaScriptCore/assembler -I../JavaScriptCore/wtf/unicode -I../JavaScriptCore/yarr -I./JavaScriptCore/pcre -I./JavaScriptCore/parser -I./JavaScriptCore/runtime  -fvisibility-inlines-hidden -fno-rtti -fstrict-aliasing -O3 -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k -Wundef -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-unused-parameter -Wno-parentheses -fno-exceptions -fvisibility=hidden -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -D_REENTRANT -I/usr/include -g -Wall -O2 -O2 -MT JavaScriptCore/jit/libJavaScriptCore_la-JITArithmetic.lo -MD -MP -MF JavaScriptCore/jit/.deps/libJavaScriptCore_la-JITArithmetic.Tpo -c -o JavaScriptCore/jit/libJavaScriptCore_la-JITArithmetic.lo `test -f 'JavaScriptCore/jit/JITArithmetic.cpp' || echo '../'`JavaScriptCore/jit/JITArithmetic.cpp
../JavaScriptCore/jit/JITArithmetic.cpp: Assembler messages:
../JavaScriptCore/jit/JITArithmetic.cpp:79: Error: suffix or operands invalid for `push'
../JavaScriptCore/jit/JITArithmetic.cpp:79: Error: suffix or operands invalid for `pop'
make[2]: *** [JavaScriptCore/jit/libJavaScriptCore_la-JITArithmetic.lo] Error 1
Comment 1 Sebastian 2009-05-08 15:58:09 PDT
Created attachment 30146 [details]
fix patch

With this patch it builds and I was able to browse on some sites with midori
Comment 2 Geoffrey Garen 2009-05-08 16:28:15 PDT
Comment on attachment 30146 [details]
fix patch

> From ad2cb622ba352ba693352072e5b6e64abfed2576 Mon Sep 17 00:00:00 2001
> From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
> Date: Sat, 9 May 2009 00:31:08 +0200
> Subject: [PATCH 2/2] JavaScriptCore: fix complie on x86_64 boxes
> 
> The assembly code is for 32bit cpus and breaks compilation on 64bit cpus.
> PLATFORM(MAC) is defined in case PLATFORM(DARWIN) is defined which in turn
> is defined if __APPLE__ is defined. This is the case on PowerPC machines. The
> "new" iMacs should have __x86_64__ defined and be handled by PLATFORM(X86_64)
> 
> Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
> ---
>  JavaScriptCore/jit/JITArithmetic.cpp |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/JavaScriptCore/jit/JITArithmetic.cpp b/JavaScriptCore/jit/JITArithmetic.cpp
> index 9f325e3..3a776cc 100644
> --- a/JavaScriptCore/jit/JITArithmetic.cpp
> +++ b/JavaScriptCore/jit/JITArithmetic.cpp
> @@ -44,11 +44,11 @@
>  
>  using namespace std;
>  
> -#if PLATFORM(MAC)
> -
> +#if PLATFORM(X86_64)
> +/* Shortcut: All x86-64 CPUs support SSE2 so we can skip this  */
>  static inline bool isSSE2Present()
>  {
> -    return true; // All X86 Macs are guaranteed to support at least SSE2
> +    return true;
>  }

I think this will disable sse2 optimizations on 32bit x86. I think you want "if PLATFORM(X86_64) || (PLATFORM(X86) && PLATFORM(MAC))".
Comment 3 Gustavo Noronha (kov) 2009-05-09 08:50:05 PDT
> I think this will disable sse2 optimizations on 32bit x86. I think you want "if
> PLATFORM(X86_64) || (PLATFORM(X86) && PLATFORM(MAC))".
> 

I have now committed this as 43439.
Comment 4 Sebastian 2009-05-10 07:31:15 PDT
Why (PLATFORM(X86) && PLATFORM(MAC)) ?
According to [0] Leopard is a 64bit OS so it should be catched by X86_64. Is this a shortcut in case webkit is compiled as a 32bit lib?


[0] http://www.apple.com/macosx/technology/64bit.html