v8 compatible CPUs : HTC Dream

84 views
Skip to first unread message

Jose Manuel Cantera Fonseca

unread,
Jul 7, 2011, 11:25:03 AM7/7/11
to v8-u...@googlegroups.com
Hi there,

I'm trying to run v8 together with Webkit in a custom Android build for HTC Dream. 

I'm having problems at runtime, thus I'm wondering if v8 is supported on the HTC Magic CPU:

Qualcomm MSM 7201A 528 Mhz (see all the details below)

thanks for your help 

all the best

Type:MSM7201A
Manufacturer:Qualcomm
Year Released:2008
Predecessor:32bit Qualcomm MSM7200A

Characteristics

CPU Structure (complexity): RISC
Width of Machine Word:32 bit
Primary (RAM) Data bus:32 bit

Instruction Set

Supported Instruction Set(s): ARMv6
CPU Core: ARM1136EJ-S

Clock Frequencies

Recommanded Maximum Clock Frequency: 528 MHz

Technology

Semiconductor Technology: CMOS
Minimum Feature Size: 65 nm

Additional Details

Special Features: ARM9 coprocessor, Embedded QDSP4000 and QDSP5000 DSP (GSM, GPRS/EGPRS Multislot Class 12, EDGE, UMTS/WCDMA, HSDPA, HSUPA, MBMS baseband), Embedded gpsOne GPS module, Qcamera, Qtv, Qcamcorder, Qvideophone, Adreno 130 GPU, OpenGL ES 1.1, OpenVG 1.1, EGL 1.3, Direct3D Mobile, SVGT 1.2, Direct Draw, GDI

Rodolph Perfetta

unread,
Jul 7, 2011, 11:31:06 AM7/7/11
to v8-u...@googlegroups.com
v8 will work on an ARMv6 cpu though Crankshaft (the optimising compiler) will not be used.

Cheers,
Rodolph.

Jose Manuel Cantera Fonseca

unread,
Jul 8, 2011, 2:47:35 AM7/8/11
to v8-u...@googlegroups.com

Do I need to set any special compilation flag?

Thanks

El 07/07/2011 17:31, "Rodolph Perfetta" <rodolph....@gmail.com> escribió:
> v8 will work on an ARMv6 cpu though Crankshaft (the optimising compiler)
> will not be used.
>
> Cheers,
> Rodolph.
>
> On 7 July 2011 16:25, Jose Manuel Cantera Fonseca <
> jmcanter...@gmail.com> wrote:
>
>> Hi there,
>>
>> I'm trying to run v8 together with Webkit in a custom Android build for HTC
>> Dream.
>>
>> I'm having problems at runtime, thus I'm wondering if v8 is supported on
>> the HTC Magic CPU:
>>
>> Qualcomm MSM 7201A 528 Mhz (see all the details below)
>>
>> thanks for your help
>>
>> all the best
>>
>> *Type:*MSM7201A *Manufacturer:*Qualcomm<http://en.wikipedia.org/wiki/Qualcomm>
>> *Year Released:*2008 *Predecessor:*32bit Qualcomm MSM7200A *
>> Characteristics**CPU Structure (complexity):* RISC<http://pdadb.net/index.php?m=cpu&id=a7201a&c=qualcomm_msm7201a#>
>> *Width of Machine Word:*32 bit *Primary (RAM) Data bus:*32 bit *Instruction
>> Set**Supported Instruction Set(s):* ARMv6*CPU Core<http://pdadb.net/index.php?m=cpu&id=a7201a&c=qualcomm_msm7201a#>
>> :* ARM1136EJ-S *Clock Frequencies**Recommanded Maximum Clock Frequency:*528 MHz
>> *Technology**Semiconductor<http://pdadb.net/index.php?m=cpu&id=a7201a&c=qualcomm_msm7201a#>
>> Technology:* CMOS*Minimum Feature Size:* 65 nm *Additional Details**Special
>> Features:* ARM9 coprocessor, Embedded QDSP4000 and QDSP5000 DSP (GSM,

Søren Gjesse

unread,
Jul 8, 2011, 4:25:49 AM7/8/11
to v8-u...@googlegroups.com
Normally target CPU setup is handled by preprocessor defines set by the compiler. Look at src/arm/constants-arm.h to see what is checked for. With an ARMv6 you should end up with CAN_USE_ARMV6_INSTRUCTIONS, CAN_USE_ARMV5_INSTRUCTIONS and CAN_USE_THUMB_INSTRUCTIONS defined as 1.

Are you defining CAN_USE_UNALIGNED_ACCESSES to 1 when compiling?

Do you have any idea whether the runtime issue you have is due to JIT code generated by V8?

Regards,
Søren

Jose Manuel Cantera Fonseca

unread,
Jul 11, 2011, 5:47:29 AM7/11/11
to v8-u...@googlegroups.com
Hi there,

Thank you for your responses. Trying to isolate the problem, I'm now using v8 outside webkit, i.e. through the 'v8shell' helper program, 

I have discovered that v8 is working fine but when an incorrect expression is given to the v8 shell, for instance a variable that does not exist, a fault occurs and the v8shell process dies. The log trace is below. 

Any idea?

many thanks

best


---- Log Trace ---

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'tmobile/opal/sapphire/sapphire:2.2.1/FRG83/60505:user/release-keys'
pid: 511, tid: 511  >>> v8shell <<<
signal 4 (SIGILL), fault addr 40860360
 r0 00000000  r1 408453b5  r2 408453b5  r3 00000000
 r4 00000002  r5 4040a2a5  r6 4087e1e1  r7 00000000
 r8 4040a13d  r9 4083e12d  10 0013f620  fp beba66f4
 ip 0014b5dc  sp beba66dc  lr 408ccd2c  pc 40860360  cpsr 40000010
         #00  pc 40860360  
         #01  lr 408ccd2c  <unknown>

code around pc:
40860340 e5104001 e5d44007 e3540084 1affffc3 
40860350 e2407001 ed977b01 ea000002 e1a070c0 
40860360 ee077a90 eeb87be7 e3110001 0a000006 
40860370 e5114001 e5d44007 e3540084 1affffb7 
40860380 e2417001 ed976b01 ea000002 e1a070c1 

code around lr:
408ccd0c e52d0004 e59f0260 e52d0004 e598200b 
408ccd1c e5920027 e49d1004 e1a0e00f e59ff24c 
408ccd2c e52d0004 e59f2248 e1a0e00f e59ff244 
408ccd3c e51b8004 e52d0004 e598200b e5920023 
408ccd4c e52d0004 e59f2230 e1a0e00f e59ff22c 

stack:
    beba669c  0009b1c9  /system/bin/v8shell
    beba66a0  00000002  
    beba66a4  beba66dc  [stack]
    beba66a8  beba66f4  [stack]
    beba66ac  beba66d0  [stack]
    beba66b0  beba66f4  [stack]
    beba66b4  00000002  
    beba66b8  0009b19d  /system/bin/v8shell
    beba66bc  4085e234  
    beba66c0  4085e234  
    beba66c4  4085e1c1  
    beba66c8  beba66f4  [stack]
    beba66cc  beba66e0  [stack]
    beba66d0  df002777  
    beba66d4  e3a070ad  
    beba66d8  408453b5  
#00 beba66dc  40844945  
    beba66e0  40834e69  
    beba66e4  4082ec2d  
    beba66e8  4083e12d  
    beba66ec  4083441d  
    beba66f0  4040a13d  
    beba66f4  beba6714  [stack]
    beba66f8  408cc5b4  
    beba66fc  40407ac9  
    beba6700  40844945  
    beba6704  4082e361  
    beba6708  40844945  
    beba670c  40833bed  
    beba6710  4082e329  
    beba6714  beba672c  [stack]
    beba6718  40874bac  
    beba671c  40408469  
    beba6720  4082e361  


--------------


2011/7/8 Søren Gjesse <sgj...@chromium.org>

Rodolph Perfetta

unread,
Jul 11, 2011, 6:28:33 AM7/11/11
to v8-u...@googlegroups.com
At first glance it looks like you are trying to run VFP code on a CPU which does not have VFP. The JIT checks the CPU at runtime, so I presume you are compiling the C++ code with VFP support. Try updating the build system to pass -'mfloat-abi=soft -mfpu=none' to the compiler. (and remove the '-mfloat-abi=softfp' option).

Cheers,
Rodolph,.

Søren Gjesse

unread,
Jul 11, 2011, 7:23:14 AM7/11/11
to v8-u...@googlegroups.com
You can take a look at the SConstruct file for building with SCons on the root of the V8 repository. It has the following handling of the different floating point options supported by V8.

      'armeabi:soft' : {
        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
        'simulator:none': {
          'CCFLAGS':     ['-mfloat-abi=soft'],
        }
      },
      'armeabi:softfp' : {
        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0', 'CAN_USE_VFP_INSTRUCTIONS'],
        'simulator:none': {
          'CCFLAGS':     ['-mfloat-abi=softfp'],
        }
      },
      'armeabi:hard' : {
        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1', 'CAN_USE_VFP_INSTRUCTIONS'],
        'simulator:none': {
          'CCFLAGS':     ['-mfloat-abi=hard'],
        }
      }

Regards,
Søren

Jose Manuel Cantera Fonseca

unread,
Jul 12, 2011, 5:44:33 AM7/12/11
to v8-u...@googlegroups.com
The problem is still there. Below you can find the compilation options my Android build is using. 

On the other hand the options mentioned by Soren do not appear on my contants-arm-h file. This is an Android build and the upstream v8 version used is http://v8.googlecode.com/svn/branches/bleeding_edge@3784

CAN_USE_THUMB_INSTRUCTIONS defined as 1.
Are you defining CAN_USE_UNALIGNED_ACCESSES to 1 when compiling?


------ Compilation options start here -----

target thumb C++: libv8 <= external/v8/src/accessors.cc
prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-g++  -c  -fno-exceptions -Wno-multichar -msoft-float -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -march=armv6j -mtune=arm1136jf-s -pipe -fomit-frame-pointer -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__  -mthumb-interwork -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -DNDEBUG -g -Wstrict-aliasing=2 -finline-functions -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -DNDEBUG -UDEBUG -fvisibility-inlines-hidden -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wsign-promo -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -DNDEBUG -UDEBUG -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64  -fno-rtti  -Wno-endif-labels -Wno-import -Wno-format -fno-exceptions -DENABLE_DEBUGGER_SUPPORT -DV8_NATIVE_REGEXP -fpic -funwind-tables -fstack-protector -fno-short-enums -fmessage-length=0 -finline-functions -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -MD -mfloat-abi=soft  -DARM -DV8_TARGET_ARCH_ARM     -MD 




2011/7/11 Søren Gjesse <sgj...@chromium.org>

Rodolph Perfetta

unread,
Jul 12, 2011, 6:10:08 AM7/12/11
to v8-u...@googlegroups.com
Am I correct in thinking you are using bleeding_edge revision 3784. This is very old, current bleeding edge is around revision 8600. Anything stopping you to use a more recent bleeding_edge?

your build option include '-mtune=arm1136jf-s' the f is for VFP but in theory this should have no bearing as it is passed as a pipeline tuning setting.

Rodolph.

Jose Manuel Cantera Fonseca

unread,
Jul 12, 2011, 6:15:17 AM7/12/11
to v8-u...@googlegroups.com
Hi,

Thanks for responding. The only thing it may stop me from changing to a more recent version is the Webkit Compatibility. The Webkit version using by the Android build is 


your build option include '-mtune=arm1136jf-s' the f is for VFP but in theory this should have no bearing as it is passed as a pipeline tuning setting.

Do you mean I should remove such an option?

thanks 

2011/7/12 Rodolph Perfetta <rodolph....@gmail.com>

Søren Gjesse

unread,
Jul 12, 2011, 6:32:26 AM7/12/11
to v8-u...@googlegroups.com
What version of Android required such an old version of V8? The current version of open source Android uses V8 2.5.9.20, http://v8.googlecode.com/svn/branches/2.5@7184. Please look at http://android.git.kernel.org/?p=platform/external/v8.git;a=summary.

Regards,
Søren

Jose Manuel Cantera Fonseca

unread,
Jul 12, 2011, 6:37:05 AM7/12/11
to v8-u...@googlegroups.com
the Android version is Froyo (2.2.1) 

I will try with a more recent version 

thanks, best

2011/7/12 Søren Gjesse <sgj...@chromium.org>

Søren Gjesse

unread,
Jul 12, 2011, 6:44:22 AM7/12/11
to v8-u...@googlegroups.com
If you look at the WebKit version for Gingerbread in http://android.git.kernel.org/?p=platform/external/webkit.git;a=summary I think it is the same as for Froyo (maybe except for a few patches), so using the V8 version from Gingerbread with Froyo should be possible.

Regards,
Søren

Jose Manuel Cantera Fonseca

unread,
Jul 13, 2011, 10:34:16 AM7/13/11
to v8-u...@googlegroups.com
Hello all,

Now I have changed to a more modern version of v8 http://v8.googlecode.com/svn/branches/2.5@7184. And the result is the following

a/ if I compile v8 in 'release mode' then d8 shell programme crashes (see below the crash dump). 
b/ If I compile v8 in 'debug mode' then d8 shell programme works fine 

I remind you that my target device is an HTC Dream (Armv6) device, BUT, the same problem happens in a modern device (Galaxy Tab). I have tried to remove the -O optimization options but the same problem happened. 

I'm attaching the SConstruct file I'm using. I'm building v8 in a Linux box using the arm-eabi cross-compilation tools. 

Any idea?? Any help would be very much appreciated

all the best

--- Crash Dump --- 

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'tmobile/opal/sapphire/sapphire:2.2.1/FRG83/60505:user/release-keys'
pid: 3673, tid: 3673  >>> ./d8 <<<
signal 7 (SIGBUS), fault addr 00000000
 r0 4041339b  r1 40847710  r2 0000000e  r3 4041339f
 r4 40413391  r5 65666552  r6 4084770c  r7 000de2f4
 r8 40413331  r9 0000000c  10 00145ad8  fp bed6a968
 ip 0013e7e8  sp bed6a8b8  lr 000964d1  pc 0009dd70  cpsr 80000030
         #00  pc 0009dd70  /data/d8
         #01  pc 000964cc  /data/d8
         #02  pc 000bafd0  /data/d8
         #03  pc 000bb7c4  /data/d8
         #04  pc 000bb9a2  /data/d8

code around pc:
0009dd50 42ac3401 e04dd3f9 360b1b5a 197118a3 
0009dd60 2aff1f18 1c20dd05 e800f76c c920e042 
0009dd70 4284c420 e003d9fb 3101780f 34017027 
0009dd80 d3f9429c 0069e036 1b5b360b 18e51876 
0009dd90 8830e003 70203602 42ac3401 e029d3f9 

code around lr:
000964b0 22001c11 f0079301 6823fc05 469c9a01 
000964c0 9b029803 1a831899 22004660 fbfaf007 
000964d0 9803e021 fad2f7e1 40012103 29031c07 
000964e0 1c29d042 1c3a310b 320b6808 92021cc3 
000964f0 104b6819 22001c11 f0079301 9801fc81 

stack:
    bed6a878  4081e8ad  
    bed6a87c  00000000  
    bed6a880  4081e8ac  
    bed6a884  0009a49b  /data/d8
    bed6a888  ffffff01  
    bed6a88c  00000000  
    bed6a890  00000003  
    bed6a894  bed6a8bc  [stack]
    bed6a898  4081e8ad  
    bed6a89c  40847701  
    bed6a8a0  00000002  
    bed6a8a4  0009b725  /data/d8
    bed6a8a8  00000002  
    bed6a8ac  40413311  
    bed6a8b0  df002777  
    bed6a8b4  e3a070ad  
#00 bed6a8b8  00001fe0  
    bed6a8bc  0013e7e8  /data/d8
    bed6a8c0  0000000f  
    bed6a8c4  000de2f4  /data/d8
    bed6a8c8  0000001e  
    bed6a8cc  40413380  
    bed6a8d0  40413371  
    bed6a8d4  0013e7e8  /data/d8
    bed6a8d8  40413385  
    bed6a8dc  000964d1  /data/d8
#01 bed6a8e0  bed6a97c  [stack]
    bed6a8e4  00000001  
    bed6a8e8  40413390  
    bed6a8ec  0000000f  
    bed6a8f0  bed6a978  [stack]
    bed6a8f4  bed6a978  [stack]
    bed6a8f8  bed6a97c  [stack]
    bed6a8fc  bed6a980  [stack]
    bed6a900  bed6a930  [stack]
    bed6a904  000bafd5  /data/d8
#02 bed6a908  bed6a978  [stack]
    bed6a90c  000bb7c9  /data/d8
#03 bed6a910  40413311  
    bed6a914  00000000  
    bed6a918  00000001  
    bed6a91c  000001bb  
    bed6a920  bed6a944  [stack]
    bed6a924  bed6a984  [stack]
    bed6a928  0018c058  [heap]
    bed6a92c  0018ccb0  [heap]
    bed6a930  bed6a97c  [stack]
    bed6a934  bed6a980  [stack]
    bed6a938  bed6a97c  [stack]
    bed6a93c  00000003  
    bed6a940  000bb96d  /data/d8
    bed6a944  bed6a980  [stack]
    bed6a948  00000000  
    bed6a94c  000bb9a7  /data/d8
#04 bed6a950  00000003  
    bed6a954  bed6a980  [stack]
    bed6a958  00000002  
    bed6a95c  4085e094  
    bed6a960  4085e094  
    bed6a964  4085e021  
    bed6a968  bed6a994  [stack]
    bed6a96c  bed6a984  [stack]
    bed6a970  40873c80  
    bed6a974  00000000  
    bed6a978  40413311  
    bed6a97c  40413371  
    bed6a980  4081f0e5  
    bed6a984  40413351  
    bed6a988  40847701  
    bed6a98c  4082a1c1  
    bed6a990  40413331  
    bed6a994  bed6a9b0  [stack]

2011/7/12 Søren Gjesse <sgj...@chromium.org>
SConstruct

Jose Manuel Cantera Fonseca

unread,
Jul 14, 2011, 8:57:33 AM7/14/11
to v8-u...@googlegroups.com
Hi,

I have removed the -Os compilation option and now everything works in release mode. Any other option or idea for optimizing the size / others in an Android device?

many thanks

2011/7/13 Jose Manuel Cantera Fonseca <jmcanter...@gmail.com>
Reply all
Reply to author
Forward
0 new messages