Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
63c9211
nativetests: fix static crt build
Jul 14, 2016
e9e1ce1
[MERGE #1279 @jianchun] nativetests: fix static crt build
Jul 15, 2016
cadd703
cross-platform: macOS use CoreFramework for DateTime
obastemur Jul 15, 2016
adf894c
cross-platform: fix stack related issues on macOS
obastemur Jul 21, 2016
a0f9cff
Merge remote-tracking branch 'origin/master' into linux
Jul 21, 2016
50d01b4
[MERGE #1307 @jianchun] Merge remote-tracking branch 'origin/master' …
Jul 21, 2016
5df61db
[MERGE #1283 @obastemur] cross-platform: macOS use CoreFramework for …
obastemur Jul 22, 2016
9202cf2
cross-platform: Fix GCC lib Fedora X64 compile time issues
obastemur Jul 22, 2016
a7bff6d
cross platform: add deb package creation support
obastemur Jul 19, 2016
3dc5f77
split ChakraCoreVersion.h file
Jul 22, 2016
3444df6
xplat: fix minor jsrt header issues
Jul 22, 2016
fcbd7bb
[MERGE #1313 @jianchun] split ChakraCoreVersion.h file
Jul 22, 2016
4bfc9b1
[MERGE #1314 @jianchun] xplat: fix minor jsrt header issues
Jul 22, 2016
c19c91e
[MERGE #1306 @obastemur] cross-platform: fix stack related issues on …
obastemur Jul 22, 2016
7b34d80
[MERGE #1312 @obastemur] cross-platform: Fix GCC lib Fedora X64 compi…
obastemur Jul 22, 2016
56fe248
Merge remote-tracking branch 'origin/master' into linux
Jul 22, 2016
814d084
[MERGE #1320 @jianchun] Merge remote-tracking branch 'origin/master' …
Jul 22, 2016
260dcd3
cross-platform: use ICU libs from target --icu path instead
obastemur Jul 24, 2016
cec0a1b
[MERGE #1327 @obastemur] cross-platform: use ICU libs from target --i…
obastemur Jul 25, 2016
8f58ba0
Clean up PAL external dependencies
digitalinfinity Jul 25, 2016
17a6e14
cross platform: fix static CH release builds
obastemur Jul 23, 2016
059fed2
Enable OS X builds on Jenkins
digitalinfinity Jul 26, 2016
f94e9f6
[MERGE #1332 @digitalinfinity] Enable OS X builds on Jenkins
digitalinfinity Jul 26, 2016
afb3fde
macOS: fix address alignment for stack base and pthread bug
obastemur Jul 26, 2016
f973c8f
cross platform: Fix build break
obastemur Jul 27, 2016
03b2bb8
[MERGE #1339 @obastemur] macOS: fix address alignment for stack base …
obastemur Jul 27, 2016
d4b1efa
cross platform: enable release binary basic testing
obastemur Jul 24, 2016
b021e74
[MERGE #1325 @obastemur] cross platform: fix static CH release builds
obastemur Jul 27, 2016
9465f16
[MERGE #1328 @obastemur] cross platform: enable release binary basic …
obastemur Jul 27, 2016
e448704
[MERGE #1294 @obastemur] cross platform: add deb package creation sup…
obastemur Jul 27, 2016
0a61c42
avoid ch ENABLE_TEST_HOOKS def side effect
Jul 27, 2016
23098cf
[MERGE #1346 @jianchun] avoid ch ENABLE_TEST_HOOKS def side effect
Jul 28, 2016
5881d49
xplat: add eh frame data to thunks
Jul 28, 2016
cbe058c
Added shebang to build script
TorbenKoehn Jul 29, 2016
49c13b3
[MERGE #1354 @jianchun] xplat: add eh frame data to thunks
Jul 29, 2016
d0dd21b
Update build.sh
TorbenKoehn Jul 29, 2016
ab7e177
[MERGE #1358 @TorbenKoehn] Added shebang to build script
Jul 29, 2016
44dc5df
Merge remote-tracking branch 'origin/master' into linux
obastemur Aug 2, 2016
50997f4
[MERGE #1370 @obastemur] Merge Master to Linux
obastemur Aug 2, 2016
5fe92c0
Merge branch 'master' into linux
digitalinfinity Aug 4, 2016
8aad2a5
Merge branch 'master' into linux
digitalinfinity Aug 5, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,26 @@ function(clr_unknown_arch)
endif()
endfunction()

if(ICU_INCLUDE_PATH)
set(ICU_CC_PATH "${ICU_INCLUDE_PATH}/../lib/")
find_library(ICUUC icuuc PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
find_library(ICU18 icui18n PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
find_library(ICUDATA icudata PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
if(ICUUC)
message("found libraries on ${ICU_CC_PATH}")
set(ICULIB
${ICUUC}
${ICU18}
${ICUDATA}
)
endif()
endif()

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
if(NOT ICULIB)
set(ICULIB "icuuc")
endif()

set(CLR_CMAKE_PLATFORM_UNIX 1)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
set(CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64 1)
Expand All @@ -21,9 +40,16 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
add_definitions(
-DPLATFORM_UNIX
-DU_DISABLE_RENAMING=1 #in case we link against to an older binary of icu
)

if(NOT ICULIB)
set(ICULIB "icucore")
add_definitions(
-DU_DISABLE_RENAMING=1 #in case we link against to an older binary of icu
)
message("using ICU from system default: ${ICULIB}")
endif()

set(CLR_CMAKE_PLATFORM_UNIX 1)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
set(CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64 1)
Expand Down Expand Up @@ -193,6 +219,12 @@ include_directories(
${ICU_INCLUDE_PATH}
)

if(ICU_INCLUDE_PATH)
if(NOT HAVE_LIBICU_UCHAR_H)
set(HAVE_LIBICU_UCHAR_H "1")
endif()
endif()

add_subdirectory (pal)

# build the rest with NO_PAL_MINMAX and PAL_STDCPP_COMPAT
Expand Down
15 changes: 3 additions & 12 deletions bin/ChakraCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ add_library (ChakraCore SHARED
ConfigParserExternals.cpp
TestHooks.cpp
)

target_include_directories (
ChakraCore PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
Expand Down Expand Up @@ -45,18 +45,9 @@ set(lib_target "${lib_target}"
pthread
stdc++
dl
${ICULIB}
)

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(lib_target "${lib_target}"
icuuc
)
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(lib_target "${lib_target}"
icucore
)
endif() # Linux ?

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(lib_target "${lib_target}"
-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libChakraCoreLib.version
Expand All @@ -72,7 +63,7 @@ if(NOT CC_XCODE_PROJECT)
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(CC_LIB_EXT "dylib")
endif()

add_custom_command(TARGET ChakraCore POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CHAKRACORE_BINARY_DIR}/bin/ChakraCore/libChakraCore.${CC_LIB_EXT}"
Expand Down
1 change: 0 additions & 1 deletion bin/NativeTests/NativeTests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
$(ChakraCoreRootDirectory)bin\External;
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
<RuntimeLibrary Condition="'$(Configuration)'=='Debug'">MultiThreadedDebugDLL</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<SmallerTypeCheck>false</SmallerTypeCheck>
<MinimalRebuild>false</MinimalRebuild>
Expand Down
8 changes: 4 additions & 4 deletions bin/ch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(ch_source_files
set(ch_source_files
ch.cpp
ChakraRtInterface.cpp
CodexAssert.cpp
Expand Down Expand Up @@ -59,12 +59,12 @@ if(STATIC_LIBRARY)

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(lib_target "${lib_target}"
icuuc
${ICULIB}
unwind-x86_64
)
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(lib_target "${lib_target}"
icucore
${ICULIB}
"-framework CoreFoundation"
"-framework Security"
)
Expand All @@ -78,7 +78,7 @@ else() # // !from shared library
endif()

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(lib_target "${lib_target}"
set(lib_target "${lib_target}"
-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/ch.version
)
endif()
Expand Down
6 changes: 6 additions & 0 deletions bin/ch/ch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ HRESULT RunScript(const char* fileName, LPCSTR fileContents, BYTE *bcBuffer, cha
}

runScript = ChakraRTInterface::JsTTDRunScript(-1, fileContents, WScriptJsrt::GetNextSourceContext(), fullPath, nullptr /*result*/);

if (runScript == JsErrorCategoryUsage)
{
wprintf(_u("FATAL ERROR: Core was compiled without ENABLE_TTD is defined. CH is trying to use TTD interface\n"));
abort();
}
#else
runScript = ChakraRTInterface::JsRunScriptUtf8(fileContents, WScriptJsrt::GetNextSourceContext(), fullPath, nullptr /*result*/);
#endif
Expand Down
4 changes: 3 additions & 1 deletion bin/ch/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#define WIN32_LEAN_AND_MEAN 1

#define ENABLE_TEST_HOOKS 1
#include "CommonDefines.h"
#include <map>
#include <string>
Expand Down Expand Up @@ -137,6 +136,9 @@ do { \
} \
} while (0)

#ifndef ENABLE_TEST_HOOKS
#define ENABLE_TEST_HOOKS
#endif
#include "TestHooks.h"
#include "ChakraRtInterface.h"
#include "HostConfigFlags.h"
Expand Down
64 changes: 50 additions & 14 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
#-------------------------------------------------------------------------------------------------------
# Copyright (C) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
Expand All @@ -20,20 +21,21 @@ PRINT_USAGE() {
echo "build.sh [options]"
echo ""
echo "options:"
echo " --cxx=PATH Path to Clang++ (see example below)"
echo " --cc=PATH Path to Clang (see example below)"
echo " -d, --debug Debug build (by default Release build)"
echo " -h, --help Show help"
echo " --icu=PATH Path to ICU include folder (see example below)"
echo " -j [N], --jobs[=N] Multicore build, allow N jobs at once"
echo " -n, --ninja Build with ninja instead of make"
echo " --xcode Generate XCode project"
echo " -t, --test-build Test build (by default Release build)"
echo " --static Build as static library (by default shared library)"
echo " -v, --verbose Display verbose output including all options"
echo " --cxx=PATH Path to Clang++ (see example below)"
echo " --cc=PATH Path to Clang (see example below)"
echo " -d, --debug Debug build (by default Release build)"
echo " -h, --help Show help"
echo " --icu=PATH Path to ICU include folder (see example below)"
echo " -j [N], --jobs[=N] Multicore build, allow N jobs at once"
echo " -n, --ninja Build with ninja instead of make"
echo " --xcode Generate XCode project"
echo " -t, --test-build Test build (by default Release build)"
echo " --static Build as static library (by default shared library)"
echo " -v, --verbose Display verbose output including all options"
echo " --create-deb=V Create .deb package with given V version"
echo " --without=FEATURE,FEATURE,..."
echo " Disable FEATUREs from JSRT experimental"
echo " features."
echo " Disable FEATUREs from JSRT experimental"
echo " features."
echo ""
echo "example:"
echo " ./build.sh --cxx=/path/to/clang++ --cc=/path/to/clang -j"
Expand All @@ -53,6 +55,7 @@ MULTICORE_BUILD=""
ICU_PATH=""
STATIC_LIBRARY=""
WITHOUT_FEATURES=""
CREATE_DEB=0

while [[ $# -gt 0 ]]; do
case "$1" in
Expand Down Expand Up @@ -111,11 +114,16 @@ while [[ $# -gt 0 ]]; do
MAKE=ninja
;;

--xcode)
--xcode)
CMAKE_GEN="-G Xcode -DCC_XCODE_PROJECT=1"
MAKE=0
;;

--create-deb=*)
CREATE_DEB=$1
CREATE_DEB="${CREATE_DEB:13}"
;;

--static)
STATIC_LIBRARY="-DSTATIC_LIBRARY=1"
;;
Expand Down Expand Up @@ -228,6 +236,34 @@ fi

if [[ $_RET != 0 ]]; then
echo "See error details above. Exit code was $_RET"
else
if [[ $CREATE_DEB != 0 ]]; then
DEB_FOLDER=`realpath .`
DEB_FOLDER="${DEB_FOLDER}/chakracore_${CREATE_DEB}"

mkdir -p $DEB_FOLDER/usr/local/bin
mkdir -p $DEB_FOLDER/DEBIAN
cp $DEB_FOLDER/../ch $DEB_FOLDER/usr/local/bin/
if [[ $STATIC_LIBRARY == "" ]]; then
cp $DEB_FOLDER/../*.so $DEB_FOLDER/usr/local/bin/
fi
echo -e "Package: ChakraCore"\
"\nVersion: ${CREATE_DEB}"\
"\nSection: base"\
"\nPriority: optional"\
"\nArchitecture: amd64"\
"\nDepends: libc6 (>= 2.19), uuid-dev (>> 0), libunwind-dev (>> 0), libicu-dev (>> 0)"\
"\nMaintainer: ChakraCore <[email protected]>"\
"\nDescription: Chakra Core"\
"\n Open source Core of Chakra Javascript Engine"\
> $DEB_FOLDER/DEBIAN/control

dpkg-deb --build $DEB_FOLDER
_RET=$?
if [[ $_RET == 0 ]]; then
echo ".deb package is available under $build_directory"
fi
fi
fi

popd > /dev/null
Expand Down
46 changes: 40 additions & 6 deletions jenkins/get_system_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,55 @@
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
#-------------------------------------------------------------------------------------------------------

if [[ $# -eq 0 ]]; then
echo "No platform passed in- assuming Linux"
_PLATFORM="linux"
fi

while [[ $# -gt 0 ]]; do
case "$1" in
--linux)
_PLATFORM="linux"
;;
--osx)
_PLATFORM="osx"
;;
esac

shift
done

echo
echo "=================================================="
echo

echo "Number of processors (nproc):"
echo
nproc
if [[ $_PLATFORM =~ "linux" ]]; then
echo "Number of processors (nproc):"
echo
nproc
elif [[ $_PLATFORM =~ "osx" ]]; then
echo "Number of processors (sysctl -n hw.logicalcpu):"
echo
sysctl -n hw.logicalcpu
else
echo "Unknown platform"
exit 1
fi

echo
echo "--------------------------------------------------"
echo

echo "Linux version (lsb_release -a):"
echo
lsb_release -a
if [[ $_PLATFORM =~ "linux" ]]; then
echo "Linux version (lsb_release -a):"
echo
lsb_release -a
elif [[ $_PLATFORM =~ "osx" ]]; then
echo "OS X version (sw_vers -productVersion):"
echo
sw_vers -productVersion
fi


echo
echo "--------------------------------------------------"
Expand Down
15 changes: 15 additions & 0 deletions lib/Common/ChakraCoreVersion.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once

#define CHAKRA_CORE_MAJOR_VERSION 1
#define CHAKRA_CORE_MINOR_VERSION 2
#define CHAKRA_CORE_VERSION_RELEASE 0
#define CHAKRA_CORE_VERSION_PRERELEASE 0
#define CHAKRA_CORE_VERSION_RELEASE_QFE 0

#define CHAKRA_VERSION_RELEASE 0

// NOTE: need to update the GUID in ByteCodeCacheReleaseFileVersion.h as well
14 changes: 1 addition & 13 deletions lib/Common/CommonDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,7 @@

#include "TargetVer.h"
#include "Warnings.h"

//----------------------------------------------------------------------------------------------------
// Chakra Core version
//----------------------------------------------------------------------------------------------------
#define CHAKRA_CORE_MAJOR_VERSION 1
#define CHAKRA_CORE_MINOR_VERSION 2
#define CHAKRA_CORE_VERSION_RELEASE 0
#define CHAKRA_CORE_VERSION_PRERELEASE 0
#define CHAKRA_CORE_VERSION_RELEASE_QFE 0

#define CHAKRA_VERSION_RELEASE 0

// NOTE: need to update the GUID in ByteCodeCacheReleaseFileVersion.h as well
#include "ChakraCoreVersion.h"

//----------------------------------------------------------------------------------------------------
// Default debug/fretest/release flags values
Expand Down
11 changes: 11 additions & 0 deletions lib/Jsrt/ChakraCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ typedef BYTE* ChakraBytePtr;
#define _Pre_writable_byte_size_(byteLength)
#define _Outptr_result_buffer_(byteLength)
#define _Outptr_result_bytebuffer_(byteLength)
#define _Outptr_result_maybenull_
#define _Outptr_result_z_
#define _Ret_maybenull_
#define _Out_writes_(size)
Expand All @@ -70,6 +71,16 @@ typedef BYTE* ChakraBytePtr;
#include <stdint.h> // for uintptr_t
typedef uintptr_t ChakraCookie;
typedef unsigned char* ChakraBytePtr;

// xplat-todo: try reduce usage of following types
#if !defined(__MSTYPES_DEFINED)
typedef uint32_t UINT32;
typedef int64_t INT64;
typedef void* HANDLE;
typedef unsigned char BYTE;
typedef UINT32 DWORD;
#endif

#endif // defined(_WIN32) && defined(_MSC_VER)

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion lib/Jsrt/ChakraCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ CHAKRA_API
JsParseModuleSource(
_In_ JsModuleRecord requestModule,
_In_ JsSourceContext sourceContext,
_In_ byte* script,
_In_ BYTE* script,
_In_ unsigned int scriptLength,
_In_ JsParseModuleSourceFlags sourceFlag,
_Outptr_result_maybenull_ JsValueRef* exceptionValueRef);
Expand Down
Loading