소스 검색

xplat: make sure linker doesn't pass gluing sub libs

- remove unused definitions and fix mixing empty object file (context)
- make sure sub libs (static) are combined (use an empty object file)
Oguz Bastemur 9 년 전
부모
커밋
8c91291c67

+ 4 - 1
bin/CMakeLists.txt

@@ -3,4 +3,7 @@ if(NOT CC_TARGET_OS_ANDROID)
 endif()
 
 add_subdirectory (ch)
-add_subdirectory (ChakraCore)
+
+if (NOT STATIC_LIBRARY)
+    add_subdirectory (ChakraCore)
+endif()

+ 59 - 111
bin/ChakraCore/CMakeLists.txt

@@ -1,55 +1,11 @@
-if(BuildJIT)
-    set(chakra_backend_objects $<TARGET_OBJECTS:Chakra.Backend>)
-endif()
-
-if(CC_TARGETS_AMD64)
-    set(wasm_objects $<TARGET_OBJECTS:Chakra.WasmReader>)
-    set(wasm_includes ${CHAKRACORE_SOURCE_DIR}/lib/WasmReader)
-endif()
-
-add_library (ChakraCoreStatic STATIC
-  $<TARGET_OBJECTS:Chakra.Pal>
-  $<TARGET_OBJECTS:Chakra.Common.Core>
-  $<TARGET_OBJECTS:Chakra.Jsrt>
-  $<TARGET_OBJECTS:Chakra.Jsrt.Core>
-  ${chakra_backend_objects}
-  $<TARGET_OBJECTS:Chakra.Common.Common>
-  $<TARGET_OBJECTS:Chakra.Common.Codex>
-  $<TARGET_OBJECTS:Chakra.Common.DataStructures>
-  $<TARGET_OBJECTS:Chakra.Common.Exceptions>
-  $<TARGET_OBJECTS:Chakra.Common.Memory>
-  $<TARGET_OBJECTS:Chakra.Common.Util>
-  $<TARGET_OBJECTS:Chakra.Runtime.Base>
-  $<TARGET_OBJECTS:Chakra.Runtime.ByteCode>
-  $<TARGET_OBJECTS:Chakra.Runtime.Debug>
-  $<TARGET_OBJECTS:Chakra.Runtime.Language>
-  $<TARGET_OBJECTS:Chakra.Runtime.Library>
-  $<TARGET_OBJECTS:Chakra.Runtime.Math>
-  $<TARGET_OBJECTS:Chakra.Runtime.Types>
-  $<TARGET_OBJECTS:Chakra.Runtime.PlatformAgnostic>
-  $<TARGET_OBJECTS:Chakra.Parser>
-  ${wasm_objects}
+add_library (ChakraCore SHARED
+  ChakraCoreShared.cpp
+  ConfigParserExternals.cpp
+  TestHooks.cpp
 )
 
-if(CC_TARGET_OS_OSX)
-  target_link_libraries(ChakraCoreStatic
-    "-framework CoreFoundation"
-    "-framework Security"
-    )
-else()
-  if (NOT CC_TARGET_OS_ANDROID)
-    set(PTHREAD "pthread")
-  endif()
-
-  target_link_libraries(ChakraCoreStatic
-    ${CC_LTO_ENABLED}
-    ${PTHREAD}
-    "dl"
-    )
-endif()
-
 target_include_directories (
-  ChakraCoreStatic PUBLIC
+  ChakraCore PUBLIC
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CHAKRACORE_SOURCE_DIR}/lib/Backend
   ${CHAKRACORE_SOURCE_DIR}/lib/Common
@@ -60,74 +16,66 @@ target_include_directories (
   ${wasm_includes}
   )
 
-if (NOT STATIC_LIBRARY)
-  add_library (ChakraCore SHARED
-    ChakraCoreShared.cpp
-    ConfigParserExternals.cpp
-    TestHooks.cpp
-  )
+#
+# Link step for the ChakraCore shared library
+#
+# External libraries we link with are the following:
+#  pthread: For threading
+#  stdc++/gcc_s: C++ runtime code
+#  dl: For shared library loading related functions
+#
+if(CC_TARGET_OS_ANDROID OR CC_TARGET_OS_LINUX)
+  set(LINKER_START_GROUP
+    -fPIC
+    -Wl,--start-group
+    -Wl,--whole-archive
+    )
 
-  #
-  # Link step for the ChakraCore shared library
-  #
-  # External libraries we link with are the following:
-  #  pthread: For threading
-  #  stdc++/gcc_s: C++ runtime code
-  #  dl: For shared library loading related functions
-  #
-  if(CC_TARGET_OS_ANDROID OR CC_TARGET_OS_LINUX)
-    set(LINKER_START_GROUP
-      -fPIC
-      -Wl,--start-group
-      -Wl,--whole-archive
-      )
+  set(LINKER_END_GROUP
+    -Wl,--no-whole-archive
+    -Wl,--end-group
+    -static-libstdc++
+    )
+elseif(CC_TARGET_OS_OSX)
+  set(LINKER_START_GROUP -Wl,-force_load,)
+endif()
 
-    set(LINKER_END_GROUP
-      -Wl,--no-whole-archive
-      -Wl,--end-group
-      -static-libstdc++
-      )
-  elseif(CC_TARGET_OS_OSX)
-    set(LINKER_START_GROUP -Wl,-force_load,)
-  endif()
+# common link deps
+set(lib_target "${lib_target}"
+  -Wl,-undefined,error
+  ${LINKER_START_GROUP}
+  ChakraCoreStatic
+  ${LINKER_END_GROUP}
+  pthread
+  dl
+  ${ICULIB}
+  )
 
-  # common link deps
+if(CC_TARGET_OS_ANDROID OR CC_TARGET_OS_LINUX)
   set(lib_target "${lib_target}"
-    -Wl,-undefined,error
-    ${LINKER_START_GROUP}
-    ChakraCoreStatic
-    ${LINKER_END_GROUP}
-    pthread
-    dl
-    ${ICULIB}
+    -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libChakraCoreLib.version
+    # reduce link time memory usage
+    -Xlinker --no-keep-memory
     )
-
-  if(CC_TARGET_OS_ANDROID OR CC_TARGET_OS_LINUX)
-    set(lib_target "${lib_target}"
-      -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libChakraCoreLib.version
-      # reduce link time memory usage
-      -Xlinker --no-keep-memory
-      )
-  elseif(CC_TARGET_OS_OSX)
-    if(CC_TARGETS_X86)
-      set(lib_target "${lib_target} -arch i386")
-    elseif(CC_TARGETS_ARM)
-      set(lib_target "${lib_target} -arch arm")
-    endif()
+elseif(CC_TARGET_OS_OSX)
+  if(CC_TARGETS_X86)
+    set(lib_target "${lib_target} -arch i386")
+  elseif(CC_TARGETS_ARM)
+    set(lib_target "${lib_target} -arch arm")
   endif()
+endif()
 
-  target_link_libraries (ChakraCore
-    ${lib_target}
-    ${CC_LTO_ENABLED}
-    )
+target_link_libraries (ChakraCore
+  ${lib_target}
+  ${CC_LTO_ENABLED}
+  )
 
-  if(NOT CC_XCODE_PROJECT)
-    # Post build step to copy the built shared library
-    # to out/{BUILD_TYPE}/ (or whatever the CMakeBuildDir is)
-    add_custom_command(TARGET ChakraCore POST_BUILD
-      COMMAND ${CMAKE_COMMAND} -E copy_if_different
-      "${CHAKRACORE_BINARY_DIR}/bin/ChakraCore/libChakraCore.${DYN_LIB_EXT}"
-      ${CHAKRACORE_BINARY_DIR}/
-      )
-  endif()
+if(NOT CC_XCODE_PROJECT)
+  # Post build step to copy the built shared library
+  # to out/{BUILD_TYPE}/ (or whatever the CMakeBuildDir is)
+  add_custom_command(TARGET ChakraCore POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different
+    "${CHAKRACORE_BINARY_DIR}/bin/ChakraCore/libChakraCore.${DYN_LIB_EXT}"
+    ${CHAKRACORE_BINARY_DIR}/
+    )
 endif()

+ 63 - 0
lib/CMakeLists.txt

@@ -1,5 +1,68 @@
 add_compile_options(-fPIC)
 
+if(BuildJIT)
+    set(chakra_backend_objects $<TARGET_OBJECTS:Chakra.Backend>)
+endif()
+
+if(CC_TARGETS_AMD64)
+    set(wasm_objects $<TARGET_OBJECTS:Chakra.WasmReader>)
+    set(wasm_includes ${CHAKRACORE_SOURCE_DIR}/lib/WasmReader)
+endif()
+
+add_library (ChakraCoreStatic STATIC
+  ChakraCoreStatic.cpp
+  $<TARGET_OBJECTS:Chakra.Pal>
+  $<TARGET_OBJECTS:Chakra.Common.Core>
+  $<TARGET_OBJECTS:Chakra.Jsrt>
+  $<TARGET_OBJECTS:Chakra.Jsrt.Core>
+  ${chakra_backend_objects}
+  $<TARGET_OBJECTS:Chakra.Common.Common>
+  $<TARGET_OBJECTS:Chakra.Common.Codex>
+  $<TARGET_OBJECTS:Chakra.Common.DataStructures>
+  $<TARGET_OBJECTS:Chakra.Common.Exceptions>
+  $<TARGET_OBJECTS:Chakra.Common.Memory>
+  $<TARGET_OBJECTS:Chakra.Common.Util>
+  $<TARGET_OBJECTS:Chakra.Runtime.Base>
+  $<TARGET_OBJECTS:Chakra.Runtime.ByteCode>
+  $<TARGET_OBJECTS:Chakra.Runtime.Debug>
+  $<TARGET_OBJECTS:Chakra.Runtime.Language>
+  $<TARGET_OBJECTS:Chakra.Runtime.Library>
+  $<TARGET_OBJECTS:Chakra.Runtime.Math>
+  $<TARGET_OBJECTS:Chakra.Runtime.Types>
+  $<TARGET_OBJECTS:Chakra.Runtime.PlatformAgnostic>
+  $<TARGET_OBJECTS:Chakra.Parser>
+  ${wasm_objects}
+)
+
+if(CC_TARGET_OS_OSX)
+  target_link_libraries(ChakraCoreStatic
+    "-framework CoreFoundation"
+    "-framework Security"
+    )
+else()
+  if (NOT CC_TARGET_OS_ANDROID)
+    set(PTHREAD "pthread")
+  endif()
+
+  target_link_libraries(ChakraCoreStatic
+    ${CC_LTO_ENABLED}
+    ${PTHREAD}
+    "dl"
+    )
+endif()
+
+target_include_directories (
+  ChakraCoreStatic PUBLIC
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CHAKRACORE_SOURCE_DIR}/lib/Backend
+  ${CHAKRACORE_SOURCE_DIR}/lib/Common
+  ${CHAKRACORE_SOURCE_DIR}/lib/Runtime
+  ${CHAKRACORE_SOURCE_DIR}/lib/Runtime/ByteCode
+  ${CHAKRACORE_SOURCE_DIR}/lib/Parser
+  ${CHAKRACORE_SOURCE_DIR}/lib/Jsrt
+  ${wasm_includes}
+  )
+
 if(BuildJIT)
     add_subdirectory (Backend)
 endif()

+ 10 - 0
lib/ChakraCoreStatic.cpp

@@ -0,0 +1,10 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+// dummy file for build system to make sure libChakraCoreStatic.a builds.
+void EMPTY_FUNCTION()
+{
+
+}

+ 0 - 11
pal/inc/pal.h

@@ -6636,17 +6636,6 @@ VOID
 PALAPI
 PAL_Reenter(PAL_Boundary boundary);
 
-// This function needs to be called on a thread when it enters
-// a region of code that depends on this instance of the PAL
-// in the process, and it is unknown whether the current thread
-// is already running in the PAL.  Returns TRUE if and only if
-// the thread was not running in the PAL previously.  Does not
-// modify LastError.
-PALIMPORT
-BOOL
-PALAPI
-PAL_ReenterForEH(VOID);
-
 // This function needs to be called on a thread when it leaves
 // a region of code that depends on this instance of the PAL
 // in the process.  Does not modify LastError.

+ 0 - 1
pal/src/CMakeLists.txt

@@ -63,7 +63,6 @@ if(CC_TARGETS_AMD64 OR CC_TARGETS_X86)
   if(CC_TARGET_OS_OSX)
     set(PLATFORM_SOURCES ${PLATFORM_SOURCES}
       arch/i386/activationhandlerwrapper.S
-      arch/i386/context.S
       arch/i386/dispatchexceptionwrapper.S
     )
   endif()

+ 0 - 36
pal/src/arch/i386/context.S

@@ -1,36 +0,0 @@
-// -------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-// -------------------------------------------------------------------------------------------------------
-
-#if defined(_DEBUG)
-    .text
-    .globl _DBG_CheckStackAlignment
-
-_DBG_CheckStackAlignment:
-#ifndef __i686__
-  // Prolog - at this point we are at aligned - 8 (for the call)
-  pushq %rbp                        // aligned -16
-  movq %rsp, %rbp
-
-  testl $0xf,%esp      // can get away with esp even on AMD64.
-  jz .+3
-  int3
-
-  // Epilog
-  popq %rbp
-  ret
-#else // adm64
-// Prolog - at this point we are at aligned - 8 (for the call)
-pushl %ebp                        // aligned -16
-movl %esp, %ebp
-
-testl $0xf,%esp      // can get away with esp even on AMD64.
-jz .+3
-int3
-
-// Epilog
-popl %ebp
-ret
-#endif
-#endif

+ 0 - 12
pal/src/include/pal/dbgmsg.h

@@ -245,8 +245,6 @@ extern Volatile<BOOL> dbg_master_switch ;
 #define ERROR_(x) TRACE
 #define DBG_PRINTF(level, channel, bHeader) TRACE
 
-#define CHECK_STACK_ALIGN
-
 #define SET_DEFAULT_DEBUG_CHANNEL(x)
 #define DBG_ENABLED(level, channel) (false)
 
@@ -272,23 +270,13 @@ extern Volatile<BOOL> dbg_master_switch ;
 #define WARN_(x) \
     DBG_PRINTF(DLI_WARN,DCI_##x,TRUE)
 
-#if _DEBUG && defined(__APPLE__) && !defined(__i686__)
-bool DBG_ShouldCheckStackAlignment();
-#define CHECK_STACK_ALIGN   if (DBG_ShouldCheckStackAlignment()) DBG_CheckStackAlignment()
-#else
-#define CHECK_STACK_ALIGN
-#endif
-
 #define ENTRY_EXTERNAL \
-    CHECK_STACK_ALIGN; \
     DBG_PRINTF(DLI_ENTRY, defdbgchan,TRUE)
 
 #define ENTRY \
-    CHECK_STACK_ALIGN; \
     DBG_PRINTF(DLI_ENTRY, defdbgchan,TRUE)
 
 #define ENTRY_(x) \
-    CHECK_STACK_ALIGN; \
     DBG_PRINTF(DLI_ENTRY, DCI_##x,TRUE)
 
 #define LOGEXIT \

+ 3 - 16
pal/src/include/pal/debug.h

@@ -1,6 +1,6 @@
 //
 // Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information. 
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
 //
 
 /*++
@@ -13,7 +13,7 @@ Module Name:
 
 Abstract:
 
-    Debug API utility functions 
+    Debug API utility functions
 
 
 
@@ -35,7 +35,7 @@ Function :
 
 (no parameters, no return value)
 --*/
-extern "C" VOID 
+extern "C" VOID
 DBG_DebugBreak();
 
 /*++
@@ -67,19 +67,6 @@ DBG_FlushInstructionCache(
                       IN LPCVOID lpBaseAddress,
                       IN SIZE_T dwSize);
 
-#if defined(__APPLE__)
-/*++
-Function:
-    DBG_CheckStackAlignment
-    
-    The Apple ABI requires 16-byte alignment on the stack pointer.
-    This function traps/interrupts otherwise.
---*/
-VOID
-DBG_CheckStackAlignment();
-#endif                       
-                      
-
 #ifdef __cplusplus
 }
 #endif // __cplusplus

+ 0 - 49
pal/src/init/sxs.cpp

@@ -198,55 +198,6 @@ PAL_HasEntered()
     return pThread->IsInPal();
 }
 
-/*++
-Function:
-  PAL_ReenterForEH
-
-Abstract:
-  This function needs to be called on a thread when it enters
-  a region of code that depends on this instance of the PAL
-  in the process, and it is unknown whether the current thread
-  is already running in the PAL.  Returns TRUE if and only if
-  the thread was not running in the PAL previously.
-
-  NOTE: This function must not modify LastError.
---*/
-BOOL
-PALAPI
-PAL_ReenterForEH()
-{
-    // Only trace if we actually reenter (otherwise, too verbose)
-    // ENTRY_EXTERNAL("PAL_ReenterForEH()\n");
-    // Thus we have to split up what ENTRY_EXTERNAL does.
-    CHECK_STACK_ALIGN;
-
-    BOOL fEntered = FALSE;
-
-    CPalThread *pThread = GetCurrentPalThread();
-    if (pThread == NULL)
-    {
-        ASSERT("PAL_ReenterForEH called on a thread unknown to this PAL\n");
-    }
-    else if (!pThread->IsInPal())
-    {
-#if _ENABLE_DEBUG_MESSAGES_
-        DBG_PRINTF(DLI_ENTRY, defdbgchan, TRUE)("PAL_ReenterForEH()\n");
-#endif
-
-        // We ignore the return code.  This call should only fail on internal
-        // error, and we assert at the actual failure.
-        pThread->Enter(PAL_BoundaryEH);
-        fEntered = TRUE;
-        LOGEXIT("PAL_ReenterForEH returns TRUE\n");
-    }
-    else
-    {
-        // LOGEXIT("PAL_ReenterForEH returns FALSE\n");
-    }
-
-    return fEntered;
-}
-
 PAL_ERROR CPalThread::Enter(PAL_Boundary /* boundary */)
 {
     if (m_fInPal)

+ 32 - 66
pal/src/misc/dbgmsg.cpp

@@ -1,6 +1,6 @@
 //
 // Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information. 
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
 //
 
 /*++
@@ -42,7 +42,7 @@ Abstract:
 #include <dirent.h>
 #include <dlfcn.h>
 
-/* <stdarg.h> needs to be included after "palinternal.h" to avoid name 
+/* <stdarg.h> needs to be included after "palinternal.h" to avoid name
    collision for va_start and va_end */
 #include <stdarg.h>
 
@@ -66,7 +66,7 @@ static const char FOPEN_FLAGS[] = "wt";
 /* global and static variables */
 
 LPCWSTR W16_NULLSTRING = (LPCWSTR) "N\0U\0L\0L\0\0";
- 
+
 DWORD dbg_channel_flags[DCI_LAST];
 BOOL g_Dbg_asserts_enabled;
 
@@ -131,7 +131,7 @@ static int max_entry_level;
 /* character to use for ENTRY indentation */
 static const char INDENT_CHAR = '.';
 
-static BOOL DBG_get_indent(DBG_LEVEL_ID level, const char *format, 
+static BOOL DBG_get_indent(DBG_LEVEL_ID level, const char *format,
                            char *indent_string);
 
 static CRITICAL_SECTION fprintf_crit_section PAL_GLOBAL;
@@ -161,14 +161,14 @@ BOOL DBG_init_channels(void)
 
     InternalInitializeCriticalSection(&fprintf_crit_section);
 
-    /* output only asserts by default [only affects no-vararg-support case; if 
+    /* output only asserts by default [only affects no-vararg-support case; if
        we have varargs, these flags aren't even checked for ASSERTs] */
     for(i=0;i<DCI_LAST;i++)
         dbg_channel_flags[i]=1<<DLI_ASSERT;
 
     /* parse PAL_DBG_CHANNELS environment variable */
 
-    if (!(env_string = MiscGetenv(ENV_CHANNELS))) 
+    if (!(env_string = MiscGetenv(ENV_CHANNELS)))
     {
         env_pcache = env_workstring = NULL;
     }
@@ -192,13 +192,13 @@ BOOL DBG_init_channels(void)
         {
             entry_ptr++;
         }
-        
+
         /* break if end of string is reached */
         if(*entry_ptr == '\0')
         {
            break;
         }
-        
+
         plus_or_minus=*entry_ptr++;
 
         /* find end of entry; if strchr returns NULL, we have reached the end
@@ -210,7 +210,7 @@ BOOL DBG_init_channels(void)
         {
             *env_workstring++='\0';
         }
-        
+
         /* find period that separates channel name from level name */
         level_ptr=strchr(entry_ptr,'.');
 
@@ -282,7 +282,7 @@ BOOL DBG_init_channels(void)
                 {
                     dbg_channel_flags[i] |= flag_mask; /* OR to open levels*/
                 }
-            } 
+            }
             else
             {
                 for(i=0;i<DCI_LAST;i++)
@@ -340,8 +340,8 @@ BOOL DBG_init_channels(void)
                         "variable!\n", env_string);
             }
         }
-    } 
-    else 
+    }
+    else
     {
         output_file = stderr; /* output to stderr by default */
     }
@@ -358,7 +358,7 @@ BOOL DBG_init_channels(void)
     }
 
     /* select ENTRY level limitation */
-    env_string = MiscGetenv(ENV_ENTRY_LEVELS);    
+    env_string = MiscGetenv(ENV_ENTRY_LEVELS);
     if(env_string)
     {
         max_entry_level = atoi(env_string);
@@ -373,7 +373,7 @@ BOOL DBG_init_channels(void)
     {
         if ((ret = pthread_key_create(&entry_level_key,NULL)) != 0)
         {
-            fprintf(stderr, "ERROR : pthread_key_create() failed error:%d (%s)\n", 
+            fprintf(stderr, "ERROR : pthread_key_create() failed error:%d (%s)\n",
                    ret, strerror(ret));
             DeleteCriticalSection(&fprintf_crit_section);;
             return FALSE;
@@ -397,7 +397,7 @@ void DBG_close_channels()
     {
         if (fclose(output_file) != 0)
         {
-            fprintf(stderr, "ERROR : fclose() failed errno:%d (%s)\n", 
+            fprintf(stderr, "ERROR : fclose() failed errno:%d (%s)\n",
                    errno, strerror(errno));
         }
     }
@@ -500,7 +500,7 @@ int DBG_printf_gcc(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader,
         /* also print file name for ASSERTs, to match Win32 behavior */
         if( DLI_ENTRY == level || DLI_ASSERT == level || DLI_EXIT == level)
         {
-            output_size=snprintf(buffer, DBG_BUFFER_SIZE, 
+            output_size=snprintf(buffer, DBG_BUFFER_SIZE,
                                  "{%p" MODULE_FORMAT "} %-5s [%-7s] at %s.%d: ",
                                  thread_id, MODULE_ID
                                  dbg_level_names[level], dbg_channel_names[channel], file, line);
@@ -512,13 +512,13 @@ int DBG_printf_gcc(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader,
                                  thread_id, MODULE_ID
                                  dbg_level_names[level], dbg_channel_names[channel], function, line);
         }
-        
+
         if(output_size + 1 > DBG_BUFFER_SIZE)
         {
             fprintf(stderr, "ERROR : buffer overflow in DBG_printf_gcc");
             return 1;
         }
-        
+
         buffer_ptr=buffer+output_size;
     }
     else
@@ -549,7 +549,7 @@ int DBG_printf_gcc(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader,
     /* flush the output to file */
     if ( fflush(output_file) != 0 )
     {
-        fprintf(stderr, "ERROR : fflush() failed errno:%d (%s)\n", 
+        fprintf(stderr, "ERROR : fflush() failed errno:%d (%s)\n",
                 errno, strerror(errno));
     }
 
@@ -610,9 +610,9 @@ int DBG_printf_c99(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader,
 
     if(bHeader)
     {
-        output_size=snprintf(buffer, DBG_BUFFER_SIZE, 
+        output_size=snprintf(buffer, DBG_BUFFER_SIZE,
                              "{%p" MODULE_FORMAT "} %-5s [%-7s] at %s.%d: ", thread_id, MODULE_ID
-                             dbg_level_names[level], dbg_channel_names[channel], 
+                             dbg_level_names[level], dbg_channel_names[channel],
                              file, line);
 
         if(output_size + 1 > DBG_BUFFER_SIZE)
@@ -620,7 +620,7 @@ int DBG_printf_c99(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader,
             fprintf(stderr, "ERROR : buffer overflow in DBG_printf_gcc");
             return 1;
         }
-        
+
         buffer_ptr=buffer+output_size;
     }
     else
@@ -630,7 +630,7 @@ int DBG_printf_c99(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader,
     }
 
     va_start(args, format);
-    output_size+=Silent_PAL_vsnprintf(buffer_ptr, DBG_BUFFER_SIZE-output_size, 
+    output_size+=Silent_PAL_vsnprintf(buffer_ptr, DBG_BUFFER_SIZE-output_size,
                                       format, args);
     va_end(args);
 
@@ -652,11 +652,11 @@ int DBG_printf_c99(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader,
         call_count=0;
         if ( fflush(output_file) != 0 )
         {
-            fprintf(stderr, "ERROR : fflush() failed errno:%d (%s)\n", 
+            fprintf(stderr, "ERROR : fflush() failed errno:%d (%s)\n",
                    errno, strerror(errno));
         }
     }
-    
+
     if ( old_errno != errno )
     {
         fprintf( stderr, "ERROR: DBG_printf_c99 changed the errno.\n" );
@@ -672,22 +672,22 @@ Function :
 
     generate an indentation string to be used for message output
 
-Parameters :                                  
+Parameters :
     DBG_LEVEL_ID level  : level of message (DLI_ENTRY, etc)
     const char *format  : printf format string of message
     char *indent_string : destination for indentation string
 
 Return value :
     TRUE if output can proceed, FALSE otherwise
-    
+
 Notes:
-As a side-effect, this function updates the ENTRY nesting level for the current 
-thread : it decrements it if 'format' contains the string 'return', increments 
-it otherwise (but only if 'level' is DLI_ENTRY). The function will return 
+As a side-effect, this function updates the ENTRY nesting level for the current
+thread : it decrements it if 'format' contains the string 'return', increments
+it otherwise (but only if 'level' is DLI_ENTRY). The function will return
 FALSE if the current nesting level is beyond our treshold (max_nesting_level);
 it always returns TRUE for other message levels
 --*/
-static BOOL DBG_get_indent(DBG_LEVEL_ID level, const char *format, 
+static BOOL DBG_get_indent(DBG_LEVEL_ID level, const char *format,
                            char *indent_string)
 {
     int ret;
@@ -765,7 +765,7 @@ Parameters :
 
 Return value :
     nesting level at the time the function was called
-    
+
 Notes:
 if new_level is -1, the nesting level will not be modified
 --*/
@@ -789,37 +789,3 @@ int DBG_change_entrylevel(int new_level)
     }
     return old_level;
 }
-
-#if _DEBUG && defined(__APPLE__)
-/*++
-Function:
-    DBG_ShouldCheckStackAlignment
-
-    Wires up stack alignment checks (debug builds only)
---*/
-#define PAL_CHECK_ALIGNMENT_MODE "PAL_CheckAlignmentMode"
-enum CheckAlignmentMode
-{
-    // special value to indicate we've not initialized yet
-    CheckAlignment_Uninitialized    = -1,
-    
-    CheckAlignment_Off              = 0,
-    CheckAlignment_On               = 1,
-    
-    CheckAlignment_Default          = CheckAlignment_On
-};
-
-bool DBG_ShouldCheckStackAlignment()
-{
-    static CheckAlignmentMode caMode = CheckAlignment_Uninitialized;
-    
-    if (caMode == CheckAlignment_Uninitialized)
-    {
-        const char * checkAlignmentSettings = getenv(PAL_CHECK_ALIGNMENT_MODE);
-        caMode = checkAlignmentSettings ?
-            (CheckAlignmentMode)atoi(checkAlignmentSettings) : CheckAlignment_Default;
-    }
-    
-    return caMode == CheckAlignment_On;
-}
-#endif // _DEBUG && __APPLE__

+ 1 - 1
test/native-tests/test-c98/Platform.js

@@ -20,7 +20,7 @@ if (!isStaticBuild) {
 \n\
 LIBRARY_PATH=" + binaryPath + "/lib\n\
 PLATFORM=" + platform + "\n\
-LDIR=$(LIBRARY_PATH)/../bin/ChakraCore/libChakraCoreStatic.a \n\
+LDIR=$(LIBRARY_PATH)/libChakraCoreStatic.a \n\
 \n\
 ifeq (darwin, ${PLATFORM})\n\
 \tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\

+ 1 - 1
test/native-tests/test-char/Platform.js

@@ -20,7 +20,7 @@ if (!isStaticBuild) {
 \n\
 LIBRARY_PATH=" + binaryPath + "/lib\n\
 PLATFORM=" + platform + "\n\
-LDIR=$(LIBRARY_PATH)/../bin/ChakraCore/libChakraCoreStatic.a \n\
+LDIR=$(LIBRARY_PATH)/libChakraCoreStatic.a \n\
 \n\
 ifeq (darwin, ${PLATFORM})\n\
 \tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\

+ 1 - 1
test/native-tests/test-char16/Platform.js

@@ -20,7 +20,7 @@ if (!isStaticBuild) {
 \n\
 LIBRARY_PATH=" + binaryPath + "/lib\n\
 PLATFORM=" + platform + "\n\
-LDIR=$(LIBRARY_PATH)/../bin/ChakraCore/libChakraCoreStatic.a \n\
+LDIR=$(LIBRARY_PATH)/libChakraCoreStatic.a \n\
 \n\
 ifeq (darwin, ${PLATFORM})\n\
 \tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\

+ 1 - 1
test/native-tests/test-static-native/Platform.js

@@ -20,7 +20,7 @@ if (!isStaticBuild) {
 \n\
 LIBRARY_PATH=" + binaryPath + "/lib\n\
 PLATFORM=" + platform + "\n\
-LDIR=$(LIBRARY_PATH)/../bin/ChakraCore/libChakraCoreStatic.a \n\
+LDIR=$(LIBRARY_PATH)/libChakraCoreStatic.a \n\
 \n\
 ifeq (darwin, ${PLATFORM})\n\
 \tICU4C_LIBRARY_PATH ?= /usr/local/opt/icu4c\n\