Ignore:
Timestamp:
Sep 3, 2021, 11:15:34 AM (4 years ago)
Author:
[email protected]
Message:

[JSC] Fix WebKitAdditions directory traversal in offlineasm part 2
https://bugs.webkit.org/show_bug.cgi?id=229853

Reviewed by Mark Lam.

When DEPLOYMENT_LOCATION is YES, WEBKITADDITIONS_HEADERS_FOLDER_PATH is /usr/local/include/WebKitAdditions.
However, since Xcode implicitly changes it to ${SDKROOT}/usr/local/include/WebKitAdditions, we need to
pass the path with ${SDKROOT} if this path is used by non-Xcode.

In this patch, we replace --use-deployment-location with --webkit-additions-path=path and passing WebKitAdditions
path directly from Xcode. We define WK_WEBKITADDITIONS_INSTALL_PATH and WK_WEBKITADDITIONS_HEADERS_FOLDER_PATH in
JavaScriptCore/Configurations/Base.xcconfig to populate this variable and pass WK_WEBKITADDITIONS_HEADERS_FOLDER_PATH
to the scripts.

We also fix offlineasm's path concatenation. It was using +, but this does not work if directory doesn't end with '/'.
We should use File.join when concatenating file paths.

  • Configurations/Base.xcconfig:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • offlineasm/asm.rb:
  • offlineasm/generate_offset_extractor.rb:
  • offlineasm/generate_settings_extractor.rb:
  • offlineasm/parser.rb:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/offlineasm/asm.rb

    r281972 r282009  
    336336$options = {}
    337337OptionParser.new do |opts|
    338     opts.banner = "Usage: asm.rb asmFile offsetsFile outputFileName [--assembler=<ASM>] [--use-deployment-location]"
     338    opts.banner = "Usage: asm.rb asmFile offsetsFile outputFileName [--assembler=<ASM>] [--webkit-additions-path=<path>]"
    339339    # This option is currently only used to specify the masm assembler
    340340    opts.on("--assembler=[ASM]", "Specify an assembler to use.") do |assembler|
    341341        $options[:assembler] = assembler
    342342    end
    343     opts.on("--use-deployment-location", "Flag to use deployment location.") do |flag|
    344         $options[:use_deployment_location] = flag
     343    opts.on("--webkit-additions-path=PATH", "WebKitAdditions path.") do |path|
     344        $options[:webkit_additions_path] = path
    345345    end
    346346end.parse!
Note: See TracChangeset for help on using the changeset viewer.