1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-06 11:41:52 +00:00

www/iridium: Update to 2018.5.67

This commit is contained in:
Carlos J. Puga Medina 2018-08-18 14:21:02 +00:00
parent 38cf161faf
commit 13ee5b072d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=477503
743 changed files with 8685 additions and 7719 deletions

View File

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= iridium
PORTVERSION= 58.0
PORTREVISION= 19
PORTVERSION= 2018.5.67
CATEGORIES= www
MASTER_SITES= https://downloads.iridiumbrowser.de/source/
PKGNAMESUFFIX= -browser
@ -27,9 +26,11 @@ BUILD_DEPENDS= gperf:devel/gperf \
${PYTHON_PKGNAMEPREFIX}ply>0:devel/py-ply@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}html5lib>0:www/py-html5lib@${PY_FLAVOR}
LIB_DEPENDS= libspeechd.so:accessibility/speech-dispatcher \
LIB_DEPENDS= libatk-bridge-2.0.so:accessibility/at-spi2-atk \
libspeechd.so:accessibility/speech-dispatcher \
libsnappy.so:archivers/snappy \
libFLAC.so:audio/flac \
libopus.so:audio/opus \
libspeex.so:audio/speex \
libdbus-1.so:devel/dbus \
libdbus-glib-1.so:devel/dbus-glib \
@ -44,22 +45,22 @@ LIB_DEPENDS= libspeechd.so:accessibility/speech-dispatcher \
libpng.so:graphics/png \
libwebp.so:graphics/webp \
libavcodec.so:multimedia/ffmpeg \
libcups.so:print/cups \
libopenh264.so:multimedia/openh264 \
libfreetype.so:print/freetype2 \
libharfbuzz.so:print/harfbuzz \
libharfbuzz-icu.so:print/harfbuzz-icu \
libgcrypt.so:security/libgcrypt \
libgnome-keyring.so:security/libgnome-keyring \
libsecret-1.so:security/libsecret \
libnss3.so:security/nss \
libexpat.so:textproc/expat2 \
libfontconfig.so:x11-fonts/fontconfig
RUN_DEPENDS= xdg-open:devel/xdg-utils \
droid-fonts-ttf>0:x11-fonts/droid-fonts-ttf
noto-lite>0:x11-fonts/noto-lite
ONLY_FOR_ARCHS= amd64 i386
USES= bison desktop-file-utils jpeg ninja perl5 \
pkgconfig python:2.7,build shebangfix tar:xz
USES= bison desktop-file-utils jpeg ninja perl5 pkgconfig \
python:2.7,build shebangfix tar:xz
USE_PERL5= build
USE_XORG= x11 xcb xcomposite xcursor xext xdamage xfixes xi \
@ -77,37 +78,40 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-patch-clang
# replace_gn_files.py script, some parts just turned on/off for target host
# OS "target_os == is_bsd", like libusb, libpci.
GN_ARGS+= clang_use_chrome_plugins=false \
enable_media_router=true \
enable_nacl=false \
enable_one_click_signin=true \
enable_remoting=false \
enable_webrtc=false \
fieldtrial_testing_like_official_build=true \
is_clang=true \
toolkit_views=true \
treat_warnings_as_errors=false \
use_allocator="none" \
use_allocator_shim=false \
use_aura=true \
use_cups=true \
use_experimental_allocator_shim=false \
use_bundled_fontconfig=false \
use_custom_libcxx=false \
use_gnome_keyring=false \
use_gtk3=true \
use_lld=true \
use_sysroot=false \
use_system_freetype=true \
use_system_harfbuzz=true \
use_system_libjpeg=true \
use_system_sqlite=false # chrome has additional patches
extra_cxxflags="-I${LOCALBASE}/include" \
extra_ldflags="-L${LOCALBASE}/lib"
# TODO: investigate building with these options:
# use_system_harfbuzz use_system_minigbm
# use_system_minigbm
GN_BOOTSTRAP_FLAGS= --no-clean --no-rebuild
SUB_FILES= iridium-browser.desktop iridium
SUB_FILES= iridium-browser.desktop iridium pkg-message
SUB_LIST+= COMMENT="${COMMENT}"
OPTIONS_DEFINE= CODECS DEBUG GCONF KERBEROS
OPTIONS_DEFINE= CODECS CUPS DEBUG KERBEROS
CODECS_DESC= Compile and enable patented codecs like H.264
OPTIONS_GROUP= AUDIO
OPTIONS_GROUP_AUDIO= ALSA PULSEAUDIO SNDIO
OPTIONS_DEFAULT= ALSA CODECS GCONF KERBEROS
OPTIONS_DEFAULT= ALSA CODECS CUPS KERBEROS
OPTIONS_SUB= yes
ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib
@ -123,19 +127,21 @@ CODECS_VARS_OFF= GN_ARGS+=ffmpeg_branding="Chromium" \
GN_ARGS+=proprietary_codecs=false \
GN_ARGS+=enable_hevc_demuxing=false
CUPS_LIB_DEPENDS= libcups.so:print/cups
CUPS_VARS= GN_ARGS+=use_cups=true
CUPS_VARS_OFF= GN_ARGS+=use_cups=false
DEBUG_VARS= BUILDTYPE=Debug \
GN_ARGS+=is_debug=true \
GN_ARGS+=is_component_buils=false \
GN_BOOTSTRAP_FLAGS+=--debug \
WANTSPACE="lots of free diskspace (~ 8.5GB)"
WANTSPACE="lots of free diskspace (~ 13GB)"
DEBUG_VARS_OFF= BUILDTYPE=Release \
GN_ARGS+=is_debug=false \
GN_ARGS+=is_official_build=true \
GN_ARGS+=symbol_level=0 \
GN_ARGS+=remove_webcore_debug_symbols=true \
WANTSPACE="a fair amount of free diskspace (~ 3.7GB)"
GCONF_USE= GNOME=gconf2
GCONF_VARS= GN_ARGS+=use_gconf=true
GCONF_VARS_OFF= GN_ARGS+=use_gconf=false
WANTSPACE="a fair amount of free diskspace (~ 6.5GB)"
KERBEROS_VARS= GN_ARGS+=use_kerberos=true
KERBEROS_VARS_OFF= GN_ARGS+=use_kerberos=false
@ -176,6 +182,11 @@ pre-everything::
@${ECHO_MSG} "and ${WANTSPACE}."
@${ECHO_MSG}
post-patch:
@${REINPLACE_CMD} -e 's|@@PACKAGE@@|iridium|' \
-e 's|@@MENUNAME@@|Iridium Web Browser|' \
${WRKSRC}/chrome/app/resources/manpage.1.in
post-patch-SNDIO-on:
@${MKDIR} ${WRKSRC}/media/audio/sndio ${WRKSRC}/media/audio/openbsd
@${CP} ${FILESDIR}/sndio_output.* ${WRKSRC}/media/audio/sndio
@ -189,7 +200,7 @@ pre-configure:
#./build/linux/unbundle/remove_bundled_libraries.py [list of preserved]
cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \
./build/linux/unbundle/replace_gn_files.py --system-libraries \
ffmpeg flac harfbuzz-ng libwebp libxml libxslt snappy yasm || ${FALSE}
ffmpeg flac freetype harfbuzz-ng libdrm libusb libwebp libxml libxslt openh264 opus snappy yasm || ${FALSE}
do-configure:
# GN generator bootstrapping and generating ninja files
@ -200,28 +211,23 @@ do-configure:
gen --args='${GN_ARGS}' out/${BUILDTYPE}
# Setup nodejs dependency
@${MKDIR} ${WRKSRC}/third_party/node/linux/node-linux-x64/bin
${LN} -sf ${LOCALBASE}/bin/node ${WRKSRC}/third_party/node/linux/node-linux-x64/bin/node
@${MKDIR} ${WRKSRC}/third_party/node/freebsd/node-freebsd-x64/bin
${LN} -sf ${LOCALBASE}/bin/node ${WRKSRC}/third_party/node/freebsd/node-freebsd-x64/bin/node
do-install:
@${MKDIR} ${STAGEDIR}${DATADIR}
.for m in font_service test_ime_driver ui
${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${m}.service \
${STAGEDIR}${DATADIR}
.endfor
${INSTALL_MAN} ${WRKSRC}/out/${BUILDTYPE}/chrome.1 ${STAGEDIR}${MANPREFIX}/man/man1/iridium.1
${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*.service ${STAGEDIR}${DATADIR}
${INSTALL_MAN} ${WRKSRC}/chrome/app/resources/manpage.1.in \
${STAGEDIR}${MANPREFIX}/man/man1/iridium.1
.for s in 22 24 48 64 128 256
@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}x${s}/apps
${INSTALL_DATA} ${WRKSRC}/chrome/app/theme/chromium/product_logo_${s}.png \
${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}x${s}/apps/iridium.png
.endfor
.for p in chrome_100_percent chrome_200_percent headless_lib keyboard_resources \
resources mus_app_resources_100 mus_app_resources_200 mus_app_resources_strings \
views_mus_resources
${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${p}.pak \
${STAGEDIR}${DATADIR}
.endfor
.for d in icudtl.dat natives_blob.bin snapshot_blob.bin
${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*.png ${STAGEDIR}${DATADIR}
${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/*.pak ${STAGEDIR}${DATADIR}
.for d in protoc icudtl.dat mksnapshot natives_blob.bin snapshot_blob.bin v8_context_snapshot.bin
${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${d} ${STAGEDIR}${DATADIR}
.endfor
${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/chrome \
@ -232,7 +238,19 @@ do-install:
${INSTALL_DATA} ${WRKDIR}/iridium-browser.desktop \
${STAGEDIR}${DESKTOPDIR}
${INSTALL_SCRIPT} ${WRKDIR}/iridium ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/mksnapshot \
.for f in libEGL.so libGLESv2.so
${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR}
.endfor
@${MKDIR} ${STAGEDIR}${DATADIR}/swiftshader
.for g in libEGL.so libGLESv2.so
${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/swiftshader/${g} \
${STAGEDIR}${DATADIR}/swiftshader
.endfor
post-install-DEBUG-on:
${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/*.so \
${STAGEDIR}${DATADIR}
${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/character_data_generator \
${STAGEDIR}${DATADIR}
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1493328523
SHA256 (iridium-browser-58.0.tar.xz) = ec59bf66b1d686c85172c7b9dade6bbda10600df25b17f86a1847d29d8bb9d62
SIZE (iridium-browser-58.0.tar.xz) = 552368772
TIMESTAMP = 1534375076
SHA256 (iridium-browser-2018.5.67.tar.xz) = fd9631aa338954928a96bc9f3711e0273bf5b616dddeb792e303cecd22bba367
SIZE (iridium-browser-2018.5.67.tar.xz) = 610734108

View File

@ -3,14 +3,12 @@
// found in the LICENSE file.
#include "base/metrics/histogram_macros.h"
#include "base/memory/ptr_util.h"
#include "media/audio/openbsd/audio_manager_openbsd.h"
#include "media/audio/audio_device_description.h"
#include "media/audio/audio_output_dispatcher.h"
#if defined(USE_PULSEAUDIO)
#include "media/audio/pulse/audio_manager_pulse.h"
#endif
#if defined(USE_SNDIO)
#include "media/audio/sndio/sndio_input.h"
#include "media/audio/sndio/sndio_output.h"
@ -48,10 +46,6 @@ bool AudioManagerOpenBSD::HasAudioInputDevices() {
return true;
}
void AudioManagerOpenBSD::ShowAudioInputSettings() {
NOTIMPLEMENTED();
}
void AudioManagerOpenBSD::GetAudioInputDeviceNames(
AudioDeviceNames* device_names) {
DCHECK(device_names->empty());
@ -79,15 +73,12 @@ AudioParameters AudioManagerOpenBSD::GetInputStreamParameters(
return AudioParameters(
AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO,
kDefaultSampleRate, 16, buffer_size);
kDefaultSampleRate, buffer_size);
}
AudioManagerOpenBSD::AudioManagerOpenBSD(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
AudioLogFactory* audio_log_factory)
: AudioManagerBase(std::move(task_runner),
std::move(worker_task_runner),
AudioManagerOpenBSD::AudioManagerOpenBSD(std::unique_ptr<AudioThread> audio_thread,
AudioLogFactory* audio_log_factory)
: AudioManagerBase(std::move(audio_thread),
audio_log_factory) {
DLOG(WARNING) << "AudioManagerOpenBSD";
SetMaxOutputStreamsAllowed(kMaxOutputStreams);
@ -139,10 +130,8 @@ AudioParameters AudioManagerOpenBSD::GetPreferredOutputStreamParameters(
ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO;
int sample_rate = kDefaultSampleRate;
int buffer_size = kDefaultOutputBufferSize;
int bits_per_sample = 16;
if (input_params.IsValid()) {
sample_rate = input_params.sample_rate();
bits_per_sample = input_params.bits_per_sample();
channel_layout = input_params.channel_layout();
buffer_size = std::min(buffer_size, input_params.frames_per_buffer());
}
@ -153,7 +142,7 @@ AudioParameters AudioManagerOpenBSD::GetPreferredOutputStreamParameters(
return AudioParameters(
AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout,
sample_rate, bits_per_sample, buffer_size);
sample_rate, buffer_size);
}
AudioInputStream* AudioManagerOpenBSD::MakeInputStream(
@ -170,34 +159,17 @@ AudioOutputStream* AudioManagerOpenBSD::MakeOutputStream(
}
#endif
ScopedAudioManagerPtr CreateAudioManager(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
std::unique_ptr<media::AudioManager> CreateAudioManager(
std::unique_ptr<AudioThread> audio_thread,
AudioLogFactory* audio_log_factory) {
DLOG(WARNING) << "CreateAudioManager";
#if defined(USE_PULSEAUDIO)
// Do not move task runners when creating AudioManagerPulse.
// If the creation fails, we need to use the task runners to create other
// AudioManager implementations.
std::unique_ptr<AudioManagerPulse, AudioManagerDeleter> manager(
new AudioManagerPulse(task_runner, worker_task_runner,
audio_log_factory));
if (manager->Init()) {
UMA_HISTOGRAM_ENUMERATION("Media.OpenBSDAudioIO", kPulse, kAudioIOMax + 1);
return std::move(manager);
}
DVLOG(1) << "PulseAudio is not available on the OS";
#endif
#if defined(USE_SNDIO)
UMA_HISTOGRAM_ENUMERATION("Media.OpenBSDAudioIO", kSndio, kAudioIOMax + 1);
return ScopedAudioManagerPtr(
new AudioManagerOpenBSD(std::move(task_runner),
std::move(worker_task_runner),audio_log_factory));
return std::make_unique<AudioManagerOpenBSD>(std::move(audio_thread),
audio_log_factory);
#else
return ScopedAudioManagerPtr(
new FakeAudioManager(std::move(task_runner),
std::move(worker_task_runner), audio_log_factory));
return std::make_unique<FakeAudioManager>(std::move(audio_thread),
audio_log_factory);
#endif
}

View File

@ -17,15 +17,13 @@ namespace media {
class MEDIA_EXPORT AudioManagerOpenBSD : public AudioManagerBase {
public:
AudioManagerOpenBSD(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
AudioLogFactory* audio_log_factory);
AudioManagerOpenBSD(std::unique_ptr<AudioThread> audio_thread,
AudioLogFactory* audio_log_factory);
~AudioManagerOpenBSD() override;
// Implementation of AudioManager.
bool HasAudioOutputDevices() override;
bool HasAudioInputDevices() override;
void ShowAudioInputSettings() override;
void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override;
void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override;
AudioParameters GetInputStreamParameters(
@ -50,8 +48,6 @@ class MEDIA_EXPORT AudioManagerOpenBSD : public AudioManagerBase {
const LogCallback& log_callback) override;
protected:
~AudioManagerOpenBSD() override;
AudioParameters GetPreferredOutputStreamParameters(
const std::string& output_device_id,
const AudioParameters& input_params) override;

View File

@ -27,20 +27,6 @@
if (*ptr == kFinalTlsValue)
return; // We've been called enough times.
ASSERT_LT(kFinalTlsValue, *ptr);
--- base/tracked_objects_unittest.cc.orig 2015-08-22 15:01:51.000000000 -0400
+++ base/tracked_objects_unittest.cc 2015-09-03 09:20:53.370191000 -0400
@@ -58,9 +58,9 @@
Births* birth = ThreadData::TallyABirthIfActive(location);
if (ThreadData::status() == ThreadData::DEACTIVATED)
- EXPECT_EQ(reinterpret_cast<Births*>(NULL), birth);
+ EXPECT_EQ(static_cast<Births*>(NULL), birth);
else
- EXPECT_NE(reinterpret_cast<Births*>(NULL), birth);
+ EXPECT_NE(static_cast<Births*>(NULL), birth);
}
// Helper function to verify the most common test expectations.
--- media/audio/audio_output_proxy_unittest.cc 2015-04-15 00:18:55.000000000 +0200
+++ media/audio/audio_output_proxy_unittest.cc 2015-04-18 22:02:38.000000000 +0200
@@ -387,7 +387,7 @@

View File

@ -1,8 +1,8 @@
--- build/toolchain/gcc_toolchain.gni.orig 2017-04-19 21:06:28.000000000 +0200
+++ build/toolchain/gcc_toolchain.gni 2018-06-19 17:35:48.967441000 +0200
@@ -12,6 +12,11 @@
import("//build/toolchain/goma.gni")
import("//build/toolchain/toolchain.gni")
--- build/toolchain/gcc_toolchain.gni.orig 2018-03-20 23:05:14.000000000 +0100
+++ build/toolchain/gcc_toolchain.gni 2018-06-18 20:55:17.080248000 +0200
@@ -25,6 +25,11 @@
rebase_path("//build/toolchain/clang_static_analyzer_wrapper.py",
root_build_dir) + " --mode=clang"
+declare_args() {
+ extra_cxxflags = ""
@ -12,7 +12,7 @@
# This template defines a toolchain for something that works like gcc
# (including clang).
#
@@ -483,10 +488,23 @@
@@ -596,13 +601,23 @@
}
gcc_toolchain(target_name) {
@ -20,6 +20,9 @@
- cc = "$prefix/clang"
- cxx = "$prefix/clang++"
- ld = cxx
- readelf = "${toolprefix}readelf"
- ar = "${prefix}/llvm-ar"
- nm = "${toolprefix}nm"
+ if (is_bsd) {
+ prefix = "/usr/local/bin"
+ cc = "cc"
@ -34,20 +37,85 @@
+ cxx = "$prefix/clang++"
+ ld = cxx
+ readelf = "${toolprefix}readelf"
+ ar = "${toolprefix}ar"
+ ar = "${prefix}/llvm-ar"
+ nm = "${toolprefix}nm"
+ }
if (use_clang_static_analyzer) {
# Static analysis isn't supported under GOMA. See crbug.com/687245
@@ -506,10 +524,6 @@
rebase_path("//third_party/scan-build/src/libexec/c++-analyzer",
root_build_dir)
}
forward_variables_from(invoker,
[
--- build/config/compiler/BUILD.gn.orig 2018-06-13 00:10:02.000000000 +0200
+++ build/config/compiler/BUILD.gn 2018-07-21 13:05:54.418405000 +0200
@@ -51,7 +51,7 @@
# only two architectures that are currently checked in). Turn this off when
# you are using a custom toolchain and need to control -B in cflags.
linux_use_bundled_binutils =
- linux_use_bundled_binutils_override && is_linux &&
+ linux_use_bundled_binutils_override && (is_linux && !is_bsd) &&
(current_cpu == "x64" || current_cpu == "x86")
binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
root_build_dir)
@@ -375,8 +375,6 @@
"-Wl,-z,relro",
]
if (!using_sanitizer) {
- ldflags += [ "-Wl,-z,defs" ]
-
- readelf = "${toolprefix}readelf"
- ar = "${toolprefix}ar"
- nm = "${toolprefix}nm"
forward_variables_from(invoker, [ "strip" ])
# Functions interposed by the sanitizers can make ld think
# that some libraries aren't needed when they actually are,
# http://crbug.com/234010. As workaround, disable --as-needed.
@@ -467,7 +465,7 @@
# TODO(hans): Remove this once Clang generates better optimized debug info by
# default. https://crbug.com/765793
if (is_clang && !is_nacl && current_toolchain == host_toolchain &&
- target_os != "chromeos") {
+ target_os != "chromeos" && !is_bsd) {
cflags += [
"-Xclang",
"-mllvm",
@@ -708,7 +706,7 @@
cflags += [ "-mtune=$arm_tune" ]
}
} else if (current_cpu == "arm64") {
- if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
+ if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_bsd) {
cflags += [ "--target=aarch64-linux-gnu" ]
ldflags += [ "--target=aarch64-linux-gnu" ]
}
@@ -1387,10 +1385,6 @@
# TODO(hans): https://crbug.com/766891
"-Wno-null-pointer-arithmetic",
-
- # Ignore warnings about MSVC optimization pragmas.
- # TODO(thakis): Only for no_chromium_code? http://crbug.com/505314
- "-Wno-ignored-pragma-optimize",
]
if (llvm_force_head_revision) {
cflags += [
@@ -2096,7 +2090,7 @@
# [1] crrev.com/a81d5ade0b043208e06ad71a38bcf9c348a1a52f
cflags += [ "-gdwarf-3" ]
}
- cflags += [ "-g2" ]
+ cflags += [ "-g0" ]
}
if (use_debug_fission && !is_nacl) {
cflags += [ "-gsplit-dwarf" ]
@@ -2110,7 +2104,7 @@
# DWARF info may be corrupt; offsets in a range list entry are in different
# sections" there. Maybe just a bug in nacl_switch_32.S.
if (!is_mac && !is_ios && !is_nacl && target_cpu != "x86" &&
- (use_gold || use_lld)) {
+ (use_gold || use_lld) && !is_bsd) {
if (is_clang) {
# This flag enables the GNU-format pubnames and pubtypes sections,
# which lld needs in order to generate a correct GDB index.
@@ -2207,7 +2201,7 @@
if (!is_win && fatal_linker_warnings &&
!(is_chromeos && current_cpu == "arm") &&
!(is_android && use_order_profiling) && !is_mac && !is_ios &&
- current_os != "aix") {
+ current_os != "aix" && !is_bsd) {
# TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
# TODO(lizeb,pasko): Fix link errors when linking with order_profiling=1
# crbug.com/485542

View File

@ -1,8 +1,8 @@
--- build/toolchain/gcc_toolchain.gni.orig 2017-04-19 19:06:28 UTC
+++ build/toolchain/gcc_toolchain.gni
@@ -12,6 +12,11 @@ import("//build/toolchain/clang_static_a
import("//build/toolchain/goma.gni")
import("//build/toolchain/toolchain.gni")
--- build/toolchain/gcc_toolchain.gni.orig 2018-06-13 00:10:02.000000000 +0200
+++ build/toolchain/gcc_toolchain.gni 2018-07-21 12:38:45.107087000 +0200
@@ -25,6 +25,11 @@
rebase_path("//build/toolchain/clang_static_analyzer_wrapper.py",
root_build_dir) + " --mode=clang"
+declare_args() {
+ extra_cxxflags = ""
@ -12,7 +12,22 @@
# This template defines a toolchain for something that works like gcc
# (including clang).
#
@@ -483,10 +488,22 @@ template("clang_toolchain") {
@@ -343,12 +348,12 @@
# We use slightly different arflags for AIX.
extra_arflags = "-r -c -s"
} else {
- extra_arflags = "-r -c -s -D"
+ extra_arflags = "rcsD"
}
# Almost all targets build with //build/config/compiler:thin_archive which
# adds -T to arflags.
- command = "$python_path \"$ar_wrapper\"$whitelist_flag --output={{output}} --ar=\"$ar\" \"{{arflags}} $extra_arflags\" @\"$rspfile\""
+ command = "$python_path \"$ar_wrapper\"$whitelist_flag --output={{output}} --ar=\"$ar\" {{arflags}} $extra_arflags @\"$rspfile\""
description = "AR {{output}}"
rspfile_content = "{{inputs}}"
outputs = [
@@ -608,13 +613,22 @@
}
gcc_toolchain(target_name) {
@ -20,6 +35,9 @@
- cc = "$prefix/clang"
- cxx = "$prefix/clang++"
- ld = cxx
- readelf = "${toolprefix}readelf"
- ar = "${prefix}/llvm-ar"
- nm = "${toolprefix}nm"
+ if (is_bsd) {
+ cc = "${toolprefix}clang60"
+ cxx = "${toolprefix}clang++60"
@ -33,20 +51,98 @@
+ cxx = "$prefix/clang++"
+ ld = cxx
+ readelf = "${toolprefix}readelf"
+ ar = "${toolprefix}ar"
+ ar = "${prefix}/llvm-ar"
+ nm = "${toolprefix}nm"
+ }
if (use_clang_static_analyzer) {
# Static analysis isn't supported under GOMA. See crbug.com/687245
@@ -507,10 +524,6 @@ template("clang_toolchain") {
root_build_dir)
}
- readelf = "${toolprefix}readelf"
- ar = "${toolprefix}ar"
- nm = "${toolprefix}nm"
forward_variables_from(invoker,
[
--- build/config/compiler/BUILD.gn.orig 2018-06-13 00:10:02.000000000 +0200
+++ build/config/compiler/BUILD.gn 2018-07-21 12:57:03.823912000 +0200
@@ -51,7 +51,7 @@
# only two architectures that are currently checked in). Turn this off when
# you are using a custom toolchain and need to control -B in cflags.
linux_use_bundled_binutils =
- linux_use_bundled_binutils_override && is_linux &&
+ linux_use_bundled_binutils_override && (is_linux && !is_bsd) &&
(current_cpu == "x64" || current_cpu == "x86")
binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
root_build_dir)
@@ -375,8 +375,6 @@
"-Wl,-z,relro",
]
if (!using_sanitizer) {
- ldflags += [ "-Wl,-z,defs" ]
-
forward_variables_from(invoker, [ "strip" ])
# Functions interposed by the sanitizers can make ld think
# that some libraries aren't needed when they actually are,
# http://crbug.com/234010. As workaround, disable --as-needed.
@@ -467,7 +465,7 @@
# TODO(hans): Remove this once Clang generates better optimized debug info by
# default. https://crbug.com/765793
if (is_clang && !is_nacl && current_toolchain == host_toolchain &&
- target_os != "chromeos") {
+ target_os != "chromeos" && !is_bsd) {
cflags += [
"-Xclang",
"-mllvm",
@@ -708,7 +706,7 @@
cflags += [ "-mtune=$arm_tune" ]
}
} else if (current_cpu == "arm64") {
- if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
+ if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_bsd) {
cflags += [ "--target=aarch64-linux-gnu" ]
ldflags += [ "--target=aarch64-linux-gnu" ]
}
@@ -1387,10 +1385,6 @@
toolchain_args = {
# TODO(hans): https://crbug.com/766891
"-Wno-null-pointer-arithmetic",
-
- # Ignore warnings about MSVC optimization pragmas.
- # TODO(thakis): Only for no_chromium_code? http://crbug.com/505314
- "-Wno-ignored-pragma-optimize",
]
if (llvm_force_head_revision) {
cflags += [
@@ -1572,9 +1566,9 @@
if ((is_posix && !is_nacl) || is_fuchsia) {
# TODO(thomasanderson): Enable on ChromeOS builds once
# https://crbug.com/829956 is fixed.
- if (default_toolchain != "//build/toolchain/cros:target") {
- arflags = [ "-T" ]
- }
+ # if (default_toolchain != "//build/toolchain/cros:target") {
+ # arflags = [ "-T" ]
+ # }
}
}
@@ -2096,7 +2090,7 @@
# [1] crrev.com/a81d5ade0b043208e06ad71a38bcf9c348a1a52f
cflags += [ "-gdwarf-3" ]
}
- cflags += [ "-g2" ]
+ cflags += [ "-g0" ]
}
if (use_debug_fission && !is_nacl) {
cflags += [ "-gsplit-dwarf" ]
@@ -2110,7 +2104,7 @@
# DWARF info may be corrupt; offsets in a range list entry are in different
# sections" there. Maybe just a bug in nacl_switch_32.S.
if (!is_mac && !is_ios && !is_nacl && target_cpu != "x86" &&
- (use_gold || use_lld)) {
+ (use_gold || use_lld) && !is_bsd) {
if (is_clang) {
# This flag enables the GNU-format pubnames and pubtypes sections,
# which lld needs in order to generate a correct GDB index.
@@ -2207,7 +2201,7 @@
if (!is_win && fatal_linker_warnings &&
!(is_chromeos && current_cpu == "arm") &&
!(is_android && use_order_profiling) && !is_mac && !is_ios &&
- current_os != "aix") {
+ current_os != "aix" && !is_bsd) {
# TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
# TODO(lizeb,pasko): Fix link errors when linking with order_profiling=1
# crbug.com/485542

View File

@ -1,173 +1,87 @@
--- BUILD.gn.orig 2017-04-19 19:06:27 UTC
+++ BUILD.gn
@@ -220,7 +220,7 @@ group("both_gn_and_gyp") {
]
}
- if (!is_ios && !is_android && !is_chromecast) {
+ if (!is_ios && !is_android && !is_bsd && !is_chromecast) {
deps += [
"//chrome",
"//chrome/test:browser_tests",
@@ -277,7 +277,7 @@ group("both_gn_and_gyp") {
]
}
- if (!is_ios) {
+ if (!is_ios && !is_bsd) {
# TODO(GYP): Figure out which of these should actually build on iOS,
# and whether there should be other targets that are iOS-only and missing.
deps += [
@@ -322,7 +322,7 @@ group("both_gn_and_gyp") {
"//ui/touch_selection:ui_touch_selection_unittests",
"//url/ipc:url_ipc_unittests",
]
- } else {
+ } else if (!is_bsd) {
deps += [ "//ios:all" ]
}
@@ -482,7 +482,7 @@ group("both_gn_and_gyp") {
]
}
- if (is_linux) {
+ if (is_linux || is_bsd) {
# The following are definitely linux-only.
deps += [
"//chrome:manpage",
@@ -505,9 +505,16 @@ group("both_gn_and_gyp") {
# TODO(dpranke): add the linux_dump_symbols flag?
deps += [ "//chrome:linux_symbols" ]
}
+
+ if (is_bsd) {
+ deps -= [
+ "//sandbox/linux:chrome_sandbox",
+ "//sandbox/linux:sandbox_linux_unittests",
+ ]
+ }
}
- if (is_ios || is_win || (is_linux && !is_chromeos)) {
+ if (is_ios || is_win || is_bsd || (is_linux && !is_chromeos)) {
deps += [
"//base:base_i18n_perftests",
"//base:base_perftests",
@@ -578,7 +585,7 @@ group("both_gn_and_gyp") {
if (enable_nacl) {
deps += [ "//components/nacl/loader:nacl_loader_unittests" ]
- if (is_linux) {
+ if (is_linux || is_bsd) {
# TODO(dpranke): Figure out what platforms should actually have this.
deps += [ "//components/nacl/loader:nacl_helper" ]
@@ -684,7 +691,7 @@ group("both_gn_and_gyp") {
deps +=
[ "//chrome/installer/mini_installer:next_version_mini_installer" ]
}
- } else if (!is_android && !is_ios) {
+ } else if (!is_android && !is_ios && !is_bsd) {
deps += [ "//breakpad:symupload($host_toolchain)" ]
}
@@ -728,7 +735,7 @@ group("gn_only") {
deps += [ "//components/proximity_auth:proximity_auth_unittests" ]
}
- if (is_win || is_linux) {
+ if (is_win || is_linux || is_bsd) {
deps += [
"//mash:all",
"//media/mojo/services:media_service_unittests",
@@ -754,7 +761,7 @@ group("gn_only") {
--- BUILD.gn.orig 2018-06-13 00:09:58.000000000 +0200
+++ BUILD.gn 2018-07-14 12:26:56.482016000 +0200
@@ -359,7 +359,7 @@
}
}
- if (is_linux && !is_chromeos && !is_chromecast) {
+ if ((is_linux || is_bsd) && !is_chromeos && !is_chromecast) {
# TODO(GYP): Figure out if any of these should be in gn_all
# and figure out how cross-platform they are
- if (is_linux || is_android) {
+ if ((is_linux && !is_bsd) || is_android) {
deps += [
@@ -794,7 +801,7 @@ group("gn_only") {
}
"//third_party/breakpad:breakpad_unittests",
"//third_party/breakpad:core-2-minidump",
@@ -401,8 +401,6 @@
"//net:disk_cache_memory_test",
"//net:quic_client",
"//net:quic_server",
- "//sandbox/linux:chrome_sandbox",
- "//sandbox/linux:sandbox_linux_unittests",
"//testing:empty_main",
]
if (target_cpu == "x86" || target_cpu == "x64") {
- if (!is_android) {
+ if (!is_android && !is_bsd) {
deps += [ "//chrome/test:load_library_perf_tests" ]
}
deps += [
@@ -802,7 +809,7 @@ group("gn_only") {
"//third_party/libjpeg_turbo:simd_asm",
@@ -460,10 +458,6 @@
"//chrome/test/chromedriver:chromedriver",
"//chrome/test/chromedriver:chromedriver_tests",
"//components/sync:run_sync_testserver",
- "//courgette:courgette",
- "//courgette:courgette_fuzz",
- "//courgette:courgette_minimal_tool",
- "//courgette:courgette_unittests",
"//media/cast:generate_barcode_video",
"//media/cast:generate_timecode_audio",
"//net:crash_cache",
@@ -519,10 +513,6 @@
"//mojo:mojo_perftests",
"//services/service_manager/public/cpp",
"//testing/gmock:gmock_main",
- "//third_party/breakpad:dump_syms($host_toolchain)",
- "//third_party/breakpad:microdump_stackwalk($host_toolchain)",
- "//third_party/breakpad:minidump_dump($host_toolchain)",
- "//third_party/breakpad:minidump_stackwalk($host_toolchain)",
]
if (!is_android) {
@@ -598,7 +588,7 @@
host_os == "win") {
deps += [ "//chrome/test/mini_installer:mini_installer_tests" ]
}
- } else if (!is_android && !is_ios && !is_fuchsia) {
+ } else if (!is_android && !is_ios && !is_fuchsia && !is_bsd) {
deps += [ "//third_party/breakpad:symupload($host_toolchain)" ]
}
@@ -818,7 +808,6 @@
"//ppapi/examples/video_decode",
"//sandbox/linux:chrome_sandbox",
"//sandbox/linux:sandbox_linux_unittests",
- "//third_party/breakpad:minidump_stackwalk($host_toolchain)",
# Blocked on https://github.com/catapult-project/catapult/issues/2297
#"//third_party/catapult/telemetry:bitmaptools",
@@ -921,7 +910,7 @@
]
}
- if (is_linux && current_toolchain == host_toolchain) {
+ if ((is_linux || is_bsd) && current_toolchain == host_toolchain) {
deps += [ "//v8:v8_shell" ]
}
}
@@ -812,7 +819,7 @@ group("gn_only") {
}
if ((is_linux && !is_chromeos && !is_chromecast) || (is_win && use_drfuzz) ||
- (use_libfuzzer && is_mac)) {
+ (use_libfuzzer && is_mac) || is_bsd) {
deps += [
"//testing/libfuzzer/fuzzers",
"//testing/libfuzzer/tests:libfuzzer_tests",
@@ -844,7 +851,7 @@ group("gn_only") {
group("gn_mojo_targets") {
testonly = true
- if (is_linux && !is_chromeos) {
+ if ((is_linux || is_bsd) && !is_chromeos) {
# TODO(GYP): Figure out if any of these should be in gn_all
# and figure out how cross-platform they are
deps = [
@@ -870,7 +877,7 @@ group("gn_visibility") {
}
}
-if (!is_ios) {
+if (!is_ios || !is_bsd) {
# This group includes all of the targets needed to build and test Blink,
# including running the layout tests (see below).
group("blink_tests") {
@@ -935,7 +942,7 @@ if (!is_ios) {
data_deps += [ "//content/shell:content_shell_crash_service" ]
}
- if (!is_win && !is_android) {
+ if (!is_win && !is_android && !is_bsd) {
data_deps += [ "//breakpad:minidump_stackwalk($host_toolchain)" ]
data_deps +=
[ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ]
}
@@ -943,7 +950,7 @@ if (!is_ios) {
data_deps += [ "//breakpad:dump_syms($host_toolchain)" ]
@@ -930,7 +919,7 @@
data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
}
- if (is_linux) {
+ if (is_linux && !is_bsd) {
data_deps += [ "//breakpad:dump_syms($host_toolchain)" ]
data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
}
@@ -979,7 +986,7 @@ group("chromium_swarm_tests") {
group("chromium_builder_perf") {
testonly = true
@@ -1055,9 +1044,6 @@
- if (!is_ios && !is_android && !is_chromecast) {
+ if (!is_ios && !is_android && !is_chromecast && !is_bsd) {
data_deps = [
"//cc:cc_perftests",
"//chrome/test:load_library_perf_tests",
@@ -1009,7 +1016,7 @@ group("chromium_builder_perf") {
"//chrome/installer/mini_installer:mini_installer",
"//chrome/test:angle_perftests",
]
if (is_win) {
data_deps += [ "//chrome/installer/mini_installer:mini_installer" ]
- } else {
+ } else if (!is_bsd) {
data_deps += [ "//breakpad:minidump_stackwalk($host_toolchain)" ]
- data_deps +=
- [ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ]
}
}
if (is_win || is_android) {
data_deps += [

View File

@ -1,6 +1,6 @@
--- apps/ui/views/app_window_frame_view.cc.orig 2017-04-19 19:06:27 UTC
--- apps/ui/views/app_window_frame_view.cc.orig 2017-06-05 19:03:00 UTC
+++ apps/ui/views/app_window_frame_view.cc
@@ -132,7 +132,7 @@ gfx::Rect AppWindowFrameView::GetBoundsF
@@ -132,7 +132,7 @@ gfx::Rect AppWindowFrameView::GetBoundsForClientView()
gfx::Rect AppWindowFrameView::GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const {
gfx::Rect window_bounds = client_bounds;

View File

@ -1,6 +1,6 @@
--- ash/display/mirror_window_controller.cc.orig 2017-04-19 19:06:27 UTC
--- ash/display/mirror_window_controller.cc.orig 2017-06-05 19:03:00 UTC
+++ ash/display/mirror_window_controller.cc
@@ -251,7 +251,11 @@ void MirrorWindowController::UpdateWindo
@@ -249,7 +249,11 @@ void MirrorWindowController::UpdateWindow(
return info.id() == iter->first;
}) == display_info_list.end()) {
CloseAndDeleteHost(iter->second, true);

View File

@ -1,33 +1,52 @@
--- base/BUILD.gn.orig 2017-04-19 21:06:28.000000000 +0200
+++ base/BUILD.gn 2017-06-15 22:17:54.935972000 +0200
@@ -1156,6 +1156,9 @@
--- base/BUILD.gn.orig 2017-12-15 02:04:05.000000000 +0100
+++ base/BUILD.gn 2017-12-30 01:18:00.438461000 +0100
@@ -1125,7 +1125,7 @@
# Needed for <atomic> if using newer C++ library than sysroot, except if
# building inside the cros_sdk environment - use host_toolchain as a
# more robust check for this.
- if (!use_sysroot && (is_android || (is_linux && !is_chromecast)) &&
+ if (!use_sysroot && (is_android || (is_linux && !is_chromecast) && !is_clang) &&
host_toolchain != "//build/toolchain/cros:host") {
libs = [ "atomic" ]
}
@@ -1151,7 +1151,7 @@
"allocator/allocator_shim_override_glibc_weak_symbols.h",
]
deps += [ "//base/allocator:tcmalloc" ]
} else if (is_linux && use_allocator == "none") {
- } else if (is_linux && use_allocator == "none") {
+ } else if ((is_linux && !is_bsd) && use_allocator == "none") {
sources += [ "allocator/allocator_shim_default_dispatch_to_glibc.cc" ]
+ } else if (is_bsd && use_allocator == "none") {
+ # TODO move the code to "allocator_shim_default_dispatch_to_glibc.cc"
+ sources += [ "allocator/allocator_shim_default_dispatch_to_glibc.cc" ]
} else if (is_android && use_allocator == "none") {
sources += [
"allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc",
@@ -1171,6 +1174,33 @@
@@ -1539,7 +1539,7 @@
"//base/third_party/xdg_user_dirs",
]
} else {
- # Non-Linux.
+ # Non-Linux/BSD.
sources -= [
"nix/mime_util_xdg.cc",
"nix/mime_util_xdg.h",
@@ -1555,6 +1555,33 @@
}
}
+ if (is_bsd) {
+ sources -= [
+ "files/file_util_linux.cc",
+ "files/file_path_watcher_linux.cc",
+ "files/file_util_linux.cc",
+ "process/memory_linux.cc",
+ "process/process_linux.cc",
+ "process/process_handle_linux.cc",
+ "process/process_iterator_linux.cc",
+ "process/process_metrics_linux.cc",
+ "process/process_handle_linux.cc",
+ "sys_info_linux.cc",
+ "trace_event/malloc_dump_provider.cc",
+ "trace_event/malloc_dump_provider.h",
+ "sys_info_linux.cc"
+ ]
+ sources += [
+ "files/file_path_watcher_kqueue.cc",
+ "files/file_path_watcher_kqueue.h",
+ "files/file_path_watcher_stub.cc",
+ "process/memory_stubs.cc",
+ "process/process_handle_freebsd.cc",
+ "process/process_iterator_freebsd.cc",
+ "process/process_metrics_freebsd.cc",
@ -38,54 +57,20 @@
+ "kvm" # process_metrics_freebsd
+ ]
+ }
+
+
+
# Allow more direct string conversions on platforms with native utf8
# strings
if (is_mac || is_ios || is_chromeos || is_chromecast) {
@@ -1467,7 +1497,7 @@
}
# Linux.
- if (is_linux) {
+ if (is_linux || is_bsd) {
if (is_asan || is_lsan || is_msan || is_tsan) {
# For llvm-sanitizer.
data += [ "//third_party/llvm-build/Release+Asserts/lib/libstdc++.so.6" ]
@@ -1492,7 +1522,7 @@
"//base/third_party/xdg_user_dirs",
]
} else {
- # Non-Linux.
+ # Non-Linux/BSD.
sources -= [
"nix/mime_util_xdg.cc",
"nix/mime_util_xdg.h",
@@ -1508,6 +1538,13 @@
}
}
+ if (is_bsd) {
+ sources -= [
+ "threading/platform_thread_linux.cc",
+ ]
+ sources += [ "threading/platform_thread_freebsd.cc" ]
+ }
+
# iOS
if (is_ios) {
set_sources_assignment_filter([])
@@ -2307,6 +2344,12 @@
"trace_event/trace_event_android_unittest.cc",
@@ -2389,6 +2416,12 @@
]
set_sources_assignment_filter(sources_assignment_filter)
+ }
}
+
+ if (is_bsd) {
+ sources -= [
+ "debug/proc_maps_linux_unittest.cc",
+ ]
}
+ }
if (is_win) {
deps += [ "//base:scoped_handle_test_dll" ]

View File

@ -1,6 +1,6 @@
--- base/allocator/allocator_shim.cc.orig 2017-04-19 19:06:28 UTC
--- base/allocator/allocator_shim.cc.orig 2017-06-05 19:03:00 UTC
+++ base/allocator/allocator_shim.cc
@@ -81,7 +81,7 @@ inline const allocator::AllocatorDispatc
@@ -83,7 +83,7 @@ inline const allocator::AllocatorDispatch* GetChainHea
// Unfortunately due to that bug NoBarrier_Load() is mistakenly fully
// barriered on Linux+Clang, and that causes visible perf regressons.
return reinterpret_cast<const allocator::AllocatorDispatch*>(

View File

@ -1,15 +1,15 @@
--- base/allocator/allocator_shim_default_dispatch_to_glibc.cc.orig 2017-04-19 19:06:28 UTC
--- base/allocator/allocator_shim_default_dispatch_to_glibc.cc.orig 2017-06-05 19:03:00 UTC
+++ base/allocator/allocator_shim_default_dispatch_to_glibc.cc
@@ -3,19 +3,28 @@
// found in the LICENSE file.
#include "base/allocator/allocator_shim.h"
-
-#include <malloc.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <malloc_np.h>
-#include <malloc.h>
-
// This translation unit defines a default dispatch for the allocator shim which
// routes allocations to libc functions.
-// The code here is strongly inspired from tcmalloc's libc_override_glibc.h.

View File

@ -1,6 +1,6 @@
--- base/allocator/allocator_shim_unittest.cc.orig 2017-04-19 19:06:28 UTC
--- base/allocator/allocator_shim_unittest.cc.orig 2017-06-05 19:03:00 UTC
+++ base/allocator/allocator_shim_unittest.cc
@@ -289,7 +289,7 @@ TEST_F(AllocatorShimTest, InterceptLibcS
@@ -293,7 +293,7 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
ASSERT_GE(aligned_allocs_intercepted_by_size[61], 1u);
#endif // !OS_WIN
@ -9,7 +9,7 @@
void* memalign_ptr = memalign(128, 53);
ASSERT_NE(nullptr, memalign_ptr);
ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(memalign_ptr) % 128);
@@ -302,7 +302,7 @@ TEST_F(AllocatorShimTest, InterceptLibcS
@@ -306,7 +306,7 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
ASSERT_GE(aligned_allocs_intercepted_by_alignment[kPageSize], 1u);
// pvalloc rounds the size up to the next page.
ASSERT_GE(aligned_allocs_intercepted_by_size[kPageSize], 1u);
@ -18,7 +18,7 @@
char* realloc_ptr = static_cast<char*>(malloc(10));
strcpy(realloc_ptr, "foobar");
@@ -318,13 +318,13 @@ TEST_F(AllocatorShimTest, InterceptLibcS
@@ -322,13 +322,13 @@ TEST_F(AllocatorShimTest, InterceptLibcSymbols) {
free(zero_alloc_ptr);
ASSERT_GE(frees_intercepted_by_addr[Hash(zero_alloc_ptr)], 1u);

View File

@ -1,20 +0,0 @@
--- base/base_paths_posix.cc.orig 2017-04-19 19:06:28 UTC
+++ base/base_paths_posix.cc
@@ -67,13 +67,13 @@ bool PathProviderPosix(int key, FilePath
}
*result = FilePath(bin_dir);
return true;
-#elif defined(OS_OPENBSD)
- // There is currently no way to get the executable path on OpenBSD
+#elif defined(OS_BSD)
+ // There is currently no way to get the executable path on FreeBSD
char* cpath;
- if ((cpath = getenv("CHROME_EXE_PATH")) != NULL)
+ if ((cpath = getenv("IRIDIUM_EXE_PATH")) != NULL)
*result = FilePath(cpath);
else
- *result = FilePath("/usr/local/chrome/chrome");
+ *result = FilePath("/usr/local/iridium/iridium");
return true;
#endif
}

View File

@ -0,0 +1,57 @@
--- base/debug/debugger_posix.cc.orig 2017-06-18 01:23:49.065175000 +0200
+++ base/debug/debugger_posix.cc 2017-06-18 01:58:29.603481000 +0200
@@ -84,7 +84,7 @@
KERN_PROC,
KERN_PROC_PID,
getpid()
-#if defined(OS_OPENBSD)
+#if defined(OS_BSD)
, sizeof(struct kinfo_proc),
0
#endif
@@ -92,33 +92,36 @@
// Caution: struct kinfo_proc is marked __APPLE_API_UNSTABLE. The source and
// binary interfaces may change.
- struct kinfo_proc info;
- size_t info_size = sizeof(info);
+ struct kinfo_proc *info;
+ size_t info_size;
-#if defined(OS_OPENBSD)
if (sysctl(mib, arraysize(mib), NULL, &info_size, NULL, 0) < 0)
return -1;
+ info = (struct kinfo_proc *)malloc(info_size);
+
mib[5] = (info_size / sizeof(struct kinfo_proc));
-#endif
- int sysctl_result = sysctl(mib, arraysize(mib), &info, &info_size, NULL, 0);
+ int sysctl_result = sysctl(mib, arraysize(mib), info, &info_size, NULL, 0);
DCHECK_EQ(sysctl_result, 0);
if (sysctl_result != 0) {
is_set = true;
being_debugged = false;
- return being_debugged;
+ goto out;
}
// This process is being debugged if the P_TRACED flag is set.
is_set = true;
#if defined(OS_FREEBSD)
- being_debugged = (info.ki_flag & P_TRACED) != 0;
+ being_debugged = (info->ki_flag & P_TRACED) != 0;
#elif defined(OS_BSD)
- being_debugged = (info.p_flag & P_TRACED) != 0;
+ being_debugged = (info->p_flag & P_TRACED) != 0;
#else
- being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
+ being_debugged = (info->kp_proc.p_flag & P_TRACED) != 0;
#endif
+
+out:
+ free(info);
return being_debugged;
}

View File

@ -0,0 +1,10 @@
--- base/debug/stack_trace.h.orig 2017-08-02 19:09:58.400190000 +0200
+++ base/debug/stack_trace.h 2017-08-02 19:10:33.950334000 +0200
@@ -16,6 +16,7 @@
#include "build/build_config.h"
#if defined(OS_POSIX)
+#include <sys/stdint.h>
#include <unistd.h>
#endif

View File

@ -1,5 +1,5 @@
--- base/debug/stack_trace_posix.cc.orig 2017-04-19 19:06:28 UTC
+++ base/debug/stack_trace_posix.cc
--- base/debug/stack_trace_posix.cc.orig 2017-07-25 21:04:48.000000000 +0200
+++ base/debug/stack_trace_posix.cc 2017-08-02 18:45:42.071358000 +0200
@@ -34,7 +34,7 @@
#include <AvailabilityMacros.h>
#endif
@ -9,18 +9,19 @@
#include "base/debug/proc_maps_linux.h"
#endif
@@ -575,6 +575,10 @@ class SandboxSymbolizeHelper {
@@ -574,6 +574,11 @@
// for the modules that are loaded in the current process.
// Returns true on success.
bool CacheMemoryRegions() {
+#if defined(OS_FREEBSD)
+#if defined(OS_BSD)
+ // TODO (rene) avoid link error, implement something?
+ NOTIMPLEMENTED();
+ return false;
+#else
// Reads /proc/self/maps.
std::string contents;
if (!ReadProcMaps(&contents)) {
@@ -590,6 +594,7 @@ class SandboxSymbolizeHelper {
@@ -589,6 +594,7 @@
is_initialized_ = true;
return true;
@ -28,3 +29,12 @@
}
// Opens all object files and caches their file descriptors.
@@ -721,7 +727,7 @@
// NOTE: This code MUST be async-signal safe (it's used by in-process
// stack dumping signal handler). NO malloc or stdio is allowed here.
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if !defined(__UCLIBC__) && !defined(_AIX) && !defined(OS_BSD)
count = std::min(arraysize(trace_), count);
// Though the backtrace API man page does not list any possible negative

View File

@ -1,6 +1,6 @@
--- base/debug/thread_heap_usage_tracker.cc.orig 2017-04-19 19:06:28 UTC
--- base/debug/thread_heap_usage_tracker.cc.orig 2017-06-05 19:03:00 UTC
+++ base/debug/thread_heap_usage_tracker.cc
@@ -16,11 +16,13 @@
@@ -16,10 +16,12 @@
#include "base/threading/thread_local_storage.h"
#include "build/build_config.h"
@ -9,8 +9,7 @@
#include <malloc/malloc.h>
#else
#include <malloc.h>
#endif
+#endif
#endif
namespace base {
namespace debug {

View File

@ -1,6 +1,6 @@
--- base/files/file_path_unittest.cc.orig 2017-04-19 19:06:28 UTC
--- base/files/file_path_unittest.cc.orig 2017-06-05 19:03:00 UTC
+++ base/files/file_path_unittest.cc
@@ -1133,7 +1133,7 @@ TEST_F(FilePathTest, FromUTF8Unsafe_And_
@@ -1133,7 +1133,7 @@ TEST_F(FilePathTest, FromUTF8Unsafe_And_AsUTF8Unsafe)
"\xEF\xBC\xA1\xEF\xBC\xA2\xEF\xBC\xA3.txt" },
};

View File

@ -1,4 +1,4 @@
--- base/files/file_path_watcher_kqueue.h.orig 2017-04-19 19:06:28 UTC
--- base/files/file_path_watcher_kqueue.h.orig 2017-06-05 19:03:00 UTC
+++ base/files/file_path_watcher_kqueue.h
@@ -5,6 +5,10 @@
#ifndef BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_

View File

@ -0,0 +1,51 @@
--- base/files/file_path_watcher_stub.cc.orig 2018-07-19 23:00:07.807326000 +0200
+++ base/files/file_path_watcher_stub.cc 2018-07-19 23:05:24.785603000 +0200
@@ -1,14 +1,15 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file exists for Unix systems which don't have the inotify headers, and
-// thus cannot build file_watcher_inotify.cc
-#include "base/files/file_path_watcher.h"
+#include <memory>
+#include "base/files/file_path_watcher.h"
+#include "base/files/file_path_watcher_kqueue.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "build/build_config.h"
namespace base {
@@ -22,12 +23,26 @@
bool Watch(const FilePath& path,
bool recursive,
const FilePathWatcher::Callback& callback) override {
- return false;
+ DCHECK(!impl_.get());
+ if (recursive) {
+ if (!FilePathWatcher::RecursiveWatchAvailable())
+ return false;
+ } else {
+ impl_ = std::make_unique<FilePathWatcherKQueue>();
+ }
+ DCHECK(impl_.get());
+ return impl_->Watch(path, recursive, callback);
}
- void Cancel() override {}
+ void Cancel() override {
+ if (impl_.get())
+ impl_->Cancel();
+ set_cancelled();
+ }
private:
+ std::unique_ptr<PlatformDelegate> impl_;
+
DISALLOW_COPY_AND_ASSIGN(FilePathWatcherImpl);
};

View File

@ -1,11 +1,11 @@
--- base/files/file_util.h.orig 2017-04-19 19:06:28 UTC
+++ base/files/file_util.h
@@ -406,7 +406,7 @@ BASE_EXPORT bool VerifyPathControlledByA
--- base/files/file_util.h.orig 2017-07-25 21:04:48.000000000 +0200
+++ base/files/file_util.h 2017-07-29 00:57:11.269678000 +0200
@@ -406,7 +406,7 @@
// the directory |path|, in the number of FilePath::CharType, or -1 on failure.
BASE_EXPORT int GetMaximumPathComponentLength(const base::FilePath& path);
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
-#if defined(OS_LINUX) || defined(OS_AIX)
+#if defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
// Broad categories of file systems as returned by statfs() on Linux.
enum FileSystemType {
FILE_SYSTEM_UNKNOWN, // statfs failed.

View File

@ -0,0 +1,11 @@
--- base/files/memory_mapped_file_posix.cc.orig 2018-02-24 16:25:08.000000000 +0100
+++ base/files/memory_mapped_file_posix.cc 2018-03-03 19:01:12.448678000 +0100
@@ -110,6 +110,8 @@
// Only Android API>=21 supports the fallocate call. Older versions need
// to manually extend the file by writing zeros at block intervals.
do_manual_extension = true;
+#elif defined(OS_BSD)
+ do_manual_extension = true;
#elif defined(OS_MACOSX)
// MacOS doesn't support fallocate even though their new APFS filesystem
// does support sparse files. It does, however, have the functionality

View File

@ -0,0 +1,20 @@
--- base/i18n/icu_util.cc.orig 2017-09-05 21:05:11.000000000 +0200
+++ base/i18n/icu_util.cc 2017-09-06 16:47:26.158180000 +0200
@@ -20,7 +20,7 @@
#include "build/build_config.h"
#include "third_party/icu/source/common/unicode/putil.h"
#include "third_party/icu/source/common/unicode/udata.h"
-#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_ANDROID)
+#if (defined(OS_LINUX) || defined(OS_BSD) && !defined(OS_CHROMEOS)) || defined(OS_ANDROID)
#include "third_party/icu/source/i18n/unicode/timezone.h"
#endif
@@ -312,7 +312,7 @@
// TODO(jungshik): Some callers do not care about tz at all. If necessary,
// add a boolean argument to this function to init'd the default tz only
// when requested.
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if (defined(OS_LINUX) || defined(OS_BSD)) && !defined(OS_CHROMEOS)
if (result)
std::unique_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault());
#endif

View File

@ -0,0 +1,11 @@
--- base/logging_unittest.cc.orig 2017-06-21 19:47:24.089128000 +0200
+++ base/logging_unittest.cc 2017-06-21 20:02:08.177123000 +0200
@@ -272,7 +272,7 @@
// need the arch-specific boilerplate below, which is inspired by breakpad.
// At the same time, on OSX, ucontext.h is deprecated but si_addr works fine.
uintptr_t crash_addr = 0;
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_BSD)
crash_addr = reinterpret_cast<uintptr_t>(info->si_addr);
#else // OS_POSIX && !OS_MACOSX
struct ucontext* context = reinterpret_cast<struct ucontext*>(context_ptr);

View File

@ -1,11 +1,11 @@
--- base/native_library_posix.cc.orig 2017-04-19 19:06:28 UTC
+++ base/native_library_posix.cc
@@ -35,7 +35,7 @@ NativeLibrary LoadNativeLibraryWithOptio
--- base/native_library_posix.cc.orig 2017-07-25 21:04:48.000000000 +0200
+++ base/native_library_posix.cc 2017-08-02 21:02:05.991380000 +0200
@@ -30,7 +30,7 @@
// http://crbug.com/17943, http://crbug.com/17557, http://crbug.com/36892,
// and http://crbug.com/40794.
int flags = RTLD_LAZY;
-#if defined(OS_ANDROID) || !defined(RTLD_DEEPBIND)
+#if defined(OS_ANDROID) || !defined(RTLD_DEEPBIND) || defined(OS_BSD)
// Certain platforms don't define RTLD_DEEPBIND. Android dlopen() requires
// further investigation, as it might vary across versions. Crash here to
// warn developers that they're trying to rely on uncertain behavior.
CHECK(!options.prefer_own_symbols);
-#else
+#elif !defined(OS_BSD)
if (options.prefer_own_symbols)
flags |= RTLD_DEEPBIND;
#endif

View File

@ -0,0 +1,49 @@
--- base/posix/unix_domain_socket.cc.orig 2018-01-04 21:05:38.000000000 +0100
+++ base/posix/unix_domain_socket.cc 2018-01-06 12:44:56.681201000 +0100
@@ -5,7 +5,10 @@
#include "base/posix/unix_domain_socket.h"
#include <errno.h>
+#include <sys/param.h>
#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/ucred.h>
#if !defined(OS_NACL_NONSFI)
#include <sys/un.h>
#endif
@@ -28,6 +31,14 @@
const size_t UnixDomainSocket::kMaxFileDescriptors = 16;
+#ifndef SCM_CREDENTIALS
+# define SCM_CREDENTIALS 0x9001
+#endif
+
+#ifndef SO_PASSCRED
+# define SO_PASSCRED 0x9002
+#endif
+
#if !defined(OS_NACL_NONSFI)
bool CreateSocketPair(ScopedFD* one, ScopedFD* two) {
int raw_socks[2];
@@ -150,7 +161,7 @@
#if !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX)
// The PNaCl toolchain for Non-SFI binary build and macOS do not support
// ucred. macOS supports xucred, but this structure is insufficient.
- + CMSG_SPACE(sizeof(struct ucred))
+ + CMSG_SPACE(sizeof(struct cmsgcred))
#endif // OS_NACL_NONSFI or OS_MACOSX
;
char control_buffer[kControlBufferSize];
@@ -180,9 +191,9 @@
// SCM_CREDENTIALS.
if (cmsg->cmsg_level == SOL_SOCKET &&
cmsg->cmsg_type == SCM_CREDENTIALS) {
- DCHECK_EQ(payload_len, sizeof(struct ucred));
+ DCHECK_EQ(payload_len, sizeof(struct cmsgcred));
DCHECK_EQ(pid, -1);
- pid = reinterpret_cast<struct ucred*>(CMSG_DATA(cmsg))->pid;
+ pid = getpid();
}
#endif // !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX)
}

View File

@ -1,45 +0,0 @@
--- base/posix/unix_domain_socket_linux.cc.orig 2017-04-19 19:06:28 UTC
+++ base/posix/unix_domain_socket_linux.cc
@@ -23,6 +23,15 @@
namespace base {
+#if defined(OS_BSD)
+// Port over Linux ucred structure
+struct ucred {
+ pid_t pid; // process ID of the sending process
+ uid_t uid; // user ID of the sending process
+ gid_t gid; // group ID of the sending process
+};
+#endif
+
const size_t UnixDomainSocket::kMaxFileDescriptors = 16;
#if !defined(OS_NACL_NONSFI)
@@ -40,8 +49,14 @@ static bool CreateSocketPair(ScopedFD* o
// static
bool UnixDomainSocket::EnableReceiveProcessId(int fd) {
+#if defined(OS_BSD)
+ // XXX(rene) do this? :
+ // taken from dbus, Academic Free License 2.1 / GPL 2+
+ return 0; // fake OK
+#else
const int enable = 1;
return setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &enable, sizeof(enable)) == 0;
+#endif
}
#endif // !defined(OS_NACL_NONSFI)
@@ -147,7 +162,11 @@ ssize_t UnixDomainSocket::RecvMsgWithFla
// The PNaCl toolchain for Non-SFI binary build does not support
// SCM_CREDENTIALS.
if (cmsg->cmsg_level == SOL_SOCKET &&
+#if defined(OS_BSD)
+ 1) { // XXX(rene) carpet getting full ...
+#else
cmsg->cmsg_type == SCM_CREDENTIALS) {
+#endif
DCHECK_EQ(payload_len, sizeof(struct ucred));
DCHECK_EQ(pid, -1);
pid = reinterpret_cast<struct ucred*>(CMSG_DATA(cmsg))->pid;

View File

@ -1,18 +0,0 @@
--- base/posix/unix_domain_socket_linux_unittest.cc.orig 2017-04-19 19:06:28 UTC
+++ base/posix/unix_domain_socket_linux_unittest.cc
@@ -2,10 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "build/build_config.h"
+
#include <stddef.h>
#include <stdint.h>
#include <sys/socket.h>
#include <sys/types.h>
+#if defined(OS_BSD)
+#include <signal.h>
+#endif
#include <unistd.h>
#include "base/bind.h"

View File

@ -0,0 +1,12 @@
--- base/posix/unix_domain_socket_unittest.cc.orig 2017-12-23 20:50:07.237565000 +0100
+++ base/posix/unix_domain_socket_unittest.cc 2017-12-23 20:51:05.651558000 +0100
@@ -8,6 +8,9 @@
#include <stdint.h>
#include <sys/socket.h>
#include <sys/types.h>
+#if defined(OS_BSD)
+#include <signal.h>
+#endif
#include <unistd.h>
#include "base/bind.h"

View File

@ -0,0 +1,16 @@
--- base/process/internal_linux.cc.orig 2017-08-10 00:00:17.842158000 +0200
+++ base/process/internal_linux.cc 2017-08-10 00:02:37.838081000 +0200
@@ -60,10 +60,13 @@
// Synchronously reading files in /proc is safe.
ThreadRestrictions::ScopedAllowIO allow_io;
+#if !defined(OS_BSD)
if (!ReadFileToString(file, buffer)) {
DLOG(WARNING) << "Failed to read " << file.MaybeAsASCII();
return false;
}
+#endif
+
return !buffer->empty();
}

View File

@ -0,0 +1,11 @@
--- base/process/kill.h.orig 2018-07-19 22:11:43.638992000 +0200
+++ base/process/kill.h 2018-07-19 22:12:06.613065000 +0200
@@ -111,7 +111,7 @@
BASE_EXPORT TerminationStatus GetKnownDeadTerminationStatus(
ProcessHandle handle, int* exit_code);
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
// Spawns a thread to wait asynchronously for the child |process| to exit
// and then reaps it.
BASE_EXPORT void EnsureProcessGetsReaped(Process process);

View File

@ -0,0 +1,11 @@
--- base/process/kill_posix.cc.orig 2018-07-19 22:11:49.327358000 +0200
+++ base/process/kill_posix.cc 2018-07-19 22:12:22.837132000 +0200
@@ -167,7 +167,7 @@
0, new BackgroundReaper(std::move(process), TimeDelta::FromSeconds(2)));
}
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
void EnsureProcessGetsReaped(Process process) {
DCHECK(!process.is_current());

View File

@ -1,6 +1,6 @@
--- base/process/launch.cc.orig 2017-04-19 19:06:28 UTC
--- base/process/launch.cc.orig 2017-06-05 19:03:00 UTC
+++ base/process/launch.cc
@@ -15,7 +15,7 @@ LaunchOptions::~LaunchOptions() = defaul
@@ -15,7 +15,7 @@ LaunchOptions::~LaunchOptions() = default;
LaunchOptions LaunchOptionsForTest() {
LaunchOptions options;

View File

@ -1,6 +1,15 @@
--- base/process/memory.cc.orig 2017-04-19 19:06:28 UTC
+++ base/process/memory.cc
@@ -31,7 +31,7 @@ void TerminateBecauseOutOfMemory(size_t
--- base/process/memory.cc.orig 2017-12-15 02:04:05.000000000 +0100
+++ base/process/memory.cc 2017-12-31 09:49:46.308931000 +0100
@@ -10,7 +10,7 @@
namespace base {
// Defined in memory_win.cc for Windows.
-#if !defined(OS_WIN)
+#if !defined(OS_WIN) && !defined(OS_BSD)
namespace {
@@ -31,7 +31,7 @@
#endif
// Defined in memory_mac.mm for Mac.

View File

@ -1,11 +1,11 @@
--- base/process/memory.h.orig 2017-04-19 19:06:28 UTC
+++ base/process/memory.h
@@ -32,7 +32,7 @@ BASE_EXPORT void EnableTerminationOnOutO
--- base/process/memory.h.orig 2017-07-25 21:04:48.000000000 +0200
+++ base/process/memory.h 2017-07-29 01:01:15.601297000 +0200
@@ -32,7 +32,7 @@
// Crash reporting classifies such crashes as OOM.
BASE_EXPORT void TerminateBecauseOutOfMemory(size_t size);
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_ANDROID)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_BSD)
BASE_EXPORT extern size_t g_oom_size;
// The maximum allowed value for the OOM score.

View File

@ -1,19 +1,15 @@
--- base/process/memory_unittest.cc.orig 2017-04-19 19:06:28 UTC
+++ base/process/memory_unittest.cc
@@ -93,10 +93,10 @@ TEST(MemoryTest, AllocatorShimWorking) {
ASSERT_TRUE(base::allocator::IsAllocatorInitialized());
}
-// OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan
+// BSD does not support these tests. Don't test these on ASan/TSan/MSan
--- base/process/memory_unittest.cc.orig 2017-09-05 21:05:11.000000000 +0200
+++ base/process/memory_unittest.cc 2017-09-06 16:53:33.919374000 +0200
@@ -104,7 +104,7 @@
// OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan
// configurations: only test the real allocator.
// Windows only supports these tests with the allocator shim in place.
-#if !defined(OS_OPENBSD) && \
+#if !defined(OS_BSD) && \
BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) && \
-#if !defined(OS_OPENBSD) && BUILDFLAG(USE_ALLOCATOR_SHIM) && \
+#if !defined(OS_BSD) && BUILDFLAG(USE_ALLOCATOR_SHIM) && \
!defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
@@ -488,5 +488,5 @@ TEST_F(OutOfMemoryHandledTest, Unchecked
namespace {
@@ -507,5 +507,5 @@
EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_));
EXPECT_TRUE(value_ == NULL);
}

View File

@ -0,0 +1,11 @@
--- base/process/process_handle.cc.orig 2018-07-19 22:31:30.212555000 +0200
+++ base/process/process_handle.cc 2018-07-19 22:32:27.185612000 +0200
@@ -39,7 +39,7 @@
return g_unique_id;
}
-#if defined(OS_LINUX) || defined(OS_AIX)
+#if defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
void InitUniqueIdForProcessInPidNamespace(ProcessId pid_outside_of_namespace) {
g_unique_id = MangleProcessId(pid_outside_of_namespace);

View File

@ -0,0 +1,11 @@
--- base/process/process_handle.h.orig 2018-07-19 22:31:39.988330000 +0200
+++ base/process/process_handle.h 2018-07-19 22:32:06.977544000 +0200
@@ -64,7 +64,7 @@
// a process's PID.
BASE_EXPORT uint32_t GetUniqueIdForProcess();
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
// When a process is started in a different PID namespace from the browser
// process, this function must be called with the process's PID in the browser's
// PID namespace in order to initialize its unique ID. Not thread safe.

View File

@ -1,6 +1,6 @@
--- base/process/process_handle_freebsd.cc.orig 2017-04-19 19:06:28 UTC
+++ base/process/process_handle_freebsd.cc
@@ -16,7 +16,7 @@ namespace base {
--- base/process/process_handle_freebsd.cc.orig 2018-01-04 21:05:38.000000000 +0100
+++ base/process/process_handle_freebsd.cc 2018-01-27 02:11:02.948007000 +0100
@@ -16,10 +16,13 @@
ProcessId GetParentProcessId(ProcessHandle process) {
struct kinfo_proc info;
@ -9,3 +9,9 @@
int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process };
if (sysctl(mib, arraysize(mib), &info, &length, NULL, 0) < 0)
+ return -1;
+
+ if (length < sizeof(struct kinfo_proc))
return -1;
return info.ki_ppid;

View File

@ -1,4 +1,4 @@
--- base/process/process_info_linux.cc.orig 2017-04-19 19:06:28 UTC
--- base/process/process_info_linux.cc.orig 2017-06-05 19:03:00 UTC
+++ base/process/process_info_linux.cc
@@ -11,10 +11,28 @@
#include "base/process/process_handle.h"
@ -28,10 +28,10 @@
+#else
int64_t start_ticks =
internal::ReadProcSelfStatsAndGetFieldAsInt64(internal::VM_STARTTIME);
DCHECK(start_ticks);
@@ -22,6 +40,7 @@ const Time CurrentProcessInfo::CreationT
Time boot_time = internal::GetBootTime();
DCHECK(!boot_time.is_null());
if (!start_ticks)
@@ -24,6 +42,7 @@ const Time CurrentProcessInfo::CreationTime() {
if (boot_time.is_null())
return Time();
return Time(boot_time + start_offset);
+#endif
}

View File

@ -1,5 +1,5 @@
--- base/process/process_iterator_freebsd.cc.orig 2017-04-19 19:06:28 UTC
+++ base/process/process_iterator_freebsd.cc
--- base/process/process_iterator_freebsd.cc.orig 2018-01-04 21:05:38.000000000 +0100
+++ base/process/process_iterator_freebsd.cc 2018-01-27 17:58:40.475292000 +0100
@@ -10,6 +10,10 @@
#include <sys/sysctl.h>
#include <unistd.h>
@ -11,7 +11,16 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/strings/string_split.h"
@@ -72,19 +76,13 @@ bool ProcessIterator::CheckForNextProces
@@ -40,7 +44,7 @@
num_of_kinfo_proc += 16;
kinfo_procs_.resize(num_of_kinfo_proc);
len = num_of_kinfo_proc * sizeof(struct kinfo_proc);
- if (sysctl(mib, arraysize(mib), &kinfo_procs_[0], &len, NULL, 0) <0) {
+ if (sysctl(mib, arraysize(mib), kinfo_procs_.data(), &len, NULL, 0) <0) {
// If we get a mem error, it just means we need a bigger buffer, so
// loop around again. Anything else is a real error and give up.
if (errno != ENOMEM) {
@@ -72,19 +76,13 @@
for (; index_of_kinfo_proc_ < kinfo_procs_.size(); ++index_of_kinfo_proc_) {
size_t length;
struct kinfo_proc kinfo = kinfo_procs_[index_of_kinfo_proc_];

View File

@ -0,0 +1,11 @@
--- base/process/process_metrics.cc.orig 2017-12-23 21:01:02.481980000 +0100
+++ base/process/process_metrics.cc 2017-12-23 21:01:15.848759000 +0100
@@ -10,7 +10,7 @@
#include "base/values.h"
#include "build/build_config.h"
-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX)
+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
namespace {
int CalculateEventsPerSecond(uint64_t event_count,
uint64_t* last_event_count,

View File

@ -1,33 +1,112 @@
--- base/process/process_metrics.h.orig 2017-04-19 19:06:28 UTC
+++ base/process/process_metrics.h
@@ -22,6 +22,12 @@
#include "base/values.h"
#include "build/build_config.h"
--- base/process/process_metrics.h.orig 2018-03-20 23:05:14.000000000 +0100
+++ base/process/process_metrics.h 2018-03-24 12:20:53.523721000 +0100
@@ -110,7 +110,7 @@
size_t image;
};
+#if defined(OS_BSD)
+#include <kvm.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#endif
+
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
// Minor and major page fault counts since the process creation.
// Both counts are process-wide, and exclude child processes.
//
@@ -120,7 +120,7 @@
int64_t minor;
int64_t major;
};
-#endif // defined(OS_LINUX) || defined(OS_ANDROID)
+#endif // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
// Convert a POSIX timeval to microseconds.
BASE_EXPORT int64_t TimeValToMicroseconds(const struct timeval& tv);
@@ -252,7 +252,7 @@
// otherwise.
bool GetIOCounters(IoCounters* io_counters) const;
-#if defined(OS_LINUX) || defined(OS_AIX) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_AIX) || defined(OS_ANDROID) || defined(OS_BSD)
// Returns the number of file descriptors currently open by the process, or
// -1 on error.
int GetOpenFdCount() const;
@@ -260,16 +260,16 @@
// Returns the soft limit of file descriptors that can be opened by the
// process, or -1 on error.
int GetOpenFdSoftLimit() const;
-#endif // defined(OS_LINUX) || defined(OS_AIX) || defined(OS_ANDROID)
+#endif // defined(OS_LINUX) || defined(OS_AIX) || defined(OS_ANDROID) || defined(OS_BSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
// Bytes of swap as reported by /proc/[pid]/status.
uint64_t GetVmSwapBytes() const;
// Minor and major page fault count as reported by /proc/[pid]/stat.
// Returns true for success.
bool GetPageFaultCounts(PageFaultCounts* counts) const;
-#endif // defined(OS_LINUX) || defined(OS_ANDROID)
+#endif // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD)
// Returns total memory usage of malloc.
size_t GetMallocUsage();
@@ -289,7 +289,7 @@
bool GetWorkingSetKBytesTotmaps(WorkingSetKBytes *ws_usage) const;
#endif
-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX)
+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
int CalculateIdleWakeupsPerSecond(uint64_t absolute_idle_wakeups);
#endif
#if defined(OS_MACOSX)
#include <mach/mach.h>
#include "base/process/port_provider_mac.h"
@@ -329,13 +335,17 @@ BASE_EXPORT bool GetSystemMemoryInfo(Sys
@@ -310,7 +310,7 @@
TimeTicks last_cpu_time_;
int64_t last_system_time_;
-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX)
+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
// Same thing for idle wakeups.
TimeTicks last_idle_wakeups_time_;
uint64_t last_absolute_idle_wakeups_;
@@ -358,7 +358,7 @@
#endif // defined(OS_POSIX)
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \
- defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_FUCHSIA)
+ defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_FUCHSIA) || defined(OS_BSD)
// Data about system-wide memory consumption. Values are in KB. Available on
// Windows, Mac, Linux, Android and Chrome OS.
//
@@ -391,7 +391,7 @@
int avail_phys = 0;
#endif
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_BSD)
// This provides an estimate of available memory as described here:
// https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
// NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always
@@ -406,7 +406,7 @@
#endif
#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_AIX) || \
- defined(OS_FUCHSIA)
+ defined(OS_FUCHSIA) || defined(OS_BSD)
int buffers = 0;
int cached = 0;
int active_anon = 0;
@@ -416,7 +416,7 @@
int dirty = 0;
int reclaimable = 0;
#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_AIX) ||
- // defined(OS_FUCHSIA)
+ // defined(OS_FUCHSIA) || defined(OS_BSD)
#if defined(OS_CHROMEOS)
int shmem = 0;
@@ -444,7 +444,7 @@
#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) ||
// defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_FUCHSIA)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX) || defined(OS_BSD)
// Parse the data found in /proc/<pid>/stat and return the sum of the
// CPU-related ticks. Returns -1 on parse error.
// Exposed for testing.
BASE_EXPORT int ParseProcStatCPU(const std::string& input);
+#endif
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD)
// Get the number of threads of |process| as available in /proc/<pid>/stat.
// This should be used with care as no synchronization with running threads is
// done. This is mostly useful to guarantee being single-threaded.
// Returns 0 on failure.
BASE_EXPORT int GetNumberOfThreads(ProcessHandle process);
+#endif
+#if defined(OS_LINUX) || defined(OS_ANDROID)
// /proc/self/exe refers to the current executable.
BASE_EXPORT extern const char kProcSelfExe[];

View File

@ -1,19 +1,28 @@
--- base/process/process_metrics_freebsd.cc.orig 2017-04-19 19:06:28 UTC
+++ base/process/process_metrics_freebsd.cc
@@ -13,6 +13,9 @@
#include "base/memory/ptr_util.h"
#include "base/sys_info.h"
--- base/process/process_metrics_freebsd.cc.orig 2018-08-01 00:08:25.000000000 +0200
+++ base/process/process_metrics_freebsd.cc 2018-08-04 21:48:06.554728000 +0200
@@ -14,11 +14,14 @@
#include "base/process/process_metrics_iocounters.h"
#include "base/stl_util.h"
+#include <unistd.h> /* getpagesize() */
+#include <fcntl.h> /* O_RDONLY */
+#include <kvm.h>
+
namespace base {
ProcessMetrics::ProcessMetrics(ProcessHandle process)
@@ -122,4 +125,23 @@ size_t GetSystemCommitCharge() {
return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
}
- : process_(process),
- last_cpu_(0) {}
+ : process_(process) {}
// static
std::unique_ptr<ProcessMetrics> ProcessMetrics::CreateProcessMetrics(
@@ -67,6 +70,65 @@
pagesize = getpagesize();
return mem_total - (mem_free*pagesize) - (mem_inactive*pagesize);
+}
+
+int GetNumberOfThreads(ProcessHandle process) {
+ // Taken from FreeBSD top (usr.bin/top/machine.c)
+
@ -33,4 +42,44 @@
+ return nproc;
+}
+
+bool GetSystemMemoryInfo(SystemMemoryInfoKB *meminfo) {
+ unsigned int mem_total, mem_free, swap_total, swap_used;
+ size_t length;
+ int pagesizeKB;
+
+ pagesizeKB = getpagesize() / 1024;
+
+ length = sizeof(mem_total);
+ if (sysctlbyname("vm.stats.vm.v_page_count", &mem_total,
+ &length, NULL, 0) != 0 || length != sizeof(mem_total))
+ return false;
+
+ length = sizeof(mem_free);
+ if (sysctlbyname("vm.stats.vm.v_free_count", &mem_free, &length, NULL, 0)
+ != 0 || length != sizeof(mem_free))
+ return false;
+
+ length = sizeof(swap_total);
+ if (sysctlbyname("vm.swap_size", &swap_total, &length, NULL, 0)
+ != 0 || length != sizeof(swap_total))
+ return false;
+
+ length = sizeof(swap_used);
+ if (sysctlbyname("vm.swap_anon_use", &swap_used, &length, NULL, 0)
+ != 0 || length != sizeof(swap_used))
+ return false;
+
+ meminfo->total = mem_total * pagesizeKB;
+ meminfo->free = mem_free * pagesizeKB;
+ meminfo->swap_total = swap_total * pagesizeKB;
+ meminfo->swap_free = (swap_total - swap_used) * pagesizeKB;
+
+ return true;
+}
+
+uint64_t ProcessMetrics::GetVmSwapBytes() const {
+ NOTIMPLEMENTED();
+ return 0;
}
} // namespace base

View File

@ -0,0 +1,20 @@
--- base/process/process_metrics_posix.cc.orig 2018-08-01 00:08:25.000000000 +0200
+++ base/process/process_metrics_posix.cc 2018-08-05 00:53:58.559513000 +0200
@@ -19,6 +19,8 @@
#if defined(OS_MACOSX)
#include <malloc/malloc.h>
+#elif defined(OS_FREEBSD)
+#include <stdlib.h>
#else
#include <malloc.h>
#endif
@@ -107,7 +109,7 @@
#else
return minfo.hblkhd + minfo.arena;
#endif
-#elif defined(OS_FUCHSIA)
+#elif defined(OS_FUCHSIA) || defined(OS_BSD)
// TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
return 0;
#endif

View File

@ -1,11 +1,10 @@
--- base/process/process_posix.cc.orig 2017-04-19 19:06:28 UTC
+++ base/process/process_posix.cc
@@ -21,8 +21,18 @@
--- base/process/process_posix.cc.orig 2017-12-15 02:04:05.000000000 +0100
+++ base/process/process_posix.cc 2017-12-23 21:14:03.546283000 +0100
@@ -22,8 +22,17 @@
#include <sys/event.h>
#endif
+#if defined(OS_BSD)
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/event.h>
+#include <sys/time.h>
@ -19,72 +18,50 @@
#if !defined(OS_NACL_NONSFI)
bool WaitpidWithTimeout(base::ProcessHandle handle,
@@ -184,13 +194,13 @@ bool WaitForExitWithTimeoutImpl(base::Pr
base::ProcessHandle parent_pid = base::GetParentProcessId(handle);
base::ProcessHandle our_pid = base::GetCurrentProcessHandle();
if (parent_pid != our_pid) {
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_BSD)
// On Mac we can wait on non child processes.
- return WaitForSingleNonChildProcess(handle, timeout);
+ /* return WaitForSingleNonChildProcess(handle, timeout); */
#else
// Currently on Linux we can't handle non child processes.
NOTIMPLEMENTED();
-#endif // OS_MACOSX
+#endif // OS_MACOSX || OS_BSD
}
int status;
@@ -257,12 +267,16 @@ Process Process::DeprecatedGetProcessFro
@@ -263,12 +272,10 @@
return Process(handle);
}
-#if !defined(OS_LINUX) && !defined(OS_MACOSX)
+#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_FREEBSD)
-#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_AIX)
// static
bool Process::CanBackgroundProcesses() {
return false;
}
-#endif // !defined(OS_LINUX) && !defined(OS_MACOSX)
+#elif defined(OS_FREEBSD)
+bool Process::CanBackgroundProcesses() {
- return false;
+ return true;
+}
+#endif // !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_FREEBSD)
}
-#endif // !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_AIX)
// static
void Process::TerminateCurrentProcessImmediately(int exit_code) {
@@ -370,15 +384,32 @@ bool Process::WaitForExitWithTimeout(Tim
@@ -372,21 +379,23 @@
return WaitForExitWithTimeoutImpl(Handle(), exit_code, timeout);
}
-#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_AIX)
bool Process::IsProcessBackgrounded() const {
// See SetProcessBackgrounded().
DCHECK(IsValid());
+#if defined(OS_FREEBSD)
+ return true;
+#else
return false;
+#endif
- return false;
+ return GetPriority() == kBackgroundPriority;
}
bool Process::SetProcessBackgrounded(bool value) {
+#if !defined(OS_FREEBSD)
// Not implemented for POSIX systems other than Linux and Mac. With POSIX, if
// we were to lower the process priority we wouldn't be able to raise it back
// to its initial priority.
NOTIMPLEMENTED();
return false;
+#else
-bool Process::SetProcessBackgrounded(bool value) {
- // Not implemented for POSIX systems other than Linux and Mac. With POSIX, if
- // we were to lower the process priority we wouldn't be able to raise it back
- // to its initial priority.
- NOTIMPLEMENTED();
- return false;
+bool Process::SetProcessBackgrounded(bool background) {
+ DCHECK(IsValid());
+
+ if (!CanBackgroundProcesses())
+ return false;
+
+ int priority = value ? kBackgroundPriority : kForegroundPriority;
+ int result = setpriority(PRIO_PROCESS, process_, priority);
+
+ int priority = background ? kBackgroundPriority : kForegroundPriority;
+ int result = setpriority(PRIO_PROCESS, process_, priority);
+ DPCHECK(result == 0);
+ return result == 0;
+#endif // !defined(OS_FREEBSD)
}
#endif // !defined(OS_LINUX) && !defined(OS_MACOSX)
-#endif // !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_AIX)
int Process::GetPriority() const {
DCHECK(IsValid());

View File

@ -1,16 +0,0 @@
--- base/strings/safe_sprintf.cc.orig 2017-04-19 19:06:28 UTC
+++ base/strings/safe_sprintf.cc
@@ -115,8 +115,11 @@ class Buffer {
count_(0) {
// MSVS2013's standard library doesn't mark max() as constexpr yet. cl.exe
// supports static_cast but doesn't really implement constexpr yet so it doesn't
-// complain, but clang does.
-#if __cplusplus >= 201103 && !(defined(__clang__) && defined(OS_WIN))
+// complain, but clang does. Older FreeBSD (<10) use libstdc++4.2, which
+// doesn't mark numeric_limits::max() as constexp.
+#if __cplusplus >= 201103 && \
+ !(defined(OS_FREEBSD) && __FreeBSD_version > 1000054) && \
+ !(defined(__clang__) && defined(OS_WIN))
static_assert(kSSizeMaxConst ==
static_cast<size_t>(std::numeric_limits<ssize_t>::max()),
"kSSizeMaxConst should be the max value of an ssize_t");

View File

@ -1,10 +1,32 @@
--- base/sys_info_freebsd.cc.orig 2017-04-19 19:06:28 UTC
+++ base/sys_info_freebsd.cc
@@ -12,12 +12,34 @@
--- base/sys_info_freebsd.cc.orig 2017-12-15 02:04:05.000000000 +0100
+++ base/sys_info_freebsd.cc 2017-12-23 21:51:22.626194000 +0100
@@ -13,26 +13,58 @@
namespace base {
+int64_t SysInfo::AmountOfAvailablePhysicalMemory() {
int64_t SysInfo::AmountOfPhysicalMemoryImpl() {
- int pages, page_size;
+ int pages, page_size, r = 0;
size_t size = sizeof(pages);
- sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
- sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
- if (pages == -1 || page_size == -1) {
+ if(r == 0)
+ r = sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
+ if(r == 0)
+ r =sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
+ if(r == -1) {
NOTREACHED();
return 0;
}
return static_cast<int64_t>(pages) * page_size;
}
-// static
-uint64_t SysInfo::MaxSharedMemorySize() {
- size_t limit;
- size_t size = sizeof(limit);
- if (sysctlbyname("kern.ipc.shmmax", &limit, &size, NULL, 0) < 0) {
+int64_t SysInfo::AmountOfAvailablePhysicalMemoryImpl() {
+ int page_size, r = 0;
+ unsigned pgfree, pginact, pgcache;
+ size_t size = sizeof(page_size);
@ -17,36 +39,15 @@
+ r = sysctlbyname("vm.stats.vm.v_inactive_count", &pginact, &szpg, NULL, 0);
+ if(r == 0)
+ r = sysctlbyname("vm.stats.vm.v_cache_count", &pgcache, &szpg, NULL, 0);
+ if (r == -1) {
+ NOTREACHED();
+ return 0;
+ }
+ return static_cast<int64_t>((pgfree + pginact + pgcache) * page_size);
+}
+
int64_t SysInfo::AmountOfPhysicalMemory() {
- int pages, page_size;
+ int pages, page_size, r = 0;
size_t size = sizeof(pages);
- sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
- sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
- if (pages == -1 || page_size == -1) {
+ if(r == 0)
+ r = sysctlbyname("vm.stats.vm.v_page_count", &pages, &size, NULL, 0);
+ if(r == 0)
+ r = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &size, NULL, 0);
+ if (r == -1) {
+ if(r == -1) {
NOTREACHED();
return 0;
}
@@ -25,14 +47,24 @@ int64_t SysInfo::AmountOfPhysicalMemory(
}
// static
-uint64_t SysInfo::MaxSharedMemorySize() {
- size_t limit;
- size_t size = sizeof(limit);
- if (sysctlbyname("kern.ipc.shmmax", &limit, &size, NULL, 0) < 0) {
- return static_cast<uint64_t>(limit);
+ return static_cast<int64_t>((pgfree + pginact + pgcache) * page_size);
+}
+
+// static
+std::string SysInfo::CPUModelName() {
+ int mib[] = { CTL_HW, HW_MODEL };
+ char name[256];
@ -61,11 +62,9 @@
+ int ncpu;
+ size_t size = sizeof(ncpu);
+ if (sysctl(mib, arraysize(mib), &ncpu, &size, NULL, 0) == -1) {
NOTREACHED();
- return 0;
+ NOTREACHED();
+ return 1;
}
- return static_cast<uint64_t>(limit);
+ }
+ return ncpu;
}

View File

@ -1,20 +1,38 @@
--- base/sys_info_posix.cc.orig 2017-04-19 19:06:28 UTC
+++ base/sys_info_posix.cc
--- base/sys_info_posix.cc.orig 2018-01-04 21:05:38.000000000 +0100
+++ base/sys_info_posix.cc 2018-01-27 20:03:02.391851000 +0100
@@ -35,7 +35,7 @@
namespace {
-#if !defined(OS_OPENBSD)
+#if !defined(OS_BSD)
-#if !defined(OS_OPENBSD) && !defined(OS_FUCHSIA)
+#if !defined(OS_BSD) && !defined(OS_FUCHSIA)
int NumberOfProcessors() {
// sysconf returns the number of "logical" (not "physical") processors on both
// Mac and Linux. So we get the number of max available "logical" processors.
@@ -128,7 +128,7 @@ bool GetDiskSpaceInfo(const base::FilePa
@@ -62,7 +62,7 @@
base::LazyInstance<
base::internal::LazySysInfoValue<int, NumberOfProcessors> >::Leaky
g_lazy_number_of_processors = LAZY_INSTANCE_INITIALIZER;
-#endif // !defined(OS_OPENBSD) && !defined(OS_FUCHSIA)
+#endif // !defined(OS_BSD) && !defined(OS_FUCHSIA)
#if !defined(OS_FUCHSIA)
int64_t AmountOfVirtualMemory() {
@@ -130,7 +130,7 @@
namespace base {
-#if !defined(OS_OPENBSD)
+#if !defined(OS_BSD)
-#if !defined(OS_OPENBSD) && !defined(OS_FUCHSIA)
+#if !defined(OS_BSD) && !defined(OS_FUCHSIA)
int SysInfo::NumberOfProcessors() {
return g_lazy_number_of_processors.Get().value();
}
@@ -223,6 +223,8 @@
arch = "x86";
} else if (arch == "amd64") {
arch = "x86_64";
+ } else if (arch == "arm64") {
+ arch = "aarch64";
} else if (std::string(info.sysname) == "AIX") {
arch = "ppc64";
}

View File

@ -1,11 +0,0 @@
--- base/test/BUILD.gn.orig 2017-04-19 19:06:28 UTC
+++ base/test/BUILD.gn
@@ -312,7 +312,7 @@ static_library("run_all_base_unittests")
]
}
-if (is_linux) {
+if (is_linux || is_bsd) {
shared_library("malloc_wrapper") {
testonly = true
sources = [

View File

@ -1,13 +1,10 @@
--- base/test/launcher/test_launcher.cc.orig 2017-04-19 19:06:28 UTC
+++ base/test/launcher/test_launcher.cc
@@ -60,6 +60,10 @@
#include "base/win/windows_version.h"
#endif
--- base/test/launcher/test_launcher.cc.orig 2017-12-15 02:04:05.000000000 +0100
+++ base/test/launcher/test_launcher.cc 2017-12-30 02:02:22.630578000 +0100
@@ -51,6 +51,7 @@
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(OS_FREEBSD)
#if defined(OS_POSIX)
+#include <signal.h>
+#endif
+
namespace base {
#include <fcntl.h>
// See https://groups.google.com/a/chromium.org/d/msg/chromium-dev/nkdTP7sstSc/uT3FaE_sgkAJ .
#include "base/files/file_descriptor_watcher_posix.h"

View File

@ -0,0 +1,13 @@
--- base/test/test_file_util_linux.cc.orig 2017-08-10 16:14:03.505570000 +0200
+++ base/test/test_file_util_linux.cc 2017-08-10 16:14:43.299690000 +0200
@@ -20,8 +20,10 @@
return false;
if (fdatasync(fd.get()) != 0)
return false;
+#if !defined(OS_BSD)
if (posix_fadvise(fd.get(), 0, 0, POSIX_FADV_DONTNEED) != 0)
return false;
+#endif
return true;
}

View File

@ -1,11 +1,11 @@
--- base/test/test_file_util_posix.cc.orig 2017-04-19 19:06:28 UTC
+++ base/test/test_file_util_posix.cc
@@ -79,7 +79,7 @@ bool DieFileDie(const FilePath& file, bo
--- base/test/test_file_util_posix.cc.orig 2017-09-05 21:05:11.000000000 +0200
+++ base/test/test_file_util_posix.cc 2017-09-06 16:59:12.993711000 +0200
@@ -79,7 +79,7 @@
return DeleteFile(file, recurse);
}
-#if !defined(OS_LINUX) && !defined(OS_MACOSX)
+#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_BSD)
-#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
+#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) && !defined(OS_BSD)
bool EvictFileFromSystemCache(const FilePath& file) {
// There doesn't seem to be a POSIX way to cool the disk cache.
NOTIMPLEMENTED();

View File

@ -1,11 +1,23 @@
--- base/third_party/libevent/BUILD.gn.orig 2017-04-19 19:06:28 UTC
+++ base/third_party/libevent/BUILD.gn
@@ -50,6 +50,9 @@ static_library("libevent") {
--- base/third_party/libevent/BUILD.gn.orig 2018-01-04 21:05:38.000000000 +0100
+++ base/third_party/libevent/BUILD.gn 2018-01-06 01:02:53.058845000 +0100
@@ -43,13 +43,20 @@
"mac/event-config.h",
]
include_dirs = [ "mac" ]
- } else if (is_linux) {
+ } else if (is_linux && !is_bsd) {
sources += [
"epoll.c",
"linux/config.h",
"linux/event-config.h",
]
include_dirs = [ "linux" ]
+ } else if (is_bsd) {
+ sources += [ "kqueue.c" ]
+ sources += [
+ "kqueue.c",
+ "freebsd/config.h",
+ "freebsd/event-config.h",
+ ]
+ include_dirs = [ "freebsd" ]
} else if (is_android) {
sources += [

View File

@ -1,8 +1,8 @@
--- base/threading/platform_thread_linux.cc.orig 2017-04-19 19:06:28 UTC
+++ base/threading/platform_thread_linux.cc
--- base/threading/platform_thread_linux.cc.orig 2017-07-25 21:04:48.000000000 +0200
+++ base/threading/platform_thread_linux.cc 2017-08-01 22:36:09.953380000 +0200
@@ -19,7 +19,9 @@
#if !defined(OS_NACL)
#if !defined(OS_NACL) && !defined(OS_AIX)
#include <pthread.h>
+#if !defined(OS_BSD)
#include <sys/prctl.h>
@ -10,21 +10,12 @@
#include <sys/resource.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -130,7 +132,7 @@ void PlatformThread::SetName(const std::
@@ -130,7 +132,7 @@
ThreadIdNameManager::GetInstance()->SetName(CurrentId(), name);
tracked_objects::ThreadData::InitializeThreadContext(name);
-#if !defined(OS_NACL)
+#if !defined(OS_NACL) && !defined(OS_BSD)
-#if !defined(OS_NACL) && !defined(OS_AIX)
+#if !defined(OS_NACL) && !defined(OS_AIX) && !defined(OS_BSD)
// On linux we can get the thread names to show up in the debugger by setting
// the process name for the LWP. We don't want to do this for the main
// thread because that would rename the process, causing tools like killall
@@ -150,7 +152,7 @@ void PlatformThread::SetName(const std::
#endif // !defined(OS_NACL)
}
-#if !defined(OS_NACL)
+#if !defined(OS_NACL) && !defined(OS_BSD)
// static
void PlatformThread::SetThreadPriority(PlatformThreadId thread_id,
ThreadPriority priority) {

View File

@ -1,4 +1,4 @@
--- base/threading/thread_task_runner_handle.cc.orig 2017-04-19 19:06:28 UTC
--- base/threading/thread_task_runner_handle.cc.orig 2017-06-05 19:03:01 UTC
+++ base/threading/thread_task_runner_handle.cc
@@ -7,6 +7,7 @@
#include <utility>
@ -16,7 +16,7 @@
// static
ScopedClosureRunner ThreadTaskRunnerHandle::OverrideForTesting(
scoped_refptr<SingleThreadTaskRunner> overriding_task_runner) {
@@ -77,6 +79,7 @@ ScopedClosureRunner ThreadTaskRunnerHand
@@ -77,6 +79,7 @@ ScopedClosureRunner ThreadTaskRunnerHandle::OverrideFo
base::Passed(&overriding_task_runner),
base::Unretained(ttrh->task_runner_.get())));
}

View File

@ -1,11 +0,0 @@
--- base/trace_event/malloc_dump_provider.cc.orig 2017-04-19 19:06:28 UTC
+++ base/trace_event/malloc_dump_provider.cc
@@ -21,7 +21,7 @@
#if defined(OS_MACOSX)
#include <malloc/malloc.h>
#else
-#include <malloc.h>
+#include <stdlib.h>
#endif
#if defined(OS_WIN)
#include <windows.h>

View File

@ -0,0 +1,21 @@
--- base/trace_event/malloc_dump_provider.cc.orig 2017-08-02 18:33:27.773657000 +0200
+++ base/trace_event/malloc_dump_provider.cc 2017-08-02 18:34:48.019053000 +0200
@@ -21,6 +21,8 @@
#if defined(OS_MACOSX)
#include <malloc/malloc.h>
+#elif defined(OS_BSD)
+#include "stdlib.h"
#else
#include <malloc.h>
#endif
@@ -243,6 +245,9 @@
allocated_objects_count = main_heap_info.block_count;
#elif defined(OS_FUCHSIA)
// TODO(fuchsia): Port, see https://crbug.com/706592.
+#elif defined(OS_BSD)
+ total_virtual_size = 0;
+ allocated_objects_size = 0;
#else
struct mallinfo info = mallinfo();
DCHECK_GE(info.arena + info.hblkhd, info.uordblks);

View File

@ -1,11 +1,11 @@
--- base/trace_event/process_memory_dump.cc.orig 2017-04-19 19:06:28 UTC
+++ base/trace_event/process_memory_dump.cc
@@ -83,7 +83,7 @@ size_t ProcessMemoryDump::CountResidentB
--- base/trace_event/process_memory_dump.cc.orig 2018-05-09 21:05:33.000000000 +0200
+++ base/trace_event/process_memory_dump.cc 2018-08-16 02:36:46.780728000 +0200
@@ -92,7 +92,7 @@
const size_t kMaxChunkSize = 8 * 1024 * 1024;
size_t max_vec_size =
GetSystemPageCount(std::min(mapped_size, kMaxChunkSize), page_size);
-#if defined(OS_MACOSX) || defined(OS_IOS)
+#if defined(OS_MACOSX) || defined(OS_IOS) || defined(OS_BSD)
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_BSD)
std::unique_ptr<char[]> vec(new char[max_vec_size]);
#elif defined(OS_WIN)
std::unique_ptr<PSAPI_WORKING_SET_EX_INFORMATION[]> vec(

View File

@ -1,6 +1,6 @@
--- base/trace_event/process_memory_dump.h.orig 2017-04-19 19:06:28 UTC
+++ base/trace_event/process_memory_dump.h
@@ -24,7 +24,7 @@
--- base/trace_event/process_memory_dump.h.orig 2018-05-09 21:05:33.000000000 +0200
+++ base/trace_event/process_memory_dump.h 2018-08-16 02:49:06.092591000 +0200
@@ -22,7 +22,7 @@
// Define COUNT_RESIDENT_BYTES_SUPPORTED if platform supports counting of the
// resident memory.

View File

@ -1,11 +0,0 @@
--- breakpad/BUILD.gn.orig 2017-04-19 19:06:28 UTC
+++ breakpad/BUILD.gn
@@ -468,7 +468,7 @@ if (is_mac) {
}
}
-if (is_linux || is_android) {
+if (is_linux || is_bsd || is_android) {
if (current_toolchain == host_toolchain) {
executable("symupload") {
sources = [

View File

@ -1,18 +0,0 @@
--- breakpad/src/build/common.gypi.orig 2017-04-19 19:07:40 UTC
+++ breakpad/src/build/common.gypi
@@ -813,15 +813,6 @@
],
},
}],
- # FreeBSD-specific options; note that most FreeBSD options are set above,
- # with Linux.
- ['OS=="freebsd"', {
- 'target_defaults': {
- 'ldflags': [
- '-Wl,--no-keep-memory',
- ],
- },
- }],
['OS=="solaris"', {
'cflags!': ['-fvisibility=hidden'],
'cflags_cc!': ['-fvisibility-inlines-hidden'],

View File

@ -1,11 +0,0 @@
--- breakpad/src/common/simple_string_dictionary.h.orig 2017-04-19 19:07:40 UTC
+++ breakpad/src/common/simple_string_dictionary.h
@@ -33,7 +33,7 @@
#include <assert.h>
#include <string.h>
-#include "common/basictypes.h"
+#include "breakpad/src/common/basictypes.h"
namespace google_breakpad {

View File

@ -1,6 +1,6 @@
--- build/config/BUILD.gn.orig 2017-04-19 19:06:28 UTC
+++ build/config/BUILD.gn
@@ -193,7 +193,7 @@ config("debug") {
--- build/config/BUILD.gn.orig 2018-08-01 00:08:26.000000000 +0200
+++ build/config/BUILD.gn 2018-08-05 13:59:34.648903000 +0200
@@ -167,7 +167,7 @@
# builds, and we have to tell it to turn it off.
defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
}
@ -9,21 +9,22 @@
# Enable libstdc++ debugging facilities to help catch problems early, see
# http://crbug.com/65151 .
# TODO(phajdan.jr): Should we enable this for all of POSIX?
@@ -276,7 +276,7 @@ config("default_libs") {
"CoreText.framework",
"Foundation.framework",
@@ -269,9 +269,7 @@
]
- } else if (is_linux) {
+ } else if (is_linux && !is_bsd) {
} else if (is_linux) {
libs = [
"dl",
"rt",
@@ -307,7 +307,7 @@ config("executable_config") {
- "dl",
"pthread",
- "rt",
]
} else if (is_ios) {
configs += [ "//build/config/ios:ios_dynamic_flags" ]
- } else if (is_linux || is_android) {
+ } else if (is_linux || is_android || is_bsd) {
}
}
@@ -320,7 +318,7 @@
"//build/config/ios:ios_dynamic_flags",
"//build/config/ios:ios_executable_flags",
]
- } else if (is_linux || is_android || current_os == "aix") {
+ } else if (is_linux || is_bsd || is_android || current_os == "aix") {
configs += [ "//build/config/gcc:executable_ldconfig" ]
if (is_android) {
configs += [ "//build/config/android:executable_config" ]

View File

@ -1,6 +1,6 @@
--- build/config/BUILDCONFIG.gn.orig 2017-04-19 19:06:28 UTC
+++ build/config/BUILDCONFIG.gn
@@ -131,12 +131,13 @@ declare_args() {
--- build/config/BUILDCONFIG.gn.orig 2018-05-09 21:05:34.000000000 +0200
+++ build/config/BUILDCONFIG.gn 2018-08-16 02:56:08.556687000 +0200
@@ -131,14 +131,14 @@
is_official_build = false
# Whether we're a traditional desktop unix.
@ -9,14 +9,15 @@
# Set to true when compiling with the Clang compiler. Typically this is used
# to configure warnings.
is_clang = current_os == "mac" || current_os == "ios" ||
- current_os == "linux" || current_os == "chromeos"
+ current_os == "linux" || current_os == "chromeos" ||
+ current_os == "bsd"
# Allows the path to a custom target toolchain to be injected as a single
# argument, and set as the default toolchain.
@@ -185,8 +186,8 @@ if (host_toolchain == "") {
is_clang =
current_os == "mac" || current_os == "ios" || current_os == "chromeos" ||
current_os == "fuchsia" || current_os == "android" ||
- current_os == "win" ||
+ current_os == "win" || current_os == "bsd" ||
(current_os == "linux" && current_cpu != "s390x" &&
current_cpu != "s390" && current_cpu != "ppc64" &&
current_cpu != "ppc" && current_cpu != "mips" && current_cpu != "mips64")
@@ -190,8 +190,8 @@
# TODO(dpranke): Add some sort of assert here that verifies that
# no toolchain omitted host_toolchain from its toolchain_args().
@ -27,40 +28,95 @@
# TODO(dpranke) - is_clang normally applies only to the target
# build, and there is no way to indicate that you want to override
# it for both the target build *and* the host build. Do we need to
@@ -222,7 +223,7 @@ if (target_os == "android") {
} else {
_default_toolchain = "//build/toolchain/android:android_$target_cpu"
}
@@ -225,7 +225,7 @@
assert(host_os == "linux" || host_os == "mac",
"Android builds are only supported on Linux and Mac hosts.")
_default_toolchain = "//build/toolchain/android:android_clang_$target_cpu"
-} else if (target_os == "chromeos" || target_os == "linux") {
+} else if (target_os == "chromeos" || target_os == "linux" || target_os == "bsd") {
# See comments in build/toolchain/cros/BUILD.gn about board compiles.
if (is_clang) {
_default_toolchain = "//build/toolchain/linux:clang_$target_cpu"
@@ -342,8 +343,17 @@ if (current_os == "win" || current_os ==
@@ -298,6 +298,7 @@
is_nacl = false
is_posix = false
is_win = true
+ is_bsd = false
} else if (current_os == "mac") {
is_android = false
is_chromeos = false
@@ -308,6 +309,7 @@
is_nacl = false
is_posix = true
is_win = false
+ is_bsd = false
} else if (current_os == "android") {
is_android = true
is_chromeos = false
@@ -318,6 +320,7 @@
is_nacl = false
is_posix = true
is_win = false
+ is_bsd = false
} else if (current_os == "chromeos") {
is_android = false
is_chromeos = true
@@ -328,6 +331,7 @@
is_nacl = false
is_posix = true
is_win = false
+ is_bsd = false
} else if (current_os == "nacl") {
# current_os == "nacl" will be passed by the nacl toolchain definition.
# It is not set by default or on the command line. We treat is as a
@@ -341,6 +345,7 @@
is_nacl = true
is_posix = true
is_win = false
+ is_bsd = false
} else if (current_os == "fuchsia") {
is_android = false
is_chromeos = false
@@ -351,6 +356,7 @@
is_nacl = false
is_posix = false
is_win = false
+ is_bsd = false
} else if (current_os == "ios") {
is_android = false
is_chromeos = false
@@ -361,6 +367,7 @@
is_nacl = false
is_posix = true
is_win = false
+ is_bsd = false
} else if (current_os == "linux") {
is_android = false
is_chromeos = false
@@ -371,6 +378,7 @@
is_nacl = false
is_posix = true
is_win = false
+ is_bsd = false
} else if (current_os == "aix") {
is_android = false
is_chromeos = false
@@ -381,6 +389,18 @@
is_nacl = false
is_posix = true
is_win = false
+ is_bsd = false
+} else if (current_os == "bsd") {
+ is_android = false
+ is_chromeos = false
+ is_fuchsia = false
+ is_ios = false
+ is_linux = false
+ is_bsd = true
+ is_linux = true
+ is_mac = false
+ is_nacl = false
+ is_posix = true
+ is_win = false
+ is_bsd = true
}
-
# =============================================================================
# SOURCES FILTERS
# =============================================================================
@@ -412,7 +422,7 @@ if (!is_ios) {
if (!is_mac && !is_ios) {
sources_assignment_filter += [ "*.mm" ]
}
-if (!is_linux) {
+if (!is_linux && !is_bsd) {
sources_assignment_filter += [
"*_linux.h",
"*_linux.cc",

View File

@ -1,16 +1,20 @@
--- build/config/allocator.gni.orig 2017-04-19 19:06:28 UTC
+++ build/config/allocator.gni
@@ -45,10 +45,10 @@ assert(use_allocator == "none" || use_al
assert(!is_win || use_allocator == "none", "Tcmalloc doesn't work on Windows.")
assert(!is_mac || use_allocator == "none", "Tcmalloc doesn't work on macOS.")
--- build/config/allocator.gni.orig 2018-06-13 00:10:02.000000000 +0200
+++ build/config/allocator.gni 2018-07-14 13:12:35.947359000 +0200
@@ -6,7 +6,7 @@
-assert(!use_experimental_allocator_shim || is_linux || is_android || is_win ||
- is_mac,
+assert(!use_experimental_allocator_shim || is_linux || is_android || is_win ||
+ is_mac || is_bsd,
"use_experimental_allocator_shim supported only on Linux, Android, " +
- "Windows and macOS targets")
+ "Windows, macOS and BSD targets")
if (is_win && use_experimental_allocator_shim) {
assert(!is_component_build,
# Temporarily disable tcmalloc on arm64 linux to get rid of compilation errors.
if (is_android || is_mac || is_ios || is_asan || is_lsan || is_tsan ||
- is_msan || is_win || is_fuchsia || (is_linux && target_cpu == "arm64")) {
+ is_msan || is_win || is_fuchsia || (is_linux && target_cpu == "arm64") || is_bsd) {
_default_allocator = "none"
} else {
_default_allocator = "tcmalloc"
@@ -17,7 +17,7 @@
# against the debug CRT with "is_nacl=false".
if ((is_linux || is_android || is_mac ||
(is_win && !is_component_build && !is_debug)) && !is_asan && !is_lsan &&
- !is_tsan && !is_msan) {
+ !is_tsan && !is_msan && !is_bsd) {
_default_use_allocator_shim = true
} else {
_default_use_allocator_shim = false

View File

@ -1,20 +0,0 @@
--- build/config/clang/BUILD.gn.orig 2017-04-19 19:06:28 UTC
+++ build/config/clang/BUILD.gn
@@ -20,7 +20,7 @@ config("find_bad_constructs") {
rebase_path("${clang_base_path}/lib/libFindBadConstructs.dylib",
root_build_dir),
]
- } else if (is_linux || is_android) {
+ } else if (is_linux || is_bsd || is_android) {
cflags += [
"-Xclang",
"-load",
@@ -41,7 +41,7 @@ config("find_bad_constructs") {
"check-auto-raw-pointer",
]
- if ((is_linux || is_android) && !is_chromecast) {
+ if ((is_linux || is_bsd || is_android) && !is_chromecast) {
cflags += [
"-Xclang",
"-plugin-arg-find-bad-constructs",

View File

@ -1,136 +0,0 @@
--- build/config/compiler/BUILD.gn.orig 2017-04-19 21:06:28.000000000 +0200
+++ build/config/compiler/BUILD.gn 2017-06-15 22:15:26.426452000 +0200
@@ -36,7 +36,7 @@
# only two architectures that are currently checked in). Turn this off when
# you are using a custom toolchain and need to control -B in cflags.
linux_use_bundled_binutils =
- linux_use_bundled_binutils_override && is_linux &&
+ linux_use_bundled_binutils_override && (is_linux && !is_bsd) &&
(current_cpu == "x64" || current_cpu == "x86")
binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
root_build_dir)
@@ -158,7 +158,7 @@
configs += [ "//build/config/win:compiler" ]
} else if (is_android) {
configs += [ "//build/config/android:compiler" ]
- } else if (is_linux) {
+ } else if (is_linux || is_bsd) {
configs += [ "//build/config/linux:compiler" ]
} else if (is_nacl) {
configs += [ "//build/config/nacl:compiler" ]
@@ -214,7 +214,7 @@
# Linker warnings.
if (fatal_linker_warnings && !(is_chromeos && current_cpu == "arm") &&
- !(is_android && use_order_profiling) && !is_mac && !is_ios) {
+ !(is_android && use_order_profiling) && !is_mac && !is_ios && !is_bsd) {
# TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
# TODO(lizeb,pasko): Fix link errors when linking with order_profiling=1
# crbug.com/485542
@@ -301,7 +301,7 @@
# Linux/Android common flags setup.
# ---------------------------------
- if (is_linux || is_android) {
+ if (is_linux || is_bsd || is_android) {
cflags += [
"-fPIC",
"-pipe", # Use pipes for communicating between sub-processes. Faster.
@@ -314,7 +314,7 @@
"-Wl,-z,relro",
]
if (!using_sanitizer) {
- if (!use_cfi_diag) {
+ if (!use_cfi_diag && !is_bsd) {
ldflags += [ "-Wl,-z,defs" ]
}
@@ -428,14 +428,14 @@
# clang-cl (used if is_win) doesn't expose this flag.
# Currently disabled for nacl since its toolchain lacks this flag (too old).
# TODO(zforman): Once nacl's toolchain is updated, remove check.
- if (is_clang && is_linux && strip_absolute_paths_from_debug_symbols) {
+ if (is_clang && (is_linux || is_bsd) && strip_absolute_paths_from_debug_symbols) {
absolute_path = rebase_path("//.")
cflags += [ "-fdebug-prefix-map=$absolute_path=." ]
}
# C++11 compiler flags setup.
# ---------------------------
- if (is_linux || is_android || (is_nacl && is_clang)) {
+ if (is_linux || is_bsd || is_android || (is_nacl && is_clang)) {
# gnu++11 instead of c++11 is needed because some code uses typeof() (a
# GNU extension).
# TODO(thakis): Eventually switch this to c++11 instead,
@@ -488,7 +488,7 @@
]
# Apply a lower LTO optimization level as the default is too slow.
- if (is_linux) {
+ if (is_linux || is_bsd) {
if (use_lld) {
ldflags += [ "-Wl,--lto-O1" ]
} else {
@@ -508,7 +508,7 @@
# targeting ARM, without this flag, LTO produces a .text section that is
# larger than the maximum call displacement, preventing the linker from
# relocating calls (http://llvm.org/PR22999).
- if (is_linux) {
+ if (is_linux || is_bsd) {
ldflags += [ "-Wl,-plugin-opt,-function-sections" ]
}
}
@@ -776,7 +776,7 @@
# configs -= [ "//build/config/compiler:clang_stackrealign" ]
# See https://crbug.com/556393 for details of where it must be avoided.
config("clang_stackrealign") {
- if (is_clang && current_cpu == "x86" && is_linux) {
+ if (is_clang && current_cpu == "x86" && (is_linux || is_bsd)) {
cflags = [
# Align the stack on 16-byte boundaries, http://crbug.com/418554.
"-mstack-alignment=16",
@@ -830,7 +830,7 @@
# smaller.
if (is_win) {
configs += [ "//build/config/win:runtime_library" ]
- } else if (is_linux) {
+ } else if (is_linux || is_bsd) {
configs += [ "//build/config/linux:runtime_library" ]
} else if (is_ios) {
configs += [ "//build/config/ios:runtime_library" ]
@@ -1104,7 +1104,7 @@
"-Wno-block-capture-autoreleasing",
# TODO(hans): https://crbug.com/681136
- "-Wno-unused-lambda-capture",
+ # "-Wno-unused-lambda-capture",
# TODO(thakis ): https://crbug.com/683349
"-Wno-user-defined-warnings",
@@ -1144,7 +1144,7 @@
]
if (!is_debug && !using_sanitizer &&
- (!is_linux || !is_clang || is_official_build)) {
+ (!is_linux || !is_bsd || !is_clang || is_official_build)) {
# _FORTIFY_SOURCE isn't really supported by Clang now, see
# http://llvm.org/bugs/show_bug.cgi?id=16821.
# It seems to work fine with Ubuntu 12 headers though, so use it in
@@ -1203,7 +1203,7 @@
]
}
- if (is_linux || is_android) {
+ if (is_linux || is_bsd || is_android) {
cflags_cc += [
# Don't warn about hash_map in third-party code.
"-Wno-deprecated",
@@ -1647,7 +1647,7 @@
"-g2",
]
} else {
- cflags = [ "-g2" ]
+ cflags = [ "-g0" ]
}
if (use_debug_fission) {
cflags += [ "-gsplit-dwarf" ]

View File

@ -1,11 +1,11 @@
--- build/config/compiler/compiler.gni.orig 2018-06-19 18:30:17.888048000 +0200
+++ build/config/compiler/compiler.gni 2018-06-19 18:32:11.279335000 +0200
@@ -72,7 +72,7 @@
--- build/config/compiler/compiler.gni.orig 2018-05-09 21:05:34.000000000 +0200
+++ build/config/compiler/compiler.gni 2018-08-16 03:18:27.380502000 +0200
@@ -174,7 +174,7 @@
declare_args() {
# Whether to use the gold linker from binutils instead of lld or bfd.
- use_gold = !use_lld && !(is_chromecast && is_linux &&
+ use_gold = !is_bsd && !use_lld && !(is_chromecast && is_linux &&
(current_cpu == "arm" || current_cpu == "mipsel")) &&
((is_linux && (current_cpu == "x64" || current_cpu == "x86" ||
current_cpu == "arm" || current_cpu == "mipsel")) ||
- use_gold =
+ use_gold = !is_bsd &&
(!use_lld && !(is_chromecast && is_linux &&
(current_cpu == "arm" || current_cpu == "mipsel")) &&
(is_linux &&

View File

@ -1,8 +0,0 @@
--- build/config/crypto.gni.orig 2017-04-19 19:06:28 UTC
+++ build/config/crypto.gni
@@ -20,4 +20,4 @@ use_openssl_certs = is_android || is_nac
# True if NSS is used for certificate handling. It is possible to use OpenSSL
# for the crypto library, but NSS for the platform certificate library.
-use_nss_certs = is_linux
+use_nss_certs = is_linux || is_bsd

View File

@ -1,19 +1,11 @@
--- build/config/features.gni.orig 2017-04-19 19:06:28 UTC
+++ build/config/features.gni
@@ -60,13 +60,13 @@ declare_args() {
--- build/config/features.gni.orig 2017-12-15 02:04:05.000000000 +0100
+++ build/config/features.gni 2017-12-23 23:30:21.417932000 +0100
@@ -46,7 +46,7 @@
fieldtrial_testing_like_official_build = is_chrome_branded
# libudev usage. This currently only affects the content layer.
use_udev = is_linux && !is_chromecast
- use_udev = is_linux && !is_chromecast
+ use_udev = is_linux && !is_chromecast && !is_bsd
- use_dbus = is_linux && !is_chromecast
+ use_dbus = (is_linux || is_bsd) && !is_chromecast
use_dbus = is_linux && !is_chromecast
# Option controlling the use of GConf (the classic GNOME configuration
# system).
- use_gconf = is_linux && !is_chromeos && !is_chromecast
+ use_gconf = (is_linux || is_bsd) && !is_chromeos && !is_chromecast
- use_gio = is_linux && !is_chromeos && !is_chromecast
+ use_gio = (is_linux || is_bsd) && !is_chromeos && !is_chromecast
# Whether or not to use external popup menu.
use_external_popup_menu = is_android || is_mac

View File

@ -0,0 +1,11 @@
--- build/config/linux/BUILD.gn.orig 2018-07-19 22:09:59.968726000 +0200
+++ build/config/linux/BUILD.gn 2018-07-19 22:10:16.334896000 +0200
@@ -28,7 +28,7 @@
}
if ((!is_chromeos || default_toolchain != "//build/toolchain/cros:target") &&
- (!use_custom_libcxx || current_cpu == "mipsel")) {
+ (!use_custom_libcxx || current_cpu == "mipsel") && !is_bsd) {
libs = [ "atomic" ]
}
}

View File

@ -1,11 +0,0 @@
--- build/config/linux/gtk2/BUILD.gn.orig 2017-04-19 19:06:28 UTC
+++ build/config/linux/gtk2/BUILD.gn
@@ -4,7 +4,7 @@
import("//build/config/linux/pkg_config.gni")
-assert(is_linux, "This file should only be referenced on Linux")
+assert(is_linux || is_bsd, "This file should only be referenced on Linux")
# Depend on //build/config/linux/gtk2 to use GTKv2. Depend on
# //build/config/linux/gtk to get GTK 2 or 3 depending on the build flags.

View File

@ -1,11 +0,0 @@
--- build/config/linux/gtk3/BUILD.gn.orig 2017-04-19 19:06:28 UTC
+++ build/config/linux/gtk3/BUILD.gn
@@ -4,7 +4,7 @@
import("//build/config/linux/pkg_config.gni")
-assert(is_linux, "This file should only be referenced on Linux")
+assert(is_linux || is_bsd, "This file should only be referenced on Linux")
# Depend on //build/config/linux/gtk3 to use GTKv3. Depend on
# //build/config/linux/gtk to get GTK 2 or 3 depending on the build flags.

View File

@ -1,11 +0,0 @@
--- build/config/linux/gtk/BUILD.gn.orig 2017-04-19 19:06:28 UTC
+++ build/config/linux/gtk/BUILD.gn
@@ -5,7 +5,7 @@
import("//build/config/linux/gtk/gtk.gni")
import("//build/config/linux/pkg_config.gni")
-assert(is_linux, "This file should only be referenced on Linux")
+assert(is_linux || is_bsd, "This file should only be referenced on Linux")
# The target in this file will automatically reference GTK2 or GTK3 depending
# on the state of the build flag. Some builds reference both 2 and 3, and some

View File

@ -1,20 +0,0 @@
--- build/config/sanitizers/BUILD.gn.orig 2017-04-19 19:06:28 UTC
+++ build/config/sanitizers/BUILD.gn
@@ -428,7 +428,7 @@ config("lsan_flags") {
config("msan_flags") {
if (is_msan) {
- assert(is_linux, "msan only supported on linux x86_64")
+ assert(is_linux || is_bsd, "msan only supported on linux x86_64")
if (!defined(msan_blacklist_path)) {
msan_blacklist_path =
rebase_path("//tools/msan/blacklist.txt", root_build_dir)
@@ -443,7 +443,7 @@ config("msan_flags") {
config("tsan_flags") {
if (is_tsan) {
- assert(is_linux, "tsan only supported on linux x86_64")
+ assert(is_linux || is_bsd, "tsan only supported on linux x86_64")
if (!defined(tsan_blacklist_path)) {
tsan_blacklist_path =
rebase_path("//tools/memory/tsan_v2/ignores.txt", root_build_dir)

View File

@ -1,13 +0,0 @@
--- build/config/sanitizers/sanitizers.gni.orig 2017-04-19 19:06:28 UTC
+++ build/config/sanitizers/sanitizers.gni
@@ -54,8 +54,8 @@ declare_args() {
# See http://clang.llvm.org/docs/ControlFlowIntegrity.html
#
# TODO(pcc): Remove this flag if/when CFI is enabled in all official builds.
- is_cfi = target_os == "linux" && !is_chromeos && target_cpu == "x64" &&
- is_official_build && allow_posix_link_time_opt
+ is_cfi = (target_os == "linux" || target_os == "bsd") && !is_chromeos &&
+ target_cpu == "x64" && is_official_build && allow_posix_link_time_opt
# Enable checks for bad casts: derived cast and unrelated cast.
# TODO(krasin): remove this, when we're ready to add these checks by default.

View File

@ -1,36 +0,0 @@
--- build/config/ui.gni.orig 2017-04-19 19:06:28 UTC
+++ build/config/ui.gni
@@ -31,10 +31,10 @@ declare_args() {
# Indicates if Aura is enabled. Aura is a low-level windowing library, sort
# of a replacement for GDI or GTK.
- use_aura = is_win || is_linux
+ use_aura = is_win || is_linux || is_bsd
# Whether we should use glib, a low level C utility library.
- use_glib = is_linux
+ use_glib = is_linux || is_bsd
# Indicates if Wayland display server support is enabled.
enable_wayland_server = is_chromeos
@@ -55,17 +55,17 @@ declare_args() {
# Use GPU accelerated cross process image transport by default on linux builds
# with the Aura window manager.
-ui_compositor_image_transport = use_aura && is_linux
+ui_compositor_image_transport = use_aura && (is_linux || is_bsd)
# Indicates if the UI toolkit depends on X11.
-use_x11 = is_linux && !use_ozone
+use_x11 = (is_linux || is_bsd) && !use_ozone
# Turn off glib if Ozone is enabled.
if (use_ozone) {
use_glib = false
}
-if (is_linux && !use_ozone) {
+if ((is_linux || is_bsd) && !use_ozone) {
use_cairo = true
use_pango = true
} else {

View File

@ -0,0 +1,11 @@
--- build/gn_run_binary.py.orig 2017-12-30 01:00:32.419195000 +0100
+++ build/gn_run_binary.py 2017-12-30 01:01:14.497716000 +0100
@@ -19,7 +19,7 @@
# The rest of the arguments are passed directly to the executable.
args = [path] + sys.argv[2:]
-ret = subprocess.call(args)
+ret = subprocess.call(args, env={"CHROME_EXE_PATH":"${WRKSRC}/out/Release/chrome"})
if ret != 0:
print '%s failed with exit code %d' % (sys.argv[1], ret)
sys.exit(ret)

View File

@ -0,0 +1,22 @@
--- build/linux/unbundle/ffmpeg.gn.orig 2018-07-20 01:03:59.604084000 +0200
+++ build/linux/unbundle/ffmpeg.gn 2018-07-20 01:04:45.406745000 +0200
@@ -14,8 +14,8 @@
]
}
-buildflag_header("ffmpeg_buildflags") {
- header = "ffmpeg_buildflags.h"
+buildflag_header("ffmpeg_features") {
+ header = "ffmpeg_features.h"
flags = [ "USE_SYSTEM_FFMPEG=true" ]
}
@@ -30,7 +30,7 @@
source_set("ffmpeg") {
deps = [
- ":ffmpeg_buildflags",
+ ":ffmpeg_features",
":ffmpeg_shim",
]
public_configs = [ ":system_ffmpeg" ]

View File

@ -0,0 +1,27 @@
--- build/linux/unbundle/libusb.gn.orig 2018-07-20 03:07:05.793992000 +0200
+++ build/linux/unbundle/libusb.gn 2018-07-20 03:07:35.792417000 +0200
@@ -0,0 +1,24 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/linux/pkg_config.gni")
+import("//build/shim_headers.gni")
+
+pkg_config("system_libusb") {
+ packages = [ "libusb-1.0" ]
+}
+
+shim_headers("libusb_shim") {
+ root_path = "src/libusb"
+ headers = [
+ "libusb.h",
+ ]
+}
+
+source_set("libusb") {
+ deps = [
+ ":libusb_shim",
+ ]
+ public_configs = [ ":system_libusb" ]
+}

View File

@ -0,0 +1,41 @@
--- build/linux/unbundle/libwebp.gn.orig 2018-08-13 22:43:49.456935000 +0200
+++ build/linux/unbundle/libwebp.gn 2018-08-13 22:48:47.151901000 +0200
@@ -2,12 +2,34 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/config/linux/pkg_config.gni")
+import("//build/shim_headers.gni")
+
+pkg_config("system_libwebp") {
+ packages = [
+ "libwebp",
+ "libwebpdemux",
+ "libwebpmux",
+ ]
+}
+
+shim_headers("libwebp_shim") {
+ root_path = "src"
+ headers = [
+ "webp/decode.h",
+ "webp/demux.h",
+ "webp/encode.h",
+ "webp/mux.h",
+ "webp/mux_types.h",
+ "webp/types.h",
+ ]
+}
+
source_set("libwebp_webp") {
- libs = [
- "webp",
- "webpdemux",
- "webpmux",
+ deps = [
+ ":libwebp_shim",
]
+ public_configs = [ ":system_libwebp" ]
}
group("libwebp") {

View File

@ -0,0 +1,10 @@
--- build/linux/unbundle/replace_gn_files.py.orig 2018-07-20 03:07:59.446131000 +0200
+++ build/linux/unbundle/replace_gn_files.py 2018-07-20 03:08:31.519350000 +0200
@@ -27,6 +27,7 @@
'libevent': 'base/third_party/libevent/BUILD.gn',
'libjpeg': 'third_party/libjpeg.gni',
'libpng': 'third_party/libpng/BUILD.gn',
+ 'libusb': 'third_party/libusb/BUILD.gn',
'libvpx': 'third_party/libvpx/BUILD.gn',
'libwebp': 'third_party/libwebp/BUILD.gn',
'libxml': 'third_party/libxml/BUILD.gn',

View File

@ -1,11 +0,0 @@
--- build/secondary/third_party/nss/BUILD.gn.orig 2017-04-19 19:06:28 UTC
+++ build/secondary/third_party/nss/BUILD.gn
@@ -4,7 +4,7 @@
import("//build/config/linux/pkg_config.gni")
-if (is_linux) {
+if (is_linux || is_bsd) {
# This is a dependency on NSS with no libssl. On Linux we use a built-in SSL
# library but the system NSS libraries. Non-Linux platforms using NSS use the
# hermetic one in //third_party/nss.

View File

@ -1,24 +1,10 @@
--- build/toolchain/linux/BUILD.gn.orig 2017-04-19 19:06:28 UTC
+++ build/toolchain/linux/BUILD.gn
@@ -6,7 +6,9 @@ import("//build/config/sysroot.gni")
import("//build/toolchain/gcc_toolchain.gni")
clang_toolchain("clang_arm") {
- toolprefix = "arm-linux-gnueabihf-"
+ if (!is_bsd) {
+ toolprefix = "arm-linux-gnueabihf-"
+ }
toolchain_args = {
current_cpu = "arm"
current_os = "linux"
@@ -14,7 +16,9 @@ clang_toolchain("clang_arm") {
--- build/toolchain/linux/BUILD.gn.orig 2017-09-11 02:58:56.145741000 +0200
+++ build/toolchain/linux/BUILD.gn 2017-09-11 02:59:18.322655000 +0200
@@ -14,7 +14,6 @@
}
clang_toolchain("clang_arm64") {
- toolprefix = "aarch64-linux-gnu-"
+ if (!is_bsd) {
+ toolprefix = "aarch64-linux-gnu-"
+ }
toolchain_args = {
current_cpu = "arm64"
current_os = "linux"

View File

@ -0,0 +1,22 @@
--- cc/BUILD.gn.orig 2017-12-30 06:26:13.722587000 +0100
+++ cc/BUILD.gn 2017-12-30 06:26:46.042197000 +0100
@@ -541,7 +541,7 @@
"//ui/gl:test_support",
"//ui/latency",
]
- if (!is_android) {
+ if (!is_android && !is_bsd) {
data_deps = [
"//third_party/mesa:osmesa",
]
@@ -717,10 +717,6 @@
"//ui/gfx/geometry",
"//ui/gl",
"//ui/gl:test_support",
- ]
-
- data_deps = [
- "//third_party/mesa:osmesa",
]
}

View File

@ -1,6 +1,6 @@
--- cc/layers/scrollbar_layer_impl_base.cc.orig 2017-04-19 19:06:28 UTC
--- cc/layers/scrollbar_layer_impl_base.cc.orig 2017-06-05 19:03:01 UTC
+++ cc/layers/scrollbar_layer_impl_base.cc
@@ -174,8 +174,8 @@ gfx::Rect ScrollbarLayerImplBase::Comput
@@ -175,8 +175,8 @@ gfx::Rect ScrollbarLayerImplBase::ComputeThumbQuadRect
int thumb_offset = TrackStart();
if (maximum > 0) {
float ratio = clamped_current_pos / maximum;

View File

@ -1,6 +1,6 @@
--- cc/trees/property_tree.cc.orig 2017-04-19 19:06:28 UTC
--- cc/trees/property_tree.cc.orig 2017-06-05 19:03:01 UTC
+++ cc/trees/property_tree.cc
@@ -1229,13 +1229,13 @@ gfx::ScrollOffset ScrollTree::MaxScrollO
@@ -1256,13 +1256,13 @@ gfx::ScrollOffset ScrollTree::MaxScrollOffset(int scro
gfx::Size clip_layer_bounds = scroll_clip_layer_bounds(scroll_node->id);

View File

@ -1,41 +0,0 @@
--- chrome/BUILD.gn.orig 2017-04-24 14:40:29 UTC
+++ chrome/BUILD.gn
@@ -142,7 +142,7 @@ if (!is_android && !is_mac) {
data = [
"$root_out_dir/resources.pak",
]
- if (is_linux || is_win) {
+ if (is_linux || is_bsd || is_win) {
data += [
"$root_out_dir/chrome_100_percent.pak",
"$root_out_dir/locales/en-US.pak",
@@ -221,10 +221,9 @@ if (!is_android && !is_mac) {
} else if (use_aura) {
# Non-Windows aura entrypoint.
sources += [ "app/chrome_exe_main_aura.cc" ]
- ldflags = [ "-Wl,--no-keep-memory" ]
}
- if (is_linux) {
+ if (is_linux || is_bsd) {
sources += [
"app/chrome_dll_resource.h",
"app/chrome_main.cc",
@@ -254,7 +253,7 @@ if (!is_android && !is_mac) {
"//chrome/common:features",
]
- ldflags += [ "-pie", "-Wl,--no-keep-memory" ]
+ ldflags = [ "-pie" ]
if (use_pango || use_cairo) {
# Needed for chrome_main.cc initialization of libraries.
@@ -1650,7 +1649,7 @@ if (enable_resource_whitelist_generation
}
}
-if (is_linux) {
+if (is_linux || is_bsd) {
action("manpage") {
if (is_chrome_branded) {
name = "Google Chrome"

View File

@ -1,6 +1,6 @@
--- chrome/app/chrome_command_ids.h.orig 2017-04-19 19:06:28 UTC
--- chrome/app/chrome_command_ids.h.orig 2017-06-05 19:03:01 UTC
+++ chrome/app/chrome_command_ids.h
@@ -71,7 +71,7 @@
@@ -67,7 +67,7 @@
#define IDC_VISIT_DESKTOP_OF_LRU_USER_2 34049
#define IDC_VISIT_DESKTOP_OF_LRU_USER_3 34050

View File

@ -1,19 +1,19 @@
--- chrome/app/chrome_main.cc.orig 2017-05-09 19:02:41 UTC
+++ chrome/app/chrome_main.cc
@@ -97,14 +97,14 @@ int ChromeMain(int argc, const char** ar
--- chrome/app/chrome_main.cc.orig 2017-09-05 21:05:12.000000000 +0200
+++ chrome/app/chrome_main.cc 2017-09-06 17:23:42.720920000 +0200
@@ -99,14 +99,14 @@
ALLOW_UNUSED_LOCAL(command_line);
#endif
-#if defined(OS_LINUX) || defined(OS_MACOSX)
+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
// Chrome-specific process modes.
-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_BSD)
if (command_line->HasSwitch(switches::kHeadless)) {
#if defined(OS_MACOSX)
SetUpBundleOverrides();
#endif
return headless::HeadlessShellMain(argc, argv);
return headless::HeadlessShellMain(params);
}
-#endif // defined(OS_LINUX) || defined(OS_MACOSX)
+#endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
-#endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
+#endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_BSD)
#if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
version_info::Channel channel = chrome::GetChannel();
#if BUILDFLAG(ENABLE_OOP_HEAP_PROFILING)
#if !defined(OS_WIN) || defined(COMPONENT_BUILD) || \

View File

@ -1,21 +1,16 @@
--- chrome/app/chrome_main_delegate.cc.orig 2017-04-19 19:06:28 UTC
+++ chrome/app/chrome_main_delegate.cc
@@ -89,7 +89,7 @@
#include "chrome/app/chrome_crash_reporter_client.h"
--- chrome/app/chrome_main_delegate.cc.orig 2018-02-24 16:25:09.000000000 +0100
+++ chrome/app/chrome_main_delegate.cc 2018-03-03 20:07:40.484969000 +0100
@@ -98,7 +98,7 @@
#include "chrome/app/shutdown_signal_handlers_posix.h"
#endif
-#if !defined(DISABLE_NACL) && defined(OS_LINUX)
+#if !defined(DISABLE_NACL) && defined(OS_LINUX) && !defined(OS_BSD)
-#if BUILDFLAG(ENABLE_NACL) && defined(OS_LINUX)
+#if BUILDFLAG(ENABLE_NACL) && defined(OS_LINUX) && !defined(OS_BSD)
#include "components/nacl/common/nacl_paths.h"
#include "components/nacl/zygote/nacl_fork_delegate_linux.h"
#endif
@@ -117,11 +117,11 @@
#include "ui/base/x/x11_util.h" // nogncheck
#endif
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_BSD)
#include "components/crash/content/app/breakpad_linux.h"
@@ -133,7 +133,7 @@
#include "v8/include/v8.h"
#endif
-#if defined(OS_LINUX)
@ -23,34 +18,16 @@
#include "base/environment.h"
#endif
@@ -163,7 +163,7 @@ base::LazyInstance<ChromeContentBrowserC
LAZY_INSTANCE_INITIALIZER;
#endif
@@ -238,7 +238,7 @@
-#if defined(OS_POSIX)
+#if defined(OS_POSIX) && !defined(OS_BSD)
base::LazyInstance<ChromeCrashReporterClient>::Leaky g_chrome_crash_client =
LAZY_INSTANCE_INITIALIZER;
#endif
@@ -280,7 +280,7 @@ static void AdjustLinuxOOMScore(const st
// and resources loaded.
bool SubprocessNeedsResourceBundle(const std::string& process_type) {
return
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_BSD)
// The zygote process opens the resources for the renderers.
process_type == switches::kZygoteProcess ||
#endif
@@ -332,7 +332,7 @@ void HandleHelpSwitches(const base::Comm
}
#endif
#endif // defined(OS_WIN)
-#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
+#if !defined(OS_MACOSX) && !defined(OS_ANDROID) && !defined(OS_BSD)
void SIGTERMProfilingShutdown(int signal) {
Profiling::Stop();
struct sigaction sigact;
@@ -399,7 +399,7 @@ void InitializeUserDataDir(base::Command
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) && !defined(OS_BSD)
void AdjustLinuxOOMScore(const std::string& process_type) {
// Browsers and zygotes should still be killable, but killed last.
const int kZygoteScore = 0;
@@ -407,7 +407,7 @@
std::string process_type =
command_line->GetSwitchValueASCII(switches::kProcessType);
@ -59,7 +36,16 @@
// On Linux, Chrome does not support running multiple copies under different
// DISPLAYs, so the profile directory can be specified in the environment to
// support the virtual desktop use-case.
@@ -592,7 +592,7 @@ bool ChromeMainDelegate::BasicStartupCom
@@ -581,7 +581,7 @@
#if defined(OS_CHROMEOS)
chromeos::RegisterPathProvider();
#endif
-#if BUILDFLAG(ENABLE_NACL) && defined(OS_LINUX)
+#if BUILDFLAG(ENABLE_NACL) && defined(OS_LINUX) && !defined(OS_BSD)
nacl::RegisterPathProvider();
#endif
@@ -603,7 +603,7 @@
std::string format_str =
command_line.GetSwitchValueASCII(switches::kDiagnosticsFormat);
if (format_str == "machine") {
@ -68,7 +54,7 @@
} else if (format_str == "log") {
format = diagnostics::DiagnosticsWriter::LOG;
} else {
@@ -642,7 +642,7 @@ bool ChromeMainDelegate::BasicStartupCom
@@ -653,7 +653,7 @@
std::string format_str =
command_line.GetSwitchValueASCII(switches::kDiagnosticsFormat);
if (format_str == "machine") {
@ -77,17 +63,8 @@
} else if (format_str == "human") {
format = diagnostics::DiagnosticsWriter::HUMAN;
} else {
@@ -754,7 +754,7 @@ void ChromeMainDelegate::PreSandboxStart
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
-#if defined(OS_POSIX)
+#if defined(OS_POSIX) && !defined(OS_BSD)
crash_reporter::SetCrashReporterClient(g_chrome_crash_client.Pointer());
#endif
@@ -884,7 +884,7 @@ void ChromeMainDelegate::PreSandboxStart
chrome::InitializePDF();
@@ -915,7 +915,7 @@
InitializePDF();
#endif
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
@ -95,7 +72,7 @@
// Zygote needs to call InitCrashReporter() in RunZygote().
if (process_type != switches::kZygoteProcess) {
#if defined(OS_ANDROID)
@@ -899,7 +899,7 @@ void ChromeMainDelegate::PreSandboxStart
@@ -931,7 +931,7 @@
breakpad::InitCrashReporter(process_type);
#endif // defined(OS_ANDROID)
}
@ -104,12 +81,12 @@
// After all the platform Breakpads have been initialized, store the command
// line for crash reporting.
@@ -1005,7 +1005,7 @@ bool ChromeMainDelegate::DelaySandboxIni
@@ -941,7 +941,7 @@
void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) {
// Note: If you are adding a new process type below, be sure to adjust the
// AdjustLinuxOOMScore function too.
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) && !defined(OS_BSD)
AdjustLinuxOOMScore(process_type);
#endif
return process_type == switches::kRelauncherProcess;
}
-#elif defined(OS_POSIX) && !defined(OS_ANDROID)
+#elif defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_BSD)
void ChromeMainDelegate::ZygoteStarting(
std::vector<std::unique_ptr<content::ZygoteForkDelegate>>* delegates) {
#if defined(OS_CHROMEOS)
#if defined(OS_WIN)

View File

@ -1,11 +0,0 @@
--- chrome/app/chrome_main_delegate.h.orig 2017-04-19 19:06:28 UTC
+++ chrome/app/chrome_main_delegate.h
@@ -42,7 +42,7 @@ class ChromeMainDelegate : public conten
const std::string& process_type) override;
bool ShouldSendMachPort(const std::string& process_type) override;
bool DelaySandboxInitialization(const std::string& process_type) override;
-#elif defined(OS_POSIX) && !defined(OS_ANDROID)
+#elif defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_BSD)
void ZygoteStarting(std::vector<std::unique_ptr<content::ZygoteForkDelegate>>*
delegates) override;
void ZygoteForked() override;

View File

@ -1,11 +1,11 @@
--- chrome/app/chromium_strings.grd.orig 2017-04-24 14:40:26 UTC
+++ chrome/app/chromium_strings.grd
@@ -891,7 +891,7 @@ Signing in anyway will merge browser inf
--- chrome/app/chromium_strings.grd.orig 2017-09-05 21:05:12.000000000 +0200
+++ chrome/app/chromium_strings.grd 2017-09-07 19:17:30.228682000 +0200
@@ -913,7 +913,7 @@
</message>
<!-- ProcessSingleton -->
- <if expr="is_linux or is_macosx">
+ <if expr="is_linux or is_macosx or is_bsd">
+ <if expr="is_linux or is_macosx or is_posix">
<message name="IDS_PROFILE_IN_USE_POSIX" desc="Message shown when the browser cannot start because the profile is in use on a different host.">
The profile appears to be in use by another browser process (<ph name="PROCESS_ID">$1<ex>12345</ex></ph>) on another computer (<ph name="HOST_NAME">$2<ex>example.com</ex></ph>). The browser has locked the profile so that it doesn't get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch the browser.
The profile appears to be in use by another Chromium process (<ph name="PROCESS_ID">$1<ex>12345</ex></ph>) on another computer (<ph name="HOST_NAME">$2<ex>example.com</ex></ph>). Chromium has locked the profile so that it doesn't get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chromium.
</message>

View File

@ -1,38 +1,29 @@
--- chrome/app/generated_resources.grd.orig 2017-04-24 14:40:26 UTC
+++ chrome/app/generated_resources.grd
@@ -6535,7 +6535,7 @@ Keep your key file in a safe place. You
<message name="IDS_FLAGS_FORCE_UI_DIRECTION_RTL" desc="Name for the option to force right-to-left UI direction mode.">
Right-to-left
</message>
- <if expr="is_win or is_linux">
+ <if expr="is_win or is_linux or is_bsd">
<message name="IDS_FLAGS_ENABLE_INPUT_IME_API_NAME" desc="Name of the flag to enable che chrome.input.ime API.">
Enable Input IME API
</message>
@@ -9629,7 +9629,7 @@ I don't think this site should be blocke
<message name="IDS_APPEARANCE_GROUP_NAME" desc="The title of the appearance group">
Appearance
--- chrome/app/generated_resources.grd.orig 2018-02-24 16:25:09.000000000 +0100
+++ chrome/app/generated_resources.grd 2018-03-03 20:22:12.855371000 +0100
@@ -6919,7 +6919,7 @@
Google Payments
</message>
- <if expr="not is_linux or chromeos">
+ <if expr="not is_linux or not is_bsd or chromeos">
+ <if expr="not is_posix or chromeos">
<message name="IDS_THEMES_GROUP_NAME" desc="The title of the themes group">
Themes
</message>
@@ -9637,7 +9637,7 @@ I don't think this site should be blocke
@@ -6927,7 +6927,7 @@
<message name="IDS_THEMES_RESET_BUTTON" desc="The button to reset your theme">
Reset to default theme
</message>
- <if expr="is_linux and not chromeos">
+ <if expr="is_linux or is_bsd and not chromeos">
+ <if expr="is_posix and not chromeos">
<message name="IDS_THEMES_GTK_BUTTON" desc="The button to choose GTK colors and icons as the current theme.">
Use GTK+ theme
</message>
@@ -10903,7 +10903,7 @@ Tell us what happened exactly before you
@@ -8076,7 +8076,7 @@
Set as default
</message>
- <if expr="is_linux and not chromeos">
+ <if expr="is_linux or is_bsd and not chromeos">
<message name="IDS_SHOW_WINDOW_DECORATIONS_MENU" desc="The menu entry text in the tab strip context menu. This toggles the system title bar and window borders (window decorations) on linux.">
Use system title bar and borders
+ <if expr="is_posix and not chromeos">
<message name="IDS_MINIMIZE_WINDOW_MENU" desc="The Linux browser window menu item text for minimizing the window.">
Minimize
</message>

View File

@ -1,11 +1,11 @@
--- chrome/app/google_chrome_strings.grd.orig 2017-04-24 14:40:26 UTC
+++ chrome/app/google_chrome_strings.grd
@@ -892,7 +892,7 @@ Signing in anyway will merge Chrome info
--- chrome/app/google_chrome_strings.grd.orig 2017-09-05 21:05:12.000000000 +0200
+++ chrome/app/google_chrome_strings.grd 2017-09-07 19:16:11.038110000 +0200
@@ -917,7 +917,7 @@
</message>
<!-- ProcessSingleton -->
- <if expr="is_linux or is_macosx">
+ <if expr="is_linux or is_macosx or is_bsd">
+ <if expr="is_linux or is_macosx or is_posix">
<message name="IDS_PROFILE_IN_USE_POSIX" desc="Message shown when the browser cannot start because the profile is in use on a different host.">
The profile appears to be in use by another Google Chrome process (<ph name="PROCESS_ID">$1<ex>12345</ex></ph>) on another computer (<ph name="HOST_NAME">$2<ex>example.com</ex></ph>). Chrome has locked the profile so that it doesn't get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chrome.
</message>

View File

@ -1,11 +0,0 @@
--- chrome/app/mash/mash_runner.cc.orig 2017-04-19 19:06:28 UTC
+++ chrome/app/mash/mash_runner.cc
@@ -263,7 +263,7 @@ int MashMain() {
// TODO(sky): wire this up correctly.
service_manager::InitializeLogging();
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
base::AtExitManager exit_manager;
#endif

View File

@ -1,11 +0,0 @@
--- chrome/app/resources/locale_settings.grd.orig 2017-04-19 19:06:29 UTC
+++ chrome/app/resources/locale_settings.grd
@@ -151,7 +151,7 @@
55
</message>
- <if expr="is_win or is_linux or chromeos">
+ <if expr="is_win or is_linux or chromeos or is_bsd">
<!-- The width of the ash/ChromeOS system tray menu in pixels. -->
<message name="IDS_SYSTEM_TRAY_MENU_BUBBLE_WIDTH_PIXELS" use_name_for_id="true">
300

Some files were not shown because too many files have changed in this diff Show More