Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
cdbf223a
Commit
cdbf223a
authored
May 01, 2015
by
Daniel Agar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake configure determine sizeof unordered_map
-use pyconfig.h instead of config.h
parent
47461afd
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
25 deletions
+12
-25
CMakeLists.txt
CMakeLists.txt
+6
-12
config.h.in
config.h.in
+0
-10
from_cpython/CMakeLists.txt
from_cpython/CMakeLists.txt
+1
-0
from_cpython/Include/dictobject.h
from_cpython/Include/dictobject.h
+1
-1
from_cpython/Include/object.h
from_cpython/Include/object.h
+1
-1
from_cpython/Include/pyconfig.h.in
from_cpython/Include/pyconfig.h.in
+2
-0
src/CMakeLists.txt
src/CMakeLists.txt
+1
-1
No files found.
CMakeLists.txt
View file @
cdbf223a
...
...
@@ -159,24 +159,18 @@ add_definitions(${LLVM_DEFINITIONS})
add_definitions
(
-DDEFAULT_PYTHON_MAJOR_VERSION=2 -DDEFAULT_PYTHON_MINOR_VERSION=7 -DDEFAULT_PYTHON_MICRO_VERSION=6
)
# Python 2.7.6
add_definitions
(
-DLLVMREV=
${
LLVMREV
}
)
include_directories
(
${
CMAKE_BINARY_DIR
}
/from_cpython/Include
)
include_directories
(
${
LLVM_INCLUDE_DIRS
}
)
include_directories
(
from_cpython/Include
)
# generate pyconfig.h
set
(
CMAKE_EXTRA_INCLUDE_FILES unordered_map
)
check_type_sizeof
(
"std::unordered_map<void*, void*>"
SIZEOF_UNORDEREDMAP LANGUAGE CXX
)
configure_file
(
from_cpython/Include/pyconfig.h.in from_cpython/Include/pyconfig.h
)
find_package
(
LibLZMA REQUIRED
)
link_directories
(
${
CMAKE_BINARY_DIR
}
/libunwind/lib
)
link_directories
(
${
LLVM_LIBRARY_DIRS
}
)
# generate config.h - must be after LLVM is configured
set
(
CMAKE_EXTRA_INCLUDE_FILES
${
CMAKE_SOURCE_DIR
}
/src/runtime/types.h
)
set
(
CMAKE_REQUIRED_DEFINITIONS
"-DNVALGRIND -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
)
set
(
CMAKE_REQUIRED_INCLUDES
${
DEPS_DIR
}
/llvm-trunk/include
${
CMAKE_BINARY_DIR
}
/llvm/include
${
CMAKE_SOURCE_DIR
}
/from_cpython/Include
${
CMAKE_SOURCE_DIR
}
/src
)
check_type_sizeof
(
"pyston::BoxedDict"
SIZEOF_BOXEDDICT LANGUAGE CXX
)
configure_file
(
${
CMAKE_SOURCE_DIR
}
/config.h.in
${
CMAKE_BINARY_DIR
}
/config.h
)
add_subdirectory
(
lib_pyston
)
add_subdirectory
(
from_cpython
)
add_subdirectory
(
src
)
...
...
config.h.in
deleted
100644 → 0
View file @
47461afd
/*--------------------------------------------------------------------------
* This file is autogenerated from config.h.in
* during the cmake configuration of your project.
* --------------------------------------------------------------------------*/
#ifndef _CONFIG_H_
#define _CONFIG_H_
#define SIZEOF_BOXEDDICT @SIZEOF_BOXEDDICT@
#endif
from_cpython/CMakeLists.txt
View file @
cdbf223a
...
...
@@ -108,3 +108,4 @@ file(GLOB_RECURSE STDPARSER_SRCS Parser
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-Wno-missing-field-initializers -Wno-tautological-compare -Wno-type-limits -Wno-unused-result -Wno-strict-aliasing"
)
add_library
(
FROM_CPYTHON OBJECT
${
STDMODULE_SRCS
}
${
STDOBJECT_SRCS
}
${
STDPYTHON_SRCS
}
${
STDPARSER_SRCS
}
)
add_dependencies
(
FROM_CPYTHON copy_stdlib
)
from_cpython/Include/dictobject.h
View file @
cdbf223a
...
...
@@ -94,7 +94,7 @@ struct _dictobject {
#endif
typedef
struct
{
PyObject_HEAD
;
char
_filler
[
48
];
char
_filler
[
SIZEOF_UNORDEREDMAP
];
}
PyDictObject
;
// Pyston change: these are no longer static objects:
...
...
from_cpython/Include/object.h
View file @
cdbf223a
...
...
@@ -454,7 +454,7 @@ struct _typeobject {
void
*
_hcls
;
void
*
_hcattrs
;
char
_dep_getattrs
[
56
];
// FIXME: this is hardcoding the size of this particular implementation of std::unordered_map
char
_dep_getattrs
[
SIZEOF_UNORDEREDMAP
+
sizeof
(
void
*
)];
char
_ics
[
32
];
void
*
_gcvisit_func
;
void
*
_dtor
;
...
...
from_cpython/Include/pyconfig.h
→
from_cpython/Include/pyconfig.h
.in
View file @
cdbf223a
...
...
@@ -135,4 +135,6 @@
// Added this for some Pyston modifications:
#define MAX_PYSTRING_SIZE (PY_SSIZE_T_MAX/2 - (1<<20))
#define SIZEOF_UNORDEREDMAP @SIZEOF_UNORDEREDMAP@
#endif /*Py_PYCONFIG_H*/
src/CMakeLists.txt
View file @
cdbf223a
...
...
@@ -107,7 +107,7 @@ add_library(PYSTON_OBJECTS OBJECT ${OPTIONAL_SRCS}
runtime/util.cpp
)
add_dependencies
(
PYSTON_OBJECTS libunwind pypa
${
LLVM_LIBS
}
)
add_dependencies
(
PYSTON_OBJECTS
FROM_CPYTHON
libunwind pypa
${
LLVM_LIBS
}
)
add_library
(
PYSTON_MAIN_OBJECT OBJECT jit.cpp
)
add_dependencies
(
PYSTON_MAIN_OBJECT libunwind pypa liblz4
${
LLVM_LIBS
}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment