Bug 1440417: Determine JS_64BIT at configure time. r=froydnj
authorEmanuel Hoogeveen <emanuel.hoogeveen@protonmail.com>
Thu, 22 Feb 2018 10:40:00 +0200
changeset 457480 f2165bbee8a08128fb7ae8e9f0c6fe1ba6a1ed7e
parent 457479 36f9602d7654390e1fc72e3129c927890bc23744
child 457481 432bf6294e07003e4ec469bbd638d3765582612f
push id8799
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 16:46:23 +0000
treeherdermozilla-beta@15334014dc67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1440417
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1440417: Determine JS_64BIT at configure time. r=froydnj
js/moz.configure
js/src/jstypes.h
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -30,16 +30,17 @@ js_option('--disable-js-shell', default=
 
 @depends('--disable-js-shell')
 def js_disable_shell(value):
     if not value:
         return True
 
 set_config('JS_DISABLE_SHELL', js_disable_shell)
 
+set_define('JS_64BIT', depends(target)(lambda t: t.bitness == 64 or None))
 
 set_define('JS_PUNBOX64', depends(target)(lambda t: t.bitness == 64 or None))
 set_define('JS_NUNBOX32', depends(target)(lambda t: t.bitness == 32 or None))
 
 
 # SpiderMonkey as a shared library, and how its symbols are exported
 # ==================================================================
 js_option('--disable-shared-js', default=building_js,
--- a/js/src/jstypes.h
+++ b/js/src/jstypes.h
@@ -133,46 +133,16 @@
 ** MACROS:      JS_HOWMANY
 **              JS_ROUNDUP
 ** DESCRIPTION:
 **      Commonly used macros for operations on compatible types.
 ***********************************************************************/
 #define JS_HOWMANY(x,y) (((x)+(y)-1)/(y))
 #define JS_ROUNDUP(x,y) (JS_HOWMANY(x,y)*(y))
 
-/*
- * Define JS_64BIT iff we are building in an environment with 64-bit
- * addresses.
- */
-#ifdef _MSC_VER
-# if defined(_M_X64) || defined(_M_AMD64)
-#  define JS_64BIT
-# endif
-#elif defined(__GNUC__)
-/* Additional GCC defines are when running on Solaris, AIX, and HPUX */
-# if defined(__x86_64__) || defined(__sparcv9) || \
-        defined(__64BIT__) || defined(__LP64__)
-#  define JS_64BIT
-# endif
-#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Sun Studio C/C++ */
-# if defined(__x86_64) || defined(__sparcv9)
-#  define JS_64BIT
-# endif
-#elif defined(__xlc__) || defined(__xlC__)        /* IBM XL C/C++ */
-# if defined(__64BIT__)
-#  define JS_64BIT
-# endif
-#elif defined(__HP_cc) || defined(__HP_aCC)       /* HP-UX cc/aCC */
-# if defined(__LP64__)
-#  define JS_64BIT
-# endif
-#else
-# error "Implement me"
-#endif
-
 #define JS_BITS_PER_BYTE 8
 #define JS_BITS_PER_BYTE_LOG2 3
 
 #if defined(JS_64BIT)
 # define JS_BITS_PER_WORD 64
 #else
 # define JS_BITS_PER_WORD 32
 #endif