From 27f4c80ef4ad0c396e541ed388698b467175374b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Szab=C3=B3?= Date: Sat, 28 Dec 2024 14:54:48 +0100 Subject: [PATCH] Update systemlib generation to support precompiled systemlibs Since D46606416, we include precompiled unitemitters rather than raw Hack source files for systemlibs into the HHVM binary. This requires corresponding updates to the OSS build system. * Update embed_all_systemlibs() and embed_systemlibs_byname() to invoke HHVM to compile systemlibs, and update section name generation to match. * Update systemlib generation to correctly look for systemlib sources under hphp/runtime/ext/core instead of hphp/system after they were moved in D46164829. * Make tc-print depend on HHVM, since the hhvm binary is required to compile and embed systemlibs into tc-print. * Fix apparently erroneous contains() check (added in D65835121) in compiler-systemlib.cpp that checks for `file` but then tries to access `"ext_" + file`. This is erroring in OSS, since all extension systemlibs are named ext_something.php, not something.php. --- .gitignore | 3 + CMake/HPHPFunctions.cmake | 36 ++- hphp/compiler/compiler-systemlib.cpp | 2 +- hphp/runtime/ext/core/make_systemlib.sh | 2 +- hphp/runtime/ext/core/php.txt | 296 ++++++++++++------------ hphp/system/CMakeLists.txt | 27 +-- hphp/system/php.txt | 1 + hphp/tools/tc-print/CMakeLists.txt | 3 +- 8 files changed, 197 insertions(+), 173 deletions(-) create mode 100644 hphp/system/php.txt diff --git a/.gitignore b/.gitignore index 881ca58c8b012..82373bf8085b4 100644 --- a/.gitignore +++ b/.gitignore @@ -86,6 +86,9 @@ install_manifest.txt /hphp/hack/test/.mypy_cache /hphp/util/generated-hhjs-babel-transform.txt +# Generated core systemlib +/hphp/runtime/ext/core/ext_core.php + # CPack CPackConfig.cmake CPackSourceConfig.cmake diff --git a/CMake/HPHPFunctions.cmake b/CMake/HPHPFunctions.cmake index 9a3f47ddf3610..ad01feededa39 100644 --- a/CMake/HPHPFunctions.cmake +++ b/CMake/HPHPFunctions.cmake @@ -124,9 +124,6 @@ function(append_systemlib TARGET SOURCE SECTNAME) else() set(${TARGET}_SLIBS ${${TARGET}_SLIBS} "--add-section" "${SECTNAME}=${SOURCE}" PARENT_SCOPE) endif() - # Add the systemlib file to the "LINK_DEPENDS" for the systemlib, this will cause it - # to be relinked and the systemlib re-embedded - set_property(TARGET ${TARGET} APPEND PROPERTY LINK_DEPENDS ${SOURCE}) endif() endfunction(append_systemlib) @@ -186,10 +183,10 @@ function(embed_sections TARGET DEST) endfunction(embed_sections) macro(embed_systemlib_byname TARGET SLIB) - get_filename_component(SLIB_BN ${SLIB} "NAME_WE") - string(LENGTH ${SLIB_BN} SLIB_BN_LEN) - math(EXPR SLIB_BN_REL_LEN "${SLIB_BN_LEN} - 4") - string(SUBSTRING ${SLIB_BN} 4 ${SLIB_BN_REL_LEN} SLIB_EXTNAME) + get_filename_component(SLIB_FILENAME ${SLIB} "NAME") + + set(SLIB_EXTNAME "/:${SLIB_FILENAME}") + string(MD5 SLIB_HASH_NAME ${SLIB_EXTNAME}) # Some platforms limit section names to 16 characters :( string(SUBSTRING ${SLIB_HASH_NAME} 0 12 SLIB_HASH_NAME_SHORT) @@ -204,10 +201,31 @@ endmacro() function(embed_all_systemlibs TARGET ROOT DEST) add_dependencies(${TARGET} systemlib) - append_systemlib(${TARGET} ${ROOT}/system/systemlib.php systemlib) + foreach(SLIB ${EXTENSION_SYSTEMLIB_SOURCES} ${EZC_SYSTEMLIB_SOURCES}) - embed_systemlib_byname(${TARGET} ${SLIB}) + get_filename_component(SLIB_FILENAME ${SLIB} NAME) + file(RELATIVE_PATH SLIB_RELATIVE_PATH ${CMAKE_SOURCE_DIR} ${SLIB}) + list(APPEND SLIB_RELATIVE_PATHS ${SLIB_RELATIVE_PATH}) + list( + APPEND PRECOMPILED_SYSTEMLIB_FILES + ${CMAKE_CURRENT_BINARY_DIR}/slib/${SLIB_FILENAME}.decls + ${CMAKE_CURRENT_BINARY_DIR}/slib/${SLIB_FILENAME}.ue + ) endforeach() + + add_custom_command( + TARGET ${TARGET} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/slib + COMMAND $ --compile-systemlib --input-dir ${CMAKE_SOURCE_DIR} --output-dir ${CMAKE_CURRENT_BINARY_DIR}/slib ${SLIB_RELATIVE_PATHS} + DEPENDS ${EXTENSION_SYSTEMLIB_SOURCES} ${EZC_SYSTEMLIB_SOURCES} + COMMENT "Precompiling systemlib files" + VERBATIM) + + foreach(PRECOMPILED_SLIB ${PRECOMPILED_SYSTEMLIB_FILES}) + get_filename_component(PRECOMPILED_SLIB_FILENAME ${PRECOMPILED_SLIB} NAME) + embed_systemlib_byname(${TARGET} ${PRECOMPILED_SLIB}) + endforeach() + embed_sections(${TARGET} ${DEST}) endfunction(embed_all_systemlibs) diff --git a/hphp/compiler/compiler-systemlib.cpp b/hphp/compiler/compiler-systemlib.cpp index 4285d9d508802..4933d6725069c 100644 --- a/hphp/compiler/compiler-systemlib.cpp +++ b/hphp/compiler/compiler-systemlib.cpp @@ -228,7 +228,7 @@ bool process(CompilerOptions &po) { for (auto extension : ExtensionRegistry::getExtensions()) { for (auto file : extension->hackFiles()) { - if (!files.contains(file)) { + if (!files.contains("ext_" + file)) { Logger::Error( "Error while compiling stdlib: %s not found in input files - did you add an extension without any hack files? If so, override hackFiles to return an empty vector.", file.c_str()); } diff --git a/hphp/runtime/ext/core/make_systemlib.sh b/hphp/runtime/ext/core/make_systemlib.sh index cb5e628ebc602..d30e4a8f59d97 100755 --- a/hphp/runtime/ext/core/make_systemlib.sh +++ b/hphp/runtime/ext/core/make_systemlib.sh @@ -4,7 +4,7 @@ OUTDIR=$1; shift OUTFILE=$1; shift SYSTEMLIB="${OUTDIR}/${OUTFILE}" -mkdir "${OUTDIR}" +mkdir -p "${OUTDIR}" # If we put the line we're generating into this file, then the linter will think # the generator itself is generated. Encode it into a variable for safe diff --git a/hphp/runtime/ext/core/php.txt b/hphp/runtime/ext/core/php.txt index 5db7e0b08292d..ce77911100741 100644 --- a/hphp/runtime/ext/core/php.txt +++ b/hphp/runtime/ext/core/php.txt @@ -6,158 +6,158 @@ # These restrictions may be lifted at some point in the future. # Order matters here. Put parent classes in this list before child classes -hphp/system/php/lang/stdClass.php -hphp/system/php/lang/Closure.php -hphp/system/php/lang/pinitSentinel.php -hphp/system/php/lang/uninitSentinel.php -hphp/system/php/lang/string.php -hphp/system/php/lang/resource.php - -hphp/system/php/lang/AsyncIterator.ns.php -hphp/system/php/lang/AsyncKeyedIterator.ns.php -hphp/system/php/lang/Traversable.ns.php -hphp/system/php/lang/Iterator.ns.php -hphp/system/php/lang/IteratorAggregate.ns.php -hphp/system/php/lang/KeyedIterator.ns.php -hphp/system/php/lang/KeyedIterable.ns.php -hphp/system/php/lang/Throwable.php -hphp/system/php/lang/BaseException.ns.php -hphp/system/php/lang/Error.php -hphp/system/php/lang/Exception.php -hphp/system/php/spl/exceptions/exceptions.php -hphp/system/php/spl/interfaces/Countable.php -hphp/system/php/spl/interfaces/RecursiveIterator.php - -hphp/system/php/lang/Container.ns.php - -hphp/system/php/spl/datastructures/SplHeap.php - -hphp/system/php/spl/file_handling/SplFileInfo.php -hphp/system/php/spl/interfaces/SeekableIterator.php -hphp/system/php/spl/iterators/DirectoryIterator.php -hphp/system/php/spl/iterators/FilesystemIterator.php -hphp/system/php/spl/iterators/GlobIterator.php -hphp/system/php/spl/iterators/RecursiveDirectoryIterator.php -hphp/system/php/spl/file_handling/SplFileObject.php -hphp/system/php/spl/file_handling/SplTempFileObject.php - -hphp/system/php/lang/ArrayAccess.php -hphp/system/php/lang/Serializeable.php -hphp/system/php/spl/datastructures/SplDoublyLinkedList.php -hphp/system/php/spl/datastructures/SplQueue.php -hphp/system/php/spl/datastructures/SplStack.php - -hphp/system/php/spl/interfaces/OuterIterator.php -hphp/system/php/spl/iterators/IteratorIterator.php -hphp/system/php/spl/iterators/FilterIterator.php -hphp/system/php/spl/iterators/RecursiveFilterIterator.php -hphp/system/php/spl/iterators/RegexIterator.php -hphp/system/php/spl/iterators/RecursiveRegexIterator.php - -hphp/system/php/spl/iterators/ArrayIterator.php - -hphp/system/php/filter/filter_var_array.php - -hphp/system/php/date/datetimeinterface.php -hphp/system/php/date/datetimeimmutable.php - -hphp/system/php/collections/collection_interfaces.ns.php -hphp/system/php/collections/LazyConcatIterable.php -hphp/system/php/collections/LazyConcatIterator.php -hphp/system/php/collections/LazyFilterIterable.php -hphp/system/php/collections/LazyFilterIterator.php -hphp/system/php/collections/LazyFilterKeyedIterable.php -hphp/system/php/collections/LazyFilterKeyedIterator.php -hphp/system/php/collections/LazyFilterWithKeyIterable.php -hphp/system/php/collections/LazyFilterWithKeyIterator.php -hphp/system/php/collections/LazyIterable.php -hphp/system/php/collections/LazyIterableView.php -hphp/system/php/collections/LazyKVZipIterable.php -hphp/system/php/collections/LazyKVZipIterator.php -hphp/system/php/collections/LazyKeyedIterable.php -hphp/system/php/collections/LazyKeyedIterableView.php -hphp/system/php/collections/LazyKeysIterable.php -hphp/system/php/collections/LazyKeysIterator.php -hphp/system/php/collections/LazyMapIterable.php -hphp/system/php/collections/LazyMapIterator.php -hphp/system/php/collections/LazyMapKeyedIterable.php -hphp/system/php/collections/LazyMapKeyedIterator.php -hphp/system/php/collections/LazyMapWithKeyIterable.php -hphp/system/php/collections/LazyMapWithKeyIterator.php -hphp/system/php/collections/LazySkipIterable.php -hphp/system/php/collections/LazySkipIterator.php -hphp/system/php/collections/LazySkipKeyedIterable.php -hphp/system/php/collections/LazySkipKeyedIterator.php -hphp/system/php/collections/LazySkipWhileIterable.php -hphp/system/php/collections/LazySkipWhileIterator.php -hphp/system/php/collections/LazySkipWhileKeyedIterable.php -hphp/system/php/collections/LazySkipWhileKeyedIterator.php -hphp/system/php/collections/LazySliceIterable.php -hphp/system/php/collections/LazySliceIterator.php -hphp/system/php/collections/LazySliceKeyedIterable.php -hphp/system/php/collections/LazySliceKeyedIterator.php -hphp/system/php/collections/LazyTakeIterable.php -hphp/system/php/collections/LazyTakeIterator.php -hphp/system/php/collections/LazyTakeKeyedIterable.php -hphp/system/php/collections/LazyTakeKeyedIterator.php -hphp/system/php/collections/LazyTakeWhileIterable.php -hphp/system/php/collections/LazyTakeWhileIterator.php -hphp/system/php/collections/LazyTakeWhileKeyedIterable.php -hphp/system/php/collections/LazyTakeWhileKeyedIterator.php -hphp/system/php/collections/LazyValuesIterable.php -hphp/system/php/collections/LazyValuesIterator.php -hphp/system/php/collections/LazyZipIterable.php -hphp/system/php/collections/LazyZipIterator.php -hphp/system/php/collections/LazyZipKeyedIterable.php -hphp/system/php/collections/LazyZipKeyedIterator.php -hphp/system/php/collections/StrictIterable.php -hphp/system/php/collections/StrictKeyedIterable.php - -hphp/system/php/async/ResultOrExceptionWrapper.ns.php -hphp/system/php/async/WrappedException.ns.php -hphp/system/php/async/WrappedResult.ns.php -hphp/system/php/async/convenience.ns.php - -hphp/system/php/async/vm.ns.php -hphp/system/php/async/maps.ns.php -hphp/system/php/async/vectors.ns.php +hphp/runtime/ext/core/php/lang/stdClass.php +hphp/runtime/ext/core/php/lang/Closure.php +hphp/runtime/ext/core/php/lang/pinitSentinel.php +hphp/runtime/ext/core/php/lang/uninitSentinel.php +hphp/runtime/ext/core/php/lang/string.php +hphp/runtime/ext/core/php/lang/resource.php + +hphp/runtime/ext/core/php/lang/AsyncIterator.ns.php +hphp/runtime/ext/core/php/lang/AsyncKeyedIterator.ns.php +hphp/runtime/ext/core/php/lang/Traversable.ns.php +hphp/runtime/ext/core/php/lang/Iterator.ns.php +hphp/runtime/ext/core/php/lang/IteratorAggregate.ns.php +hphp/runtime/ext/core/php/lang/KeyedIterator.ns.php +hphp/runtime/ext/core/php/lang/KeyedIterable.ns.php +hphp/runtime/ext/core/php/lang/Throwable.php +hphp/runtime/ext/core/php/lang/BaseException.ns.php +hphp/runtime/ext/core/php/lang/Error.php +hphp/runtime/ext/core/php/lang/Exception.php +hphp/runtime/ext/core/php/spl/exceptions/exceptions.php +hphp/runtime/ext/core/php/spl/interfaces/Countable.php +hphp/runtime/ext/core/php/spl/interfaces/RecursiveIterator.php + +hphp/runtime/ext/core/php/lang/Container.ns.php + +hphp/runtime/ext/core/php/spl/datastructures/SplHeap.php + +hphp/runtime/ext/core/php/spl/file_handling/SplFileInfo.php +hphp/runtime/ext/core/php/spl/interfaces/SeekableIterator.php +hphp/runtime/ext/core/php/spl/iterators/DirectoryIterator.php +hphp/runtime/ext/core/php/spl/iterators/FilesystemIterator.php +hphp/runtime/ext/core/php/spl/iterators/GlobIterator.php +hphp/runtime/ext/core/php/spl/iterators/RecursiveDirectoryIterator.php +hphp/runtime/ext/core/php/spl/file_handling/SplFileObject.php +hphp/runtime/ext/core/php/spl/file_handling/SplTempFileObject.php + +hphp/runtime/ext/core/php/lang/ArrayAccess.php +hphp/runtime/ext/core/php/lang/Serializeable.php +hphp/runtime/ext/core/php/spl/datastructures/SplDoublyLinkedList.php +hphp/runtime/ext/core/php/spl/datastructures/SplQueue.php +hphp/runtime/ext/core/php/spl/datastructures/SplStack.php + +hphp/runtime/ext/core/php/spl/interfaces/OuterIterator.php +hphp/runtime/ext/core/php/spl/iterators/IteratorIterator.php +hphp/runtime/ext/core/php/spl/iterators/FilterIterator.php +hphp/runtime/ext/core/php/spl/iterators/RecursiveFilterIterator.php +hphp/runtime/ext/core/php/spl/iterators/RegexIterator.php +hphp/runtime/ext/core/php/spl/iterators/RecursiveRegexIterator.php + +hphp/runtime/ext/core/php/spl/iterators/ArrayIterator.php + +hphp/runtime/ext/core/php/filter/filter_var_array.php + +hphp/runtime/ext/core/php/date/datetimeinterface.php +hphp/runtime/ext/core/php/date/datetimeimmutable.php + +hphp/runtime/ext/core/php/collections/collection_interfaces.ns.php +hphp/runtime/ext/core/php/collections/LazyConcatIterable.php +hphp/runtime/ext/core/php/collections/LazyConcatIterator.php +hphp/runtime/ext/core/php/collections/LazyFilterIterable.php +hphp/runtime/ext/core/php/collections/LazyFilterIterator.php +hphp/runtime/ext/core/php/collections/LazyFilterKeyedIterable.php +hphp/runtime/ext/core/php/collections/LazyFilterKeyedIterator.php +hphp/runtime/ext/core/php/collections/LazyFilterWithKeyIterable.php +hphp/runtime/ext/core/php/collections/LazyFilterWithKeyIterator.php +hphp/runtime/ext/core/php/collections/LazyIterable.php +hphp/runtime/ext/core/php/collections/LazyIterableView.php +hphp/runtime/ext/core/php/collections/LazyKVZipIterable.php +hphp/runtime/ext/core/php/collections/LazyKVZipIterator.php +hphp/runtime/ext/core/php/collections/LazyKeyedIterable.php +hphp/runtime/ext/core/php/collections/LazyKeyedIterableView.php +hphp/runtime/ext/core/php/collections/LazyKeysIterable.php +hphp/runtime/ext/core/php/collections/LazyKeysIterator.php +hphp/runtime/ext/core/php/collections/LazyMapIterable.php +hphp/runtime/ext/core/php/collections/LazyMapIterator.php +hphp/runtime/ext/core/php/collections/LazyMapKeyedIterable.php +hphp/runtime/ext/core/php/collections/LazyMapKeyedIterator.php +hphp/runtime/ext/core/php/collections/LazyMapWithKeyIterable.php +hphp/runtime/ext/core/php/collections/LazyMapWithKeyIterator.php +hphp/runtime/ext/core/php/collections/LazySkipIterable.php +hphp/runtime/ext/core/php/collections/LazySkipIterator.php +hphp/runtime/ext/core/php/collections/LazySkipKeyedIterable.php +hphp/runtime/ext/core/php/collections/LazySkipKeyedIterator.php +hphp/runtime/ext/core/php/collections/LazySkipWhileIterable.php +hphp/runtime/ext/core/php/collections/LazySkipWhileIterator.php +hphp/runtime/ext/core/php/collections/LazySkipWhileKeyedIterable.php +hphp/runtime/ext/core/php/collections/LazySkipWhileKeyedIterator.php +hphp/runtime/ext/core/php/collections/LazySliceIterable.php +hphp/runtime/ext/core/php/collections/LazySliceIterator.php +hphp/runtime/ext/core/php/collections/LazySliceKeyedIterable.php +hphp/runtime/ext/core/php/collections/LazySliceKeyedIterator.php +hphp/runtime/ext/core/php/collections/LazyTakeIterable.php +hphp/runtime/ext/core/php/collections/LazyTakeIterator.php +hphp/runtime/ext/core/php/collections/LazyTakeKeyedIterable.php +hphp/runtime/ext/core/php/collections/LazyTakeKeyedIterator.php +hphp/runtime/ext/core/php/collections/LazyTakeWhileIterable.php +hphp/runtime/ext/core/php/collections/LazyTakeWhileIterator.php +hphp/runtime/ext/core/php/collections/LazyTakeWhileKeyedIterable.php +hphp/runtime/ext/core/php/collections/LazyTakeWhileKeyedIterator.php +hphp/runtime/ext/core/php/collections/LazyValuesIterable.php +hphp/runtime/ext/core/php/collections/LazyValuesIterator.php +hphp/runtime/ext/core/php/collections/LazyZipIterable.php +hphp/runtime/ext/core/php/collections/LazyZipIterator.php +hphp/runtime/ext/core/php/collections/LazyZipKeyedIterable.php +hphp/runtime/ext/core/php/collections/LazyZipKeyedIterator.php +hphp/runtime/ext/core/php/collections/StrictIterable.php +hphp/runtime/ext/core/php/collections/StrictKeyedIterable.php + +hphp/runtime/ext/core/php/async/ResultOrExceptionWrapper.ns.php +hphp/runtime/ext/core/php/async/WrappedException.ns.php +hphp/runtime/ext/core/php/async/WrappedResult.ns.php +hphp/runtime/ext/core/php/async/convenience.ns.php + +hphp/runtime/ext/core/php/async/vm.ns.php +hphp/runtime/ext/core/php/async/maps.ns.php +hphp/runtime/ext/core/php/async/vectors.ns.php # If you have no inheritance relationship, go here in alphabetical order -hphp/system/php/array_filter.php -hphp/system/php/array_map.php -hphp/system/php/array_reduce.php -hphp/system/php/asio/InvalidOperationException.php -hphp/system/php/async/EntryPoint.ns.php -hphp/system/php/curl/CURLFile.php -hphp/system/php/date/dateperiod.php -hphp/system/php/date/datetime_funcs.php -hphp/system/php/dom/DOMException.php -hphp/system/php/file_system/Directory.php -hphp/system/php/lang/Disposable.php -hphp/system/php/lang/ErrorException.php -hphp/system/php/lang/fun.ns.php -hphp/system/php/lang/invariant.ns.php -hphp/system/php/lang/null.ns.php -hphp/system/php/lang/readonly.ns.php -hphp/system/php/misc/idx.php -hphp/system/php/pdo/PDOException.php -hphp/system/php/rx/mutable.php -hphp/system/php/shapes/ext_shapes.php -hphp/system/php/soap/SoapFault.php -hphp/system/php/spl/datastructures/SplPriorityQueue.php -hphp/system/php/spl/interfaces/SplObserver.php -hphp/system/php/spl/interfaces/SplSubject.php -hphp/system/php/spl/iterators/EmptyIterator.php -hphp/system/php/spl/iterators/InfiniteIterator.php -hphp/system/php/spl/iterators/NoRewindIterator.php -hphp/system/php/spl/iterators/RecursiveIteratorIterator.php -hphp/system/php/experimental_parser_utils.php +hphp/runtime/ext/core/php/array_filter.php +hphp/runtime/ext/core/php/array_map.php +hphp/runtime/ext/core/php/array_reduce.php +hphp/runtime/ext/core/php/asio/InvalidOperationException.php +hphp/runtime/ext/core/php/async/EntryPoint.ns.php +hphp/runtime/ext/core/php/curl/CURLFile.php +hphp/runtime/ext/core/php/date/dateperiod.php +hphp/runtime/ext/core/php/date/datetime_funcs.php +hphp/runtime/ext/core/php/dom/DOMException.php +hphp/runtime/ext/core/php/file_system/Directory.php +hphp/runtime/ext/core/php/lang/Disposable.php +hphp/runtime/ext/core/php/lang/ErrorException.php +hphp/runtime/ext/core/php/lang/fun.ns.php +hphp/runtime/ext/core/php/lang/invariant.ns.php +hphp/runtime/ext/core/php/lang/null.ns.php +hphp/runtime/ext/core/php/lang/readonly.ns.php +hphp/runtime/ext/core/php/misc/idx.php +hphp/runtime/ext/core/php/pdo/PDOException.php +hphp/runtime/ext/core/php/rx/mutable.php +hphp/runtime/ext/core/php/shapes/ext_shapes.php +hphp/runtime/ext/core/php/soap/SoapFault.php +hphp/runtime/ext/core/php/spl/datastructures/SplPriorityQueue.php +hphp/runtime/ext/core/php/spl/interfaces/SplObserver.php +hphp/runtime/ext/core/php/spl/interfaces/SplSubject.php +hphp/runtime/ext/core/php/spl/iterators/EmptyIterator.php +hphp/runtime/ext/core/php/spl/iterators/InfiniteIterator.php +hphp/runtime/ext/core/php/spl/iterators/NoRewindIterator.php +hphp/runtime/ext/core/php/spl/iterators/RecursiveIteratorIterator.php +hphp/runtime/ext/core/php/experimental_parser_utils.php # This provides a temporary workaround for renamed lz4 methods -hphp/system/php/zlib/ext_zlib.php +hphp/runtime/ext/core/php/zlib/ext_zlib.php -hphp/system/php/member_of.ns.php +hphp/runtime/ext/core/php/member_of.ns.php -hphp/system/php/attributes.php +hphp/runtime/ext/core/php/attributes.php -hphp/system/php/password/password.php +hphp/runtime/ext/core/php/password/password.php diff --git a/hphp/system/CMakeLists.txt b/hphp/system/CMakeLists.txt index b287e66452e88..d741df679d699 100644 --- a/hphp/system/CMakeLists.txt +++ b/hphp/system/CMakeLists.txt @@ -6,31 +6,32 @@ target_link_libraries(hphp_system hphp_util proxygen hhvm_base_headers) auto_sources(files "*.h" "${CMAKE_CURRENT_SOURCE_DIR}") HHVM_PUBLIC_HEADERS(system ${files}) -FILE(STRINGS "php.txt" SYSTEMLIB_CLASSES) +FILE(STRINGS ${CMAKE_SOURCE_DIR}/hphp/runtime/ext/core/php.txt SYSTEMLIB_CLASSES) set(SYSTEMLIB_SRCS) -set(SYSTEMLIB_SRCS_STR) + foreach(cls ${SYSTEMLIB_CLASSES}) STRING(REGEX REPLACE "[ \t]*#.*" "" cls "${cls}") if (NOT "${cls}" STREQUAL "") - list(APPEND SYSTEMLIB_SRCS "../../${cls}") - set( - SYSTEMLIB_SRCS_STR - "${SYSTEMLIB_SRCS_STR} ${CMAKE_CURRENT_SOURCE_DIR}/../../${cls}" - ) + list(APPEND SYSTEMLIB_SRCS "${CMAKE_SOURCE_DIR}/${cls}") endif() endforeach() +set(CORE_SYSTEMLIB_FILE "${CMAKE_SOURCE_DIR}/hphp/runtime/ext/core/ext_core.php") + add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/systemlib.php + OUTPUT ${CORE_SYSTEMLIB_FILE} DEPENDS "php.txt" ${SYSTEMLIB_SRCS} - COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/make_systemlib.sh" - "${CMAKE_CURRENT_BINARY_DIR}/systemlib.php" - "${SYSTEMLIB_SRCS_STR}" - COMMENT "Generating systemlib.php") + COMMAND "${CMAKE_SOURCE_DIR}/hphp/runtime/ext/core/make_systemlib.sh" + "${CMAKE_SOURCE_DIR}/hphp/runtime/ext/core" + "ext_core.php" + ${SYSTEMLIB_SRCS} + COMMENT "Generating systemlib.php" + VERBATIM + ) add_custom_target( systemlib DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/systemlib.php + ${CORE_SYSTEMLIB_FILE} generated_systemlib ) diff --git a/hphp/system/php.txt b/hphp/system/php.txt new file mode 100644 index 0000000000000..0d52389ad6f45 --- /dev/null +++ b/hphp/system/php.txt @@ -0,0 +1 @@ +../runtime/ext/core/php.txt diff --git a/hphp/tools/tc-print/CMakeLists.txt b/hphp/tools/tc-print/CMakeLists.txt index 4a5c3438c0892..85c5fbbe66e21 100644 --- a/hphp/tools/tc-print/CMakeLists.txt +++ b/hphp/tools/tc-print/CMakeLists.txt @@ -29,7 +29,8 @@ else() endif() add_executable(tc-print ${TC_PRINT_CXX_SOURCES}) -link_object_libraries(tc-print ${HHVM_WHOLE_ARCHIVE_LIBRARIES}) +add_dependencies(tc-print hhvm) target_link_libraries(tc-print ${HHVM_LINK_LIBRARIES}) +link_object_libraries(tc-print ${HHVM_WHOLE_ARCHIVE_LIBRARIES}) embed_all_systemlibs(tc-print "${CMAKE_CURRENT_BINARY_DIR}/../.." "${CMAKE_CURRENT_BINARY_DIR}/tc-print")