Skip to content

Commit

Permalink
Compile sandboxes on all platforms
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=263752
rdar://117555647

Reviewed by Elliott Williams.

Compile sandboxes on all platforms at build time.

* Source/WebKit/DerivedSources.make:

Canonical link: https://commits.webkit.org/269972@main
  • Loading branch information
pvollan committed Oct 30, 2023
1 parent 006bf28 commit 9510aba
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Source/WebKit/DerivedSources.make
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ GENERATED_MESSAGES_FILES_AS_PATTERNS := $(subst .,%,$(GENERATED_MESSAGES_FILES))

MESSAGES_IN_FILES := $(addsuffix .messages.in,$(MESSAGE_RECEIVERS))

SANDBOX_IMPORT_DIR=$(SDKROOT)/usr/local/share/sandbox/profiles/embedded/imports

.PHONY : all

all : $(GENERATED_MESSAGES_FILES)
Expand Down Expand Up @@ -404,24 +406,28 @@ all : $(SANDBOX_PROFILES_WITHOUT_WEBPUSHD) $(WEBPUSHD_SANDBOX_PROFILE) $(SANDBOX
%.sb : %.sb.in
@echo Pre-processing $* sandbox profile...
grep -o '^[^;]*' $< | $(CC) $(SANITIZE_FLAGS) $(SDK_FLAGS) $(TARGET_TRIPLE_FLAGS) $(SANDBOX_DEFINES) $(TEXT_PREPROCESSOR_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) $(EXTERNAL_FLAGS) -include "wtf/Platform.h" - > $@
if [ -e "/usr/local/bin/sbutil" ]; then \
if [[ $(SDK_NAME) =~ "iphoneos" ]]; then \
xcrun --sdk $(SDK_NAME) -f sbutil; \
if [[ $$? == 0 ]]; then \
if [[ $(SDK_NAME) =~ "iphone" || $(SDK_NAME) =~ "watch" || $(SDK_NAME) =~ "appletv" ]]; then \
if [[ $* == "com.apple.WebKit.adattributiond" || $* == "com.apple.WebKit.webpushd" ]]; then \
sbutil compile -D IMPORT_DIR=$(SDKROOT)/usr/local/share/sandbox/profiles/embedded/imports $@ > /dev/null; \
if [ ! -e $(SANDBOX_IMPORT_DIR) ]; then \
exit 0; \
fi; \
xcrun --sdk $(SDK_NAME) sbutil compile -D IMPORT_DIR=$(SANDBOX_IMPORT_DIR) $@ > /dev/null; \
if [[ $$? != 0 ]]; then \
exit 1; \
fi \
fi; \
if [[ $* == "com.apple.WebKit.GPU" || $* == "com.apple.WebKit.Networking" || $* == "com.apple.WebKit.WebContent" ]]; then \
sbutil compile $@ > /dev/null; \
xcrun --sdk $(SDK_NAME) sbutil compile $@ > /dev/null; \
if [[ $$? != 0 ]]; then \
exit 1; \
fi \
fi \
fi; \
if [[ $(SDK_NAME) =~ "mac" ]]; then \
if [[ $* == "com.apple.WebKit.GPUProcess" || $* == "com.apple.WebKit.NetworkProcess" || $* == "com.apple.WebProcess" ]]; then \
sbutil compile -D ENABLE_SANDBOX_MESSAGE_FILTER=YES -D WEBKIT2_FRAMEWORK_DIR=dir -D HOME_DIR=dir -D HOME_LIBRARY_PREFERENCES_DIR=dir -D DARWIN_USER_CACHE_DIR=dir -D DARWIN_USER_TEMP_DIR=dir $@ > /dev/null; \
xcrun --sdk $(SDK_NAME) sbutil compile -D ENABLE_SANDBOX_MESSAGE_FILTER=YES -D WEBKIT2_FRAMEWORK_DIR=dir -D HOME_DIR=dir -D HOME_LIBRARY_PREFERENCES_DIR=dir -D DARWIN_USER_CACHE_DIR=dir -D DARWIN_USER_TEMP_DIR=dir $@ > /dev/null; \
if [[ $$? != 0 ]]; then \
exit 1; \
fi \
Expand Down

0 comments on commit 9510aba

Please sign in to comment.