Hey folks

> I played around with the package, it compiled with plain settings, but
> it was rather unoptimised (armv5t, etc). So I decided to make it to
> build a specialized version for armhf (armv7-a basically,
> float-abi=hard is implied in the compiler settings as it is the
> default). I attach the patch I used.

 Cool!

 I'm a bit worried about the implementation though: this essentially
 boils down to letting the build system chose optimizations based on
 uname -m, which is really bad.

 Debian armel might be built on "armv7l" machines someday (quite likely
 in fact) and armhf might be built on "armv8l" someday, so not a good
 idea to hardcode uname -> target optimization.
   This new arch also feels weird: you end up duplicating a lot of the
 arch:arm stuff in your arch:armv7l; this will get out of date because
 it's duplicated.

 Instead, I would propose (but didn't test) to remove this entirely:
      'CCFLAGS':      ['-march=armv5t']
 from SConstruct's 'arch:arm' definition.  That would be the only
 change.

 Without this flag, the build will just use the toolchain defaults,
 which is exactly what we want on both armel and armhf!  It's also
 better for derivatives like Ubuntu or other distros which have
 different toolchain defaults.

--- libv8-2.2.24/SConstruct     2010-09-16 10:06:58.000000000 +0000
+++ libv8-2.2.24.armhf//SConstruct      2010-09-16 10:06:32.296766735 +0000
@@ -217,6 +217,16 @@
       'CCFLAGS':      ['-m32'],
       'LINKFLAGS':    ['-m32']
     },
+    'arch:armv7l': {
+      'CPPDEFINES':   ['V8_TARGET_ARCH_ARM'],
+      'unalignedaccesses:on' : {
+        'CPPDEFINES' : ['CAN_USE_UNALIGNED_ACCESSES=1']
+      },
+      'unalignedaccesses:off' : {
+        'CPPDEFINES' : ['CAN_USE_UNALIGNED_ACCESSES=0']
+      },
+      'CCFLAGS':      ['-march=armv7-a']
+    },
     'arch:mips': {
       'CPPDEFINES':   ['V8_TARGET_ARCH_MIPS'],
       'simulator:none': {
@@ -338,6 +348,12 @@
       # used by the arm simulator.
       'WARNINGFLAGS': ['/wd4996']
     },
+    'arch:armv7l': {
+      'CPPDEFINES':   ['V8_TARGET_ARCH_ARM'],
+      # /wd4996 is to silence the warning about sscanf
+      # used by the arm simulator.
+      'WARNINGFLAGS': ['/wd4996']
+    },
     'arch:mips': {
       'CPPDEFINES':   ['V8_TARGET_ARCH_MIPS'],
     },
@@ -437,6 +453,9 @@
     'arch:arm': {
       'LINKFLAGS':   ARM_LINK_FLAGS
     },
+    'arch:armv7l': {
+      'LINKFLAGS':   ARM_LINK_FLAGS
+    },
   },
   'msvc': {
     'all': {
@@ -504,6 +523,9 @@
     'arch:arm': {
       'LINKFLAGS':   ARM_LINK_FLAGS
     },
+    'arch:armv7l': {
+      'LINKFLAGS':   ARM_LINK_FLAGS
+    },
     'arch:ia32': {
       'CCFLAGS':      ['-m32'],
       'LINKFLAGS':    ['-m32']
@@ -677,7 +699,7 @@
     'help': 'the os to build for (' + OS_GUESS + ')'
   },
   'arch': {
-    'values':['arm', 'ia32', 'x64', 'mips'],
+    'values':['arm', 'armv7l', 'ia32', 'x64', 'mips'],
     'default': ARCH_GUESS,
     'help': 'the architecture to build for (' + ARCH_GUESS + ')'
   },
--- libv8-2.2.24/tools/utils.py 2010-09-16 10:06:58.000000000 +0000
+++ libv8-2.2.24.armhf//tools/utils.py  2010-09-15 23:55:29.776765243 +0000
@@ -66,7 +66,10 @@
 def GuessArchitecture():
   id = platform.machine()
   if id.startswith('arm'):
-    return 'arm'
+    if id == 'armv7l':
+      return 'armv7l'
+    else:
+      return 'arm'
   elif id == 'i86pc':
     return 'ia32'
   elif id == 'amd64':

    Cheers
-- 
Loïc Minier



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to