Skip to content
Permalink
Browse files
Support C files in Unified Builds
https://bugs.webkit.org/show_bug.cgi?id=239873

Reviewed by Mark Lam.

This patch adds support for C (not CPP) files in Unified Builds
so that we do not need to build Zydis in non-unified way.

Also, this patch fixes a bug that we always generate empty UnifiedSource-1.xxx.
It also fixes a bug that this script cannot handle 0 max bundle count.

* Tools/TestWebKitAPI/Scripts/generate-unified-sources.sh:
* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Scripts/generate-unified-sources.sh:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/UnifiedSources-output.xcfilelist:
* Source/WebKit/Scripts/generate-unified-sources.sh:
* Source/WebKitLegacy/scripts/generate-unified-sources.sh:
* Source/WTF/Scripts/generate-unified-source-bundles.rb:
* Source/WebCore/Scripts/generate-unified-sources.sh:

Canonical link: https://commits.webkit.org/250107@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Constellation committed Apr 29, 2022
1 parent 6ccf842 commit 921af3ee6ee9d5257e6b8c34fced5a2b38c74467
Show file tree
Hide file tree
Showing 16 changed files with 140 additions and 74 deletions.
@@ -1509,29 +1509,6 @@ else ()
endif ()

WEBKIT_COMPUTE_SOURCES(JavaScriptCore)
list(APPEND JavaScriptCore_SOURCES
disassembler/zydis/Zydis/Zycore.c
disassembler/zydis/Zydis/ZycoreAllocator.c
disassembler/zydis/Zydis/ZycoreBitset.c
disassembler/zydis/Zydis/ZycoreFormat.c
disassembler/zydis/Zydis/ZycoreList.c
disassembler/zydis/Zydis/ZycoreString.c
disassembler/zydis/Zydis/ZycoreVector.c
disassembler/zydis/Zydis/Zydis.c
disassembler/zydis/Zydis/ZydisDecoder.c
disassembler/zydis/Zydis/ZydisDecoderData.c
disassembler/zydis/Zydis/ZydisFormatter.c
disassembler/zydis/Zydis/ZydisFormatterATT.c
disassembler/zydis/Zydis/ZydisFormatterBase.c
disassembler/zydis/Zydis/ZydisFormatterBuffer.c
disassembler/zydis/Zydis/ZydisFormatterIntel.c
disassembler/zydis/Zydis/ZydisMetaInfo.c
disassembler/zydis/Zydis/ZydisMnemonic.c
disassembler/zydis/Zydis/ZydisRegister.c
disassembler/zydis/Zydis/ZydisSharedData.c
disassembler/zydis/Zydis/ZydisString.c
disassembler/zydis/Zydis/ZydisUtils.c
)
WEBKIT_FRAMEWORK(JavaScriptCore)
WEBKIT_FRAMEWORK_TARGET(JavaScriptCore)

@@ -1,3 +1,19 @@
2022-04-28 Yusuke Suzuki <ysuzuki@apple.com>

Support C files in Unified Builds
https://bugs.webkit.org/show_bug.cgi?id=239873

Reviewed by Mark Lam.

This patch adds support for C (not CPP) files in Unified Builds
so that we do not need to build Zydis in non-unified way.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Scripts/generate-unified-sources.sh:
* Sources.txt:
* UnifiedSources-output.xcfilelist:

2022-04-28 Zan Dobersek <zdobersek@igalia.com>

[RISCV64] Implement MacroAssemblerRISCV64 branchAtomicWeakCAS{8,16,32,64} methods

Large diffs are not rendered by default.

@@ -15,10 +15,12 @@ if [ -z "${BUILD_SCRIPTS_DIR}" ]; then
fi

UnifiedSourceCppFileCount=155
UnifiedSourceCFileCount=5
UnifiedSourceMmFileCount=5

if [ $# -eq 0 ]; then
echo "Using unified source list files: Sources.txt, SourcesCocoa.txt, inspector/remote/SourcesCocoa.txt"
fi

/usr/bin/env ruby "${BUILD_SCRIPTS_DIR}/generate-unified-source-bundles.rb" --derived-sources-path "${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore" --source-tree-path "${SRCROOT}" --max-cpp-bundle-count ${UnifiedSourceCppFileCount} --max-obj-c-bundle-count ${UnifiedSourceMmFileCount} Sources.txt SourcesCocoa.txt inspector/remote/SourcesCocoa.txt "${ARGS[@]}" > /dev/null
/usr/bin/env ruby "${BUILD_SCRIPTS_DIR}/generate-unified-source-bundles.rb" --derived-sources-path "${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore" --source-tree-path "${SRCROOT}" --max-cpp-bundle-count ${UnifiedSourceCppFileCount} --max-c-bundle-count ${UnifiedSourceCFileCount} --max-obj-c-bundle-count ${UnifiedSourceMmFileCount} Sources.txt SourcesCocoa.txt inspector/remote/SourcesCocoa.txt "${ARGS[@]}" > /dev/null

@@ -455,6 +455,28 @@ disassembler/X86Disassembler.cpp

disassembler/ARM64/A64DOpcode.cpp

disassembler/zydis/Zydis/Zycore.c
disassembler/zydis/Zydis/ZycoreAllocator.c
disassembler/zydis/Zydis/ZycoreBitset.c
disassembler/zydis/Zydis/ZycoreFormat.c
disassembler/zydis/Zydis/ZycoreList.c
disassembler/zydis/Zydis/ZycoreString.c
disassembler/zydis/Zydis/ZycoreVector.c
disassembler/zydis/Zydis/Zydis.c
disassembler/zydis/Zydis/ZydisDecoder.c
disassembler/zydis/Zydis/ZydisDecoderData.c
disassembler/zydis/Zydis/ZydisFormatter.c
disassembler/zydis/Zydis/ZydisFormatterATT.c @no-unify
disassembler/zydis/Zydis/ZydisFormatterBase.c @no-unify
disassembler/zydis/Zydis/ZydisFormatterBuffer.c
disassembler/zydis/Zydis/ZydisFormatterIntel.c @no-unify
disassembler/zydis/Zydis/ZydisMetaInfo.c
disassembler/zydis/Zydis/ZydisMnemonic.c
disassembler/zydis/Zydis/ZydisRegister.c
disassembler/zydis/Zydis/ZydisSharedData.c
disassembler/zydis/Zydis/ZydisString.c
disassembler/zydis/Zydis/ZydisUtils.c

domjit/DOMJITAbstractHeap.cpp
domjit/DOMJITHeapRange.cpp

@@ -159,3 +159,8 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/unified-sources/UnifiedSourc
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource97.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource98.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource99.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource1-c.c
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource2-c.c
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource3-c.c
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource4-c.c
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource5-c.c
@@ -1,3 +1,15 @@
2022-04-28 Yusuke Suzuki <ysuzuki@apple.com>

Support C files in Unified Builds
https://bugs.webkit.org/show_bug.cgi?id=239873

Reviewed by Mark Lam.

Fix a bug that we always generate empty UnifiedSource-1.xxx.
It also fixes a bug that this script cannot handle 0 max bundle count.

* Scripts/generate-unified-source-bundles.rb:

2022-04-28 Wenson Hsieh <wenson_hsieh@apple.com>

REGRESSION (DOM GPUP): Rich HTML emails on watchOS no longer show up
@@ -53,6 +53,7 @@ def usage(message)
puts
puts "Generation options:"
puts "--max-cpp-bundle-count Use global sequential numbers for cpp bundle filenames and set the limit on the number"
puts "--max-c-bundle-count Use global sequential numbers for c bundle filenames and set the limit on the number"
puts "--max-obj-c-bundle-count Use global sequential numbers for Obj-C bundle filenames and set the limit on the number"
puts "--dense-bundle-filter Densely bundle files matching the given path glob"
exit 1
@@ -70,6 +71,7 @@ def usage(message)
$inputXCFilelistPath = nil
$outputXCFilelistPath = nil
$maxCppBundleCount = nil
$maxCBundleCount = nil
$maxObjCBundleCount = nil
$denseBundleFilters = []

@@ -87,6 +89,7 @@ def log(text)
['--input-xcfilelist-path', GetoptLong::REQUIRED_ARGUMENT],
['--output-xcfilelist-path', GetoptLong::REQUIRED_ARGUMENT],
['--max-cpp-bundle-count', GetoptLong::REQUIRED_ARGUMENT],
['--max-c-bundle-count', GetoptLong::REQUIRED_ARGUMENT],
['--max-obj-c-bundle-count', GetoptLong::REQUIRED_ARGUMENT],
['--dense-bundle-filter', GetoptLong::REQUIRED_ARGUMENT]).each {
| opt, arg |
@@ -112,6 +115,8 @@ def log(text)
$outputXCFilelistPath = arg
when '--max-cpp-bundle-count'
$maxCppBundleCount = arg.to_i
when '--max-c-bundle-count'
$maxCBundleCount = arg.to_i
when '--max-obj-c-bundle-count'
$maxObjCBundleCount = arg.to_i
when '--dense-bundle-filter'
@@ -246,8 +251,10 @@ def addFile(sourceFile)
raise "wrong extension: #{path.extname} expected #{@extension}" unless path.extname == ".#{@extension}"
bundlePrefix, bundleSize = BundlePrefixAndSizeForPath(path)
if (@lastBundlingPrefix != bundlePrefix)
log("Flushing because new top level directory; old: #{@currentDirectory}, new: #{path.dirname}")
flush
unless @fileCount.zero?
log("Flushing because new top level directory; old: #{@currentDirectory}, new: #{path.dirname}")
flush
end
@lastBundlingPrefix = bundlePrefix
@currentDirectory = path.dirname
@bundleCount = 0 unless @maxCount
@@ -299,6 +306,7 @@ def ProcessFileForUnifiedSourceGeneration(sourceFile)

$bundleManagers = {
".cpp" => BundleManager.new("cpp", $maxCppBundleCount),
".c" => BundleManager.new("c", $maxCBundleCount),
".mm" => BundleManager.new("mm", $maxObjCBundleCount)
}

@@ -350,10 +358,10 @@ def ProcessFileForUnifiedSourceGeneration(sourceFile)
if $mode != :PrintAllSources
$bundleManagers.each_value {
| manager |
manager.flush
manager.flush unless manager.fileCount.zero?

maxCount = manager.maxCount
next if !maxCount
next if !maxCount # It is nil in CMake since maxCount limitation does not exist.

manager.flushToMax

@@ -1,3 +1,12 @@
2022-04-28 Yusuke Suzuki <ysuzuki@apple.com>

Support C files in Unified Builds
https://bugs.webkit.org/show_bug.cgi?id=239873

Reviewed by Mark Lam.

* Scripts/generate-unified-sources.sh:

2022-04-28 Philippe Normand <philn@igalia.com>

[GStreamer] Pipewire display capture broken
@@ -15,6 +15,7 @@ if [ -z "${BUILD_SCRIPTS_DIR}" ]; then
fi

UnifiedSourceCppFileCount=530
UnifiedSourceCFileCount=0
UnifiedSourceMmFileCount=62

if [ $# -eq 0 ]; then
@@ -26,4 +27,4 @@ if [ "${USE_INTERNAL_SDK}" == "YES" ]; then
SOURCES="${SOURCES} SourcesCocoaInternalSDK.txt"
fi

/usr/bin/env ruby "${BUILD_SCRIPTS_DIR}/generate-unified-source-bundles.rb" --derived-sources-path "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore" --source-tree-path "${SRCROOT}" --max-cpp-bundle-count ${UnifiedSourceCppFileCount} --max-obj-c-bundle-count ${UnifiedSourceMmFileCount} --dense-bundle-filter "JS*" --dense-bundle-filter "bindings/js/*" $SOURCES "${ARGS[@]}" > /dev/null
/usr/bin/env ruby "${BUILD_SCRIPTS_DIR}/generate-unified-source-bundles.rb" --derived-sources-path "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore" --source-tree-path "${SRCROOT}" --max-cpp-bundle-count ${UnifiedSourceCppFileCount} --max-c-bundle-count ${UnifiedSourceCFileCount} --max-obj-c-bundle-count ${UnifiedSourceMmFileCount} --dense-bundle-filter "JS*" --dense-bundle-filter "bindings/js/*" $SOURCES "${ARGS[@]}" > /dev/null
@@ -1,3 +1,12 @@
2022-04-28 Yusuke Suzuki <ysuzuki@apple.com>

Support C files in Unified Builds
https://bugs.webkit.org/show_bug.cgi?id=239873

Reviewed by Mark Lam.

* Scripts/generate-unified-sources.sh:

2022-04-28 Per Arne Vollan <pvollan@apple.com>

Dynamically switch message filter
@@ -15,10 +15,11 @@ if [ -z "${BUILD_SCRIPTS_DIR}" ]; then
fi

UnifiedSourceCppFileCount=130
UnifiedSourceCFileCount=0
UnifiedSourceMmFileCount=80

if [ $# -eq 0 ]; then
echo "Using unified source list files: Sources.txt, SourcesCocoa.txt"
fi

/usr/bin/env ruby "${BUILD_SCRIPTS_DIR}/generate-unified-source-bundles.rb" --derived-sources-path "${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit" --source-tree-path "${SRCROOT}" --max-cpp-bundle-count ${UnifiedSourceCppFileCount} --max-obj-c-bundle-count ${UnifiedSourceMmFileCount} Sources.txt SourcesCocoa.txt "${ARGS[@]}" > /dev/null
/usr/bin/env ruby "${BUILD_SCRIPTS_DIR}/generate-unified-source-bundles.rb" --derived-sources-path "${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit" --source-tree-path "${SRCROOT}" --max-cpp-bundle-count ${UnifiedSourceCppFileCount} --max-c-bundle-count ${UnifiedSourceCFileCount} --max-obj-c-bundle-count ${UnifiedSourceMmFileCount} Sources.txt SourcesCocoa.txt "${ARGS[@]}" > /dev/null
@@ -1,3 +1,12 @@
2022-04-28 Yusuke Suzuki <ysuzuki@apple.com>

Support C files in Unified Builds
https://bugs.webkit.org/show_bug.cgi?id=239873

Reviewed by Mark Lam.

* scripts/generate-unified-sources.sh:

2022-04-20 Yusuke Suzuki <ysuzuki@apple.com>

[WTF] Add string concatenate adapter for UUID
@@ -15,10 +15,11 @@ if [ -z "${BUILD_SCRIPTS_DIR}" ]; then
fi

UnifiedSourceCppFileCount=5
UnifiedSourceCFileCount=0
UnifiedSourceMmFileCount=21

if [ $# -eq 0 ]; then
echo "Using unified source list files: Sources.txt, SourcesCocoa.txt"
fi

/usr/bin/env ruby "${BUILD_SCRIPTS_DIR}/generate-unified-source-bundles.rb" --derived-sources-path "${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitLegacy" --source-tree-path "${SRCROOT}" --max-cpp-bundle-count ${UnifiedSourceCppFileCount} --max-obj-c-bundle-count ${UnifiedSourceMmFileCount} Sources.txt SourcesCocoa.txt "${ARGS[@]}" > /dev/null
/usr/bin/env ruby "${BUILD_SCRIPTS_DIR}/generate-unified-source-bundles.rb" --derived-sources-path "${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitLegacy" --source-tree-path "${SRCROOT}" --max-cpp-bundle-count ${UnifiedSourceCppFileCount} --max-c-bundle-count ${UnifiedSourceCFileCount} --max-obj-c-bundle-count ${UnifiedSourceMmFileCount} Sources.txt SourcesCocoa.txt "${ARGS[@]}" > /dev/null
@@ -1,3 +1,12 @@
2022-04-28 Yusuke Suzuki <ysuzuki@apple.com>

Support C files in Unified Builds
https://bugs.webkit.org/show_bug.cgi?id=239873

Reviewed by Mark Lam.

* TestWebKitAPI/Scripts/generate-unified-sources.sh:

2022-04-28 Alex Christensen <achristensen@webkit.org>

Fix SafeBrowsing API tests on platforms with safe browsing result details
@@ -15,10 +15,11 @@ if [ -z "${BUILD_SCRIPTS_DIR}" ]; then
fi

UnifiedSourceCppFileCount=5
UnifiedSourceCFileCount=0
UnifiedSourceMmFileCount=50

if [ $# -eq 0 ]; then
echo "Using unified source list files: Sources.txt, SourcesCocoa.txt"
fi

/usr/bin/env ruby "${BUILD_SCRIPTS_DIR}/generate-unified-source-bundles.rb" --derived-sources-path "${BUILT_PRODUCTS_DIR}/DerivedSources/TestWebKitAPI" --source-tree-path "${SRCROOT}" --max-cpp-bundle-count ${UnifiedSourceCppFileCount} --max-obj-c-bundle-count ${UnifiedSourceMmFileCount} Sources.txt SourcesCocoa.txt "${ARGS[@]}" > /dev/null
/usr/bin/env ruby "${BUILD_SCRIPTS_DIR}/generate-unified-source-bundles.rb" --derived-sources-path "${BUILT_PRODUCTS_DIR}/DerivedSources/TestWebKitAPI" --source-tree-path "${SRCROOT}" --max-cpp-bundle-count ${UnifiedSourceCppFileCount} --max-c-bundle-count ${UnifiedSourceCFileCount} --max-obj-c-bundle-count ${UnifiedSourceMmFileCount} Sources.txt SourcesCocoa.txt "${ARGS[@]}" > /dev/null

0 comments on commit 921af3e

Please sign in to comment.