Commit a02c0cd8 authored by Peter Collingbourne's avatar Peter Collingbourne Committed by Commit Bot

Change crdmg's minimum SDK version to 10.10.

An upcoming version of clang removes the ability to suppress
availability warnings by redeclaring functions. The new way
to suppress warnings is to either annotate the caller with an
availability attribute or enclose the function reference in an "if
(@available)" block.

But we don't need to do any of that for crdmg. According to source
code comments, the executable only works with 10.10+, so we can adjust
the minimum SDK version to match.

Bug: 735328
Change-Id: Ib735ffe60c67681b2d13f5dbbfddb6aa6b928248
Reviewed-on: https://chromium-review.googlesource.com/564290Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarJialiu Lin <jialiul@chromium.org>
Reviewed-by: default avatarSidney San Martin <sdy@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485433}
parent c985ba11
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/sysroot.gni")
import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/libfuzzer/fuzzer_test.gni")
source_set("mac") { source_set("mac") {
...@@ -48,6 +49,19 @@ source_set("dmg_common") { ...@@ -48,6 +49,19 @@ source_set("dmg_common") {
public_configs = [ ":dmg_public_config" ] public_configs = [ ":dmg_public_config" ]
} }
config("10_10_config") {
cflags = [
"-isysroot",
sysroot,
"-mmacosx-version-min=10.10",
]
ldflags = [
"-isysroot",
sysroot,
"-mmacosx-version-min=10.10",
]
}
executable("crdmg") { executable("crdmg") {
sources = [ sources = [
"crdmg.cc", "crdmg.cc",
...@@ -58,6 +72,9 @@ executable("crdmg") { ...@@ -58,6 +72,9 @@ executable("crdmg") {
"//base", "//base",
"//sandbox/mac:seatbelt", "//sandbox/mac:seatbelt",
] ]
configs -= [ "//build/config/compiler:runtime_library" ]
configs += [ ":10_10_config" ]
} }
fuzzer_test("safe_browsing_dmg_fuzzer") { fuzzer_test("safe_browsing_dmg_fuzzer") {
......
...@@ -26,14 +26,6 @@ ...@@ -26,14 +26,6 @@
#include "chrome/utility/safe_browsing/mac/udif.h" #include "chrome/utility/safe_browsing/mac/udif.h"
#include "sandbox/mac/seatbelt.h" #include "sandbox/mac/seatbelt.h"
// This executable only works on 10.10+, so unconditionally use these functions
// to make sandboxing easier.
extern "C" {
int mkdirat(int, const char *, mode_t);
int openat(int, const char *, int, ...);
int unlinkat(int, const char *, int);
}
namespace { namespace {
// SafeDMG (crdmg) is a utility that can perform a list or extract operation // SafeDMG (crdmg) is a utility that can perform a list or extract operation
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment