diff --git a/srcpkgs/qt5-webengine/files/sndio-files/audio_manager_openbsd.cc b/srcpkgs/qt5-webengine/files/sndio-files/audio_manager_openbsd.cc new file mode 100644 index 00000000000..2c7aa8efa66 --- /dev/null +++ b/srcpkgs/qt5-webengine/files/sndio-files/audio_manager_openbsd.cc @@ -0,0 +1,148 @@ +// Copyright (c) 2012 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. + +#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" +#include "media/audio/sndio/sndio_input.h" +#include "media/audio/sndio/sndio_output.h" +#include "media/base/limits.h" +#include "media/base/media_switches.h" + +namespace media { + +// Maximum number of output streams that can be open simultaneously. +static const int kMaxOutputStreams = 4; + +// Default sample rate for input and output streams. +static const int kDefaultSampleRate = 48000; + +void AddDefaultDevice(AudioDeviceNames* device_names) { + DCHECK(device_names->empty()); + device_names->push_front(AudioDeviceName::CreateDefault()); +} + +bool AudioManagerOpenBSD::HasAudioOutputDevices() { + return true; +} + +bool AudioManagerOpenBSD::HasAudioInputDevices() { + return true; +} + +void AudioManagerOpenBSD::GetAudioInputDeviceNames( + AudioDeviceNames* device_names) { + DCHECK(device_names->empty()); + AddDefaultDevice(device_names); +} + +void AudioManagerOpenBSD::GetAudioOutputDeviceNames( + AudioDeviceNames* device_names) { + AddDefaultDevice(device_names); +} + +const char* AudioManagerOpenBSD::GetName() { + return "SNDIO"; +} + +AudioParameters AudioManagerOpenBSD::GetInputStreamParameters( + const std::string& device_id) { + static const int kDefaultInputBufferSize = 1024; + + int user_buffer_size = GetUserBufferSize(); + int buffer_size = user_buffer_size ? + user_buffer_size : kDefaultInputBufferSize; + + return AudioParameters( + AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO, + kDefaultSampleRate, buffer_size); +} + +AudioManagerOpenBSD::AudioManagerOpenBSD(std::unique_ptr audio_thread, + AudioLogFactory* audio_log_factory) + : AudioManagerBase(std::move(audio_thread), + audio_log_factory) { + DLOG(WARNING) << "AudioManagerOpenBSD"; + SetMaxOutputStreamsAllowed(kMaxOutputStreams); +} + +AudioManagerOpenBSD::~AudioManagerOpenBSD() { + Shutdown(); +} + +AudioOutputStream* AudioManagerOpenBSD::MakeLinearOutputStream( + const AudioParameters& params, + const LogCallback& log_callback) { + DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); + return MakeOutputStream(params); +} + +AudioOutputStream* AudioManagerOpenBSD::MakeLowLatencyOutputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) { + DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; + DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); + return MakeOutputStream(params); +} + +AudioInputStream* AudioManagerOpenBSD::MakeLinearInputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) { + DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); + return MakeInputStream(params); +} + +AudioInputStream* AudioManagerOpenBSD::MakeLowLatencyInputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) { + DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); + return MakeInputStream(params); +} + +AudioParameters AudioManagerOpenBSD::GetPreferredOutputStreamParameters( + const std::string& output_device_id, + const AudioParameters& input_params) { + // TODO(tommi): Support |output_device_id|. + DLOG_IF(ERROR, !output_device_id.empty()) << "Not implemented!"; + static const int kDefaultOutputBufferSize = 2048; + + ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO; + int sample_rate = kDefaultSampleRate; + int buffer_size = kDefaultOutputBufferSize; + if (input_params.IsValid()) { + sample_rate = input_params.sample_rate(); + channel_layout = input_params.channel_layout(); + buffer_size = std::min(buffer_size, input_params.frames_per_buffer()); + } + + int user_buffer_size = GetUserBufferSize(); + if (user_buffer_size) + buffer_size = user_buffer_size; + + return AudioParameters( + AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, + sample_rate, buffer_size); +} + +AudioInputStream* AudioManagerOpenBSD::MakeInputStream( + const AudioParameters& params) { + DLOG(WARNING) << "MakeInputStream"; + return new SndioAudioInputStream(this, + AudioDeviceDescription::kDefaultDeviceId, params); +} + +AudioOutputStream* AudioManagerOpenBSD::MakeOutputStream( + const AudioParameters& params) { + DLOG(WARNING) << "MakeOutputStream"; + return new SndioAudioOutputStream(params, this); +} + +} // namespace media diff --git a/srcpkgs/qt5-webengine/files/sndio-files/audio_manager_openbsd.h b/srcpkgs/qt5-webengine/files/sndio-files/audio_manager_openbsd.h new file mode 100644 index 00000000000..8c99db966d6 --- /dev/null +++ b/srcpkgs/qt5-webengine/files/sndio-files/audio_manager_openbsd.h @@ -0,0 +1,65 @@ +// Copyright (c) 2012 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. + +#ifndef MEDIA_AUDIO_OPENBSD_AUDIO_MANAGER_OPENBSD_H_ +#define MEDIA_AUDIO_OPENBSD_AUDIO_MANAGER_OPENBSD_H_ + +#include + +#include "base/compiler_specific.h" +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "base/threading/thread.h" +#include "media/audio/audio_manager_base.h" + +namespace media { + +class MEDIA_EXPORT AudioManagerOpenBSD : public AudioManagerBase { + public: + AudioManagerOpenBSD(std::unique_ptr audio_thread, + AudioLogFactory* audio_log_factory); + ~AudioManagerOpenBSD() override; + + // Implementation of AudioManager. + bool HasAudioOutputDevices() override; + bool HasAudioInputDevices() override; + void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; + void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override; + AudioParameters GetInputStreamParameters( + const std::string& device_id) override; + const char* GetName() override; + + // Implementation of AudioManagerBase. + AudioOutputStream* MakeLinearOutputStream( + const AudioParameters& params, + const LogCallback& log_callback) override; + AudioOutputStream* MakeLowLatencyOutputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) override; + AudioInputStream* MakeLinearInputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) override; + AudioInputStream* MakeLowLatencyInputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) override; + + protected: + AudioParameters GetPreferredOutputStreamParameters( + const std::string& output_device_id, + const AudioParameters& input_params) override; + + private: + // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream. + AudioOutputStream* MakeOutputStream(const AudioParameters& params); + AudioInputStream* MakeInputStream(const AudioParameters& params); + + DISALLOW_COPY_AND_ASSIGN(AudioManagerOpenBSD); +}; + +} // namespace media + +#endif // MEDIA_AUDIO_OPENBSD_AUDIO_MANAGER_OPENBSD_H_ diff --git a/srcpkgs/qt5-webengine/files/sndio-files/sndio_input.cc b/srcpkgs/qt5-webengine/files/sndio-files/sndio_input.cc new file mode 100644 index 00000000000..6c7bc8b8025 --- /dev/null +++ b/srcpkgs/qt5-webengine/files/sndio-files/sndio_input.cc @@ -0,0 +1,201 @@ +// Copyright 2013 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. + +#include "base/bind.h" +#include "base/logging.h" +#include "base/macros.h" +#include "base/message_loop/message_loop.h" +#include "media/base/audio_timestamp_helper.h" +#include "media/audio/openbsd/audio_manager_openbsd.h" +#include "media/audio/audio_manager.h" +#include "media/audio/sndio/sndio_input.h" + +namespace media { + +static const SampleFormat kSampleFormat = kSampleFormatS16; + +void SndioAudioInputStream::OnMoveCallback(void *arg, int delta) +{ + SndioAudioInputStream* self = static_cast(arg); + + self->hw_delay += delta; +} + +void *SndioAudioInputStream::ThreadEntry(void *arg) { + SndioAudioInputStream* self = static_cast(arg); + + self->ThreadLoop(); + return NULL; +} + +SndioAudioInputStream::SndioAudioInputStream(AudioManagerBase* manager, + const std::string& device_name, + const AudioParameters& params) + : manager(manager), + params(params), + audio_bus(AudioBus::Create(params)), + state(kClosed) { +} + +SndioAudioInputStream::~SndioAudioInputStream() { + if (state != kClosed) + Close(); +} + +bool SndioAudioInputStream::Open() { + struct sio_par par; + int sig; + + if (state != kClosed) + return false; + + if (params.format() != AudioParameters::AUDIO_PCM_LINEAR && + params.format() != AudioParameters::AUDIO_PCM_LOW_LATENCY) { + LOG(WARNING) << "Unsupported audio format."; + return false; + } + + sio_initpar(&par); + par.rate = params.sample_rate(); + par.rchan = params.channels(); + par.bits = SampleFormatToBitsPerChannel(kSampleFormat); + par.bps = par.bits / 8; + par.sig = sig = par.bits != 8 ? 1 : 0; + par.le = SIO_LE_NATIVE; + par.appbufsz = params.frames_per_buffer(); + + hdl = sio_open(SIO_DEVANY, SIO_REC, 0); + + if (hdl == NULL) { + LOG(ERROR) << "Couldn't open audio device."; + return false; + } + + if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) { + LOG(ERROR) << "Couldn't set audio parameters."; + goto bad_close; + } + + if (par.rate != (unsigned int)params.sample_rate() || + par.rchan != (unsigned int)params.channels() || + par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) || + par.sig != (unsigned int)sig || + (par.bps > 1 && par.le != SIO_LE_NATIVE) || + (par.bits != par.bps * 8)) { + LOG(ERROR) << "Unsupported audio parameters."; + goto bad_close; + } + state = kStopped; + buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)]; + sio_onmove(hdl, &OnMoveCallback, this); + return true; +bad_close: + sio_close(hdl); + return false; +} + +void SndioAudioInputStream::Start(AudioInputCallback* cb) { + + StartAgc(); + + state = kRunning; + hw_delay = 0; + callback = cb; + sio_start(hdl); + if (pthread_create(&thread, NULL, &ThreadEntry, this) != 0) { + LOG(ERROR) << "Failed to create real-time thread for recording."; + sio_stop(hdl); + state = kStopped; + } +} + +void SndioAudioInputStream::Stop() { + + if (state == kStopped) + return; + + state = kStopWait; + pthread_join(thread, NULL); + sio_stop(hdl); + state = kStopped; + + StopAgc(); +} + +void SndioAudioInputStream::Close() { + + if (state == kClosed) + return; + + if (state == kRunning) + Stop(); + + state = kClosed; + delete [] buffer; + sio_close(hdl); + + manager->ReleaseInputStream(this); +} + +double SndioAudioInputStream::GetMaxVolume() { + // Not supported + return 0.0; +} + +void SndioAudioInputStream::SetVolume(double volume) { + // Not supported. Do nothing. +} + +double SndioAudioInputStream::GetVolume() { + // Not supported. + return 0.0; +} + +bool SndioAudioInputStream::IsMuted() { + // Not supported. + return false; +} + +void SndioAudioInputStream::SetOutputDeviceForAec( + const std::string& output_device_id) { + // Not supported. +} + +void SndioAudioInputStream::ThreadLoop(void) { + size_t todo, n; + char *data; + unsigned int nframes; + double normalized_volume = 0.0; + + nframes = audio_bus->frames(); + + while (state == kRunning && !sio_eof(hdl)) { + + GetAgcVolume(&normalized_volume); + + // read one block + todo = nframes * params.GetBytesPerFrame(kSampleFormat); + data = buffer; + while (todo > 0) { + n = sio_read(hdl, data, todo); + if (n == 0) + return; // unrecoverable I/O error + todo -= n; + data += n; + } + hw_delay -= nframes; + + // convert frames count to TimeDelta + const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay, + params.sample_rate()); + + // push into bus + audio_bus->FromInterleaved(buffer, nframes, SampleFormatToBytesPerChannel(kSampleFormat)); + + // invoke callback + callback->OnData(audio_bus.get(), base::TimeTicks::Now() - delay, 1.); + } +} + +} // namespace media diff --git a/srcpkgs/qt5-webengine/files/sndio-files/sndio_input.h b/srcpkgs/qt5-webengine/files/sndio-files/sndio_input.h new file mode 100644 index 00000000000..d868e0469db --- /dev/null +++ b/srcpkgs/qt5-webengine/files/sndio-files/sndio_input.h @@ -0,0 +1,91 @@ +// Copyright 2013 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. + +#ifndef MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_ +#define MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_ + +#include +#include +#include + +#include "base/compiler_specific.h" +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "base/time/time.h" +#include "media/audio/agc_audio_stream.h" +#include "media/audio/audio_io.h" +#include "media/audio/audio_device_description.h" +#include "media/base/audio_parameters.h" + +namespace media { + +class AudioManagerBase; + +// Implementation of AudioOutputStream using sndio(7) +class SndioAudioInputStream : public AgcAudioStream { + public: + // Pass this to the constructor if you want to attempt auto-selection + // of the audio recording device. + static const char kAutoSelectDevice[]; + + // Create a PCM Output stream for the SNDIO device identified by + // |device_name|. If unsure of what to use for |device_name|, use + // |kAutoSelectDevice|. + SndioAudioInputStream(AudioManagerBase* audio_manager, + const std::string& device_name, + const AudioParameters& params); + + ~SndioAudioInputStream() override; + + // Implementation of AudioInputStream. + bool Open() override; + void Start(AudioInputCallback* callback) override; + void Stop() override; + void Close() override; + double GetMaxVolume() override; + void SetVolume(double volume) override; + double GetVolume() override; + bool IsMuted() override; + void SetOutputDeviceForAec(const std::string& output_device_id) override; + + private: + + enum StreamState { + kClosed, // Not opened yet + kStopped, // Device opened, but not started yet + kRunning, // Started, device playing + kStopWait // Stopping, waiting for the real-time thread to exit + }; + + // C-style call-backs + static void OnMoveCallback(void *arg, int delta); + static void* ThreadEntry(void *arg); + + // Continuously moves data from the device to the consumer + void ThreadLoop(); + // Our creator, the audio manager needs to be notified when we close. + AudioManagerBase* manager; + // Parameters of the source + AudioParameters params; + // We store data here for consumer + std::unique_ptr audio_bus; + // Call-back that consumes recorded data + AudioInputCallback* callback; // Valid during a recording session. + // Handle of the audio device + struct sio_hdl* hdl; + // Current state of the stream + enum StreamState state; + // High priority thread running ThreadLoop() + pthread_t thread; + // Number of frames buffered in the hardware + int hw_delay; + // Temporary buffer where data is stored sndio-compatible format + char* buffer; + + DISALLOW_COPY_AND_ASSIGN(SndioAudioInputStream); +}; + +} // namespace media + +#endif // MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_ diff --git a/srcpkgs/qt5-webengine/files/sndio-files/sndio_output.cc b/srcpkgs/qt5-webengine/files/sndio-files/sndio_output.cc new file mode 100644 index 00000000000..a6719f9aac8 --- /dev/null +++ b/srcpkgs/qt5-webengine/files/sndio-files/sndio_output.cc @@ -0,0 +1,183 @@ +// Copyright (c) 2012 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. + +#include "base/logging.h" +#include "base/time/time.h" +#include "base/time/default_tick_clock.h" +#include "media/audio/audio_manager_base.h" +#include "media/base/audio_timestamp_helper.h" +#include "media/audio/sndio/sndio_output.h" + +namespace media { + +static const SampleFormat kSampleFormat = kSampleFormatS16; + +void SndioAudioOutputStream::OnMoveCallback(void *arg, int delta) { + SndioAudioOutputStream* self = static_cast(arg); + + self->hw_delay -= delta; +} + +void SndioAudioOutputStream::OnVolCallback(void *arg, unsigned int vol) { + SndioAudioOutputStream* self = static_cast(arg); + + self->vol = vol; +} + +void *SndioAudioOutputStream::ThreadEntry(void *arg) { + SndioAudioOutputStream* self = static_cast(arg); + + self->ThreadLoop(); + return NULL; +} + +SndioAudioOutputStream::SndioAudioOutputStream(const AudioParameters& params, + AudioManagerBase* manager) + : manager(manager), + params(params), + audio_bus(AudioBus::Create(params)), + state(kClosed), + mutex(PTHREAD_MUTEX_INITIALIZER) { +} + +SndioAudioOutputStream::~SndioAudioOutputStream() { + if (state != kClosed) + Close(); +} + +bool SndioAudioOutputStream::Open() { + struct sio_par par; + int sig; + + if (params.format() != AudioParameters::AUDIO_PCM_LINEAR && + params.format() != AudioParameters::AUDIO_PCM_LOW_LATENCY) { + LOG(WARNING) << "Unsupported audio format."; + return false; + } + sio_initpar(&par); + par.rate = params.sample_rate(); + par.pchan = params.channels(); + par.bits = SampleFormatToBitsPerChannel(kSampleFormat); + par.bps = par.bits / 8; + par.sig = sig = par.bits != 8 ? 1 : 0; + par.le = SIO_LE_NATIVE; + par.appbufsz = params.frames_per_buffer(); + + hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0); + if (hdl == NULL) { + LOG(ERROR) << "Couldn't open audio device."; + return false; + } + if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) { + LOG(ERROR) << "Couldn't set audio parameters."; + goto bad_close; + } + if (par.rate != (unsigned int)params.sample_rate() || + par.pchan != (unsigned int)params.channels() || + par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) || + par.sig != (unsigned int)sig || + (par.bps > 1 && par.le != SIO_LE_NATIVE) || + (par.bits != par.bps * 8)) { + LOG(ERROR) << "Unsupported audio parameters."; + goto bad_close; + } + state = kStopped; + volpending = 0; + vol = 0; + buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)]; + sio_onmove(hdl, &OnMoveCallback, this); + sio_onvol(hdl, &OnVolCallback, this); + return true; + bad_close: + sio_close(hdl); + return false; +} + +void SndioAudioOutputStream::Close() { + if (state == kClosed) + return; + if (state == kRunning) + Stop(); + state = kClosed; + delete [] buffer; + sio_close(hdl); + manager->ReleaseOutputStream(this); // Calls the destructor +} + +void SndioAudioOutputStream::Start(AudioSourceCallback* callback) { + state = kRunning; + hw_delay = 0; + source = callback; + sio_start(hdl); + if (pthread_create(&thread, NULL, &ThreadEntry, this) != 0) { + LOG(ERROR) << "Failed to create real-time thread."; + sio_stop(hdl); + state = kStopped; + } +} + +void SndioAudioOutputStream::Stop() { + if (state == kStopped) + return; + state = kStopWait; + pthread_join(thread, NULL); + sio_stop(hdl); + state = kStopped; +} + +void SndioAudioOutputStream::SetVolume(double v) { + pthread_mutex_lock(&mutex); + vol = v * SIO_MAXVOL; + volpending = 1; + pthread_mutex_unlock(&mutex); +} + +void SndioAudioOutputStream::GetVolume(double* v) { + pthread_mutex_lock(&mutex); + *v = vol * (1. / SIO_MAXVOL); + pthread_mutex_unlock(&mutex); +} + +// This stream is always used with sub second buffer sizes, where it's +// sufficient to simply always flush upon Start(). +void SndioAudioOutputStream::Flush() {} + +void SndioAudioOutputStream::ThreadLoop(void) { + int avail, count, result; + + while (state == kRunning) { + // Update volume if needed + pthread_mutex_lock(&mutex); + if (volpending) { + volpending = 0; + sio_setvol(hdl, vol); + } + pthread_mutex_unlock(&mutex); + + // Get data to play + const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay, + params.sample_rate()); + count = source->OnMoreData(delay, base::TimeTicks::Now(), 0, audio_bus.get()); + audio_bus->ToInterleaved(count, SampleFormatToBytesPerChannel(kSampleFormat), buffer); + if (count == 0) { + // We have to submit something to the device + count = audio_bus->frames(); + memset(buffer, 0, count * params.GetBytesPerFrame(kSampleFormat)); + LOG(WARNING) << "No data to play, running empty cycle."; + } + + // Submit data to the device + avail = count * params.GetBytesPerFrame(kSampleFormat); + result = sio_write(hdl, buffer, avail); + if (result == 0) { + LOG(WARNING) << "Audio device disconnected."; + break; + } + + // Update hardware pointer + hw_delay += count; + } +} + +} // namespace media diff --git a/srcpkgs/qt5-webengine/files/sndio-files/sndio_output.h b/srcpkgs/qt5-webengine/files/sndio-files/sndio_output.h new file mode 100644 index 00000000000..ead220ca96e --- /dev/null +++ b/srcpkgs/qt5-webengine/files/sndio-files/sndio_output.h @@ -0,0 +1,86 @@ +// Copyright (c) 2012 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. + +#ifndef MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_ +#define MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_ + +#include +#include + +#include "base/time/tick_clock.h" +#include "base/time/time.h" +#include "media/audio/audio_io.h" + +namespace media { + +class AudioManagerBase; + +// Implementation of AudioOutputStream using sndio(7) +class SndioAudioOutputStream : public AudioOutputStream { + public: + // The manager is creating this object + SndioAudioOutputStream(const AudioParameters& params, + AudioManagerBase* manager); + virtual ~SndioAudioOutputStream(); + + // Implementation of AudioOutputStream. + bool Open() override; + void Close() override; + void Start(AudioSourceCallback* callback) override; + void Stop() override; + void SetVolume(double volume) override; + void GetVolume(double* volume) override; + void Flush() override; + + friend void sndio_onmove(void *arg, int delta); + friend void sndio_onvol(void *arg, unsigned int vol); + friend void *sndio_threadstart(void *arg); + + private: + enum StreamState { + kClosed, // Not opened yet + kStopped, // Device opened, but not started yet + kRunning, // Started, device playing + kStopWait // Stopping, waiting for the real-time thread to exit + }; + + // C-style call-backs + static void OnMoveCallback(void *arg, int delta); + static void OnVolCallback(void *arg, unsigned int vol); + static void* ThreadEntry(void *arg); + + // Continuously moves data from the producer to the device + void ThreadLoop(void); + + // Our creator, the audio manager needs to be notified when we close. + AudioManagerBase* manager; + // Parameters of the source + AudioParameters params; + // Source stores data here + std::unique_ptr audio_bus; + // Call-back that produces data to play + AudioSourceCallback* source; + // Handle of the audio device + struct sio_hdl* hdl; + // Current state of the stream + enum StreamState state; + // High priority thread running ThreadLoop() + pthread_t thread; + // Protects vol, volpending and hw_delay + pthread_mutex_t mutex; + // Current volume in the 0..SIO_MAXVOL range + int vol; + // Set to 1 if volumes must be refreshed in the realtime thread + int volpending; + // Number of frames buffered in the hardware + int hw_delay; + // Temporary buffer where data is stored sndio-compatible format + char* buffer; + + DISALLOW_COPY_AND_ASSIGN(SndioAudioOutputStream); +}; + +} // namespace media + +#endif // MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_ diff --git a/srcpkgs/qt5-webengine/files/sndio-patches/media_audio_linux_audio_manager_linux.cc.patch b/srcpkgs/qt5-webengine/files/sndio-patches/media_audio_linux_audio_manager_linux.cc.patch new file mode 100644 index 00000000000..cf8e81b11d6 --- /dev/null +++ b/srcpkgs/qt5-webengine/files/sndio-patches/media_audio_linux_audio_manager_linux.cc.patch @@ -0,0 +1,43 @@ +diff --git a/chromium/media/audio/linux/audio_manager_linux.cc b/chromium/media/audio/linux/audio_manager_linux.cc +index 5d703549372..9e60b40c749 100644 +--- media/audio/linux/audio_manager_linux.cc ++++ media/audio/linux/audio_manager_linux.cc +@@ -20,6 +20,10 @@ + #include "media/audio/pulse/audio_manager_pulse.h" + #include "media/audio/pulse/pulse_util.h" + #endif ++#if defined(USE_SNDIO) ++#include ++#include "media/audio/openbsd/audio_manager_openbsd.h" ++#endif + + namespace media { + +@@ -27,7 +31,8 @@ enum LinuxAudioIO { + kPulse, + kAlsa, + kCras, +- kAudioIOMax = kCras // Must always be equal to largest logged entry. ++ kSndio, ++ kAudioIOMax = kSndio // Must always be equal to largest logged entry. + }; + + std::unique_ptr CreateAudioManager( +@@ -41,6 +46,17 @@ std::unique_ptr CreateAudioManager( + } + #endif + ++#if defined(USE_SNDIO) ++ struct sio_hdl * hdl = NULL; ++ if ((hdl=sio_open(SIO_DEVANY, SIO_PLAY, 1)) != NULL) { ++ sio_close(hdl); ++ UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kSndio, kAudioIOMax +1); ++ return std::make_unique(std::move(audio_thread), ++ audio_log_factory); ++ } ++ DVLOG(1) << "Sndio is not available on the OS"; ++#endif ++ + #if defined(USE_PULSEAUDIO) + pa_threaded_mainloop* pa_mainloop = nullptr; + pa_context* pa_context = nullptr; diff --git a/srcpkgs/qt5-webengine/files/sndio-patches/src_3rdparty_chromium_media_BUILD.gn.patch b/srcpkgs/qt5-webengine/files/sndio-patches/src_3rdparty_chromium_media_BUILD.gn.patch new file mode 100644 index 00000000000..ec604002668 --- /dev/null +++ b/srcpkgs/qt5-webengine/files/sndio-patches/src_3rdparty_chromium_media_BUILD.gn.patch @@ -0,0 +1,12 @@ +--- media/BUILD.gn 2020-03-24 10:16:30.000000000 +0100 ++++ - 2020-04-06 14:32:27.960817513 +0200 +@@ -65,6 +65,9 @@ + if (use_cras) { + defines += [ "USE_CRAS" ] + } ++ if (use_sndio) { ++ defines += [ "USE_SNDIO" ] ++ } + } + + # Internal grouping of the configs necessary to support sub-folders having their diff --git a/srcpkgs/qt5-webengine/files/sndio-patches/src_3rdparty_chromium_media_audio_BUILD.gn.patch b/srcpkgs/qt5-webengine/files/sndio-patches/src_3rdparty_chromium_media_audio_BUILD.gn.patch new file mode 100644 index 00000000000..b3700eef898 --- /dev/null +++ b/srcpkgs/qt5-webengine/files/sndio-patches/src_3rdparty_chromium_media_audio_BUILD.gn.patch @@ -0,0 +1,23 @@ +--- media/audio/BUILD.gn 2020-03-24 10:16:30.000000000 +0100 ++++ - 2020-04-06 14:31:28.871450217 +0200 +@@ -232,9 +232,19 @@ + deps += [ "//media/base/android:media_jni_headers" ] + } + +- if (is_linux) { ++ if (is_linux && use_sndio) { + sources += [ "linux/audio_manager_linux.cc" ] + } ++ if (use_sndio) { ++ libs += [ "sndio" ] ++ sources += [ ++ "openbsd/audio_manager_openbsd.cc", ++ "sndio/sndio_input.cc", ++ "sndio/sndio_input.h", ++ "sndio/sndio_output.cc", ++ "sndio/sndio_output.h" ++ ] ++ } + + if (use_alsa) { + libs += [ "asound" ] diff --git a/srcpkgs/qt5-webengine/files/sndio-patches/src_3rdparty_chromium_media_media__options.gni.patch b/srcpkgs/qt5-webengine/files/sndio-patches/src_3rdparty_chromium_media_media__options.gni.patch new file mode 100644 index 00000000000..14807d8e1d3 --- /dev/null +++ b/srcpkgs/qt5-webengine/files/sndio-patches/src_3rdparty_chromium_media_media__options.gni.patch @@ -0,0 +1,12 @@ +--- media/media_options.gni 2020-03-24 10:16:30.000000000 +0100 ++++ - 2020-04-06 14:29:22.958630783 +0200 +@@ -114,6 +114,9 @@ + # Enables runtime selection of ALSA library for audio. + use_alsa = false + ++ # Enables runtime selection of sndio library for audio. ++ use_sndio = false ++ + # Alsa should be used on non-Android, non-Mac POSIX systems. + # Alsa should be used on desktop Chromecast and audio-only Chromecast builds. + if (is_posix && !is_android && !is_mac && diff --git a/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch b/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch index c332b92b69d..b47e3774bbc 100644 --- a/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch +++ b/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch @@ -18,8 +18,8 @@ #endif MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc"); ---- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc 2017-11-28 14:06:53.000000000 +0100 -+++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc 2018-01-27 20:48:11.571040348 +0100 +--- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc 2020-03-26 22:17:18.000000000 +0100 +++++ - 2020-04-08 13:30:26.065577091 +0200 @@ -100,14 +100,14 @@ malloc_statistics_t stats = {0}; malloc_zone_statistics(nullptr, &stats); @@ -27,7 +27,7 @@ -#elif defined(OS_LINUX) || defined(OS_ANDROID) +#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID) struct mallinfo minfo = mallinfo(); - #if defined(USE_TCMALLOC) + #if BUILDFLAG(USE_TCMALLOC) return minfo.uordblks; #else return minfo.hblkhd + minfo.arena; diff --git a/srcpkgs/qt5-webengine/patches/0090-chromium-ppc64le.patch b/srcpkgs/qt5-webengine/patches/0090-qtwebengine-ppc64.patch similarity index 92% rename from srcpkgs/qt5-webengine/patches/0090-chromium-ppc64le.patch rename to srcpkgs/qt5-webengine/patches/0090-qtwebengine-ppc64.patch index 1874dfe2715..72915459454 100644 --- a/srcpkgs/qt5-webengine/patches/0090-chromium-ppc64le.patch +++ b/srcpkgs/qt5-webengine/patches/0090-qtwebengine-ppc64.patch @@ -1,31 +1,25 @@ -From 50f6a674ca5e77165f2e6801520d73a9ce3829cd Mon Sep 17 00:00:00 2001 -From: q66 -Date: Sun, 19 Jan 2020 00:17:36 +0100 -Subject: [PATCH 2/3] WebEngine support for ppc64le architecture +From b3539b877c1f0e65ef692962c416974c42799031 Mon Sep 17 00:00:00 2001 +From: Georgy Yakovlev +Date: Wed, 27 May 2020 03:00:22 -0700 +Subject: [PATCH 1/3] ppc64 patchset -This is a base patch that adds support for little endian ppc64 -with glibc. Big endian and musl support is added in extra patches -after that. - -Ping q66 if you're updating qt5 and this does not apply anymore. - -Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium -Upstream: Currently being submitted --- - .../build/download_nacl_toolchains.py | 4 + + .../chromium/chrome/installer/linux/BUILD.gn | 3 - + .../media/gpu/vaapi/vaapi_picture_tfp.cc | 2 +- src/3rdparty/chromium/sandbox/features.gni | 2 +- src/3rdparty/chromium/sandbox/linux/BUILD.gn | 2 + .../linux/bpf_dsl/linux_syscall_ranges.h | 7 + .../sandbox/linux/bpf_dsl/seccomp_macros.h | 48 ++ .../seccomp-bpf-helpers/baseline_policy.cc | 10 +- - .../baseline_policy_unittest.cc | 2 +- - .../syscall_parameters_restrictions.cc | 24 +- + .../baseline_policy_unittest.cc | 2 + + .../syscall_parameters_restrictions.cc | 38 +- .../syscall_parameters_restrictions.h | 2 +- - .../linux/seccomp-bpf-helpers/syscall_sets.cc | 121 +-- - .../linux/seccomp-bpf-helpers/syscall_sets.h | 8 +- + .../linux/seccomp-bpf-helpers/syscall_sets.cc | 132 +-- + .../linux/seccomp-bpf-helpers/syscall_sets.h | 11 +- .../sandbox/linux/seccomp-bpf/syscall.cc | 62 +- .../sandbox/linux/seccomp-bpf/trap.cc | 14 + .../sandbox/linux/services/credentials.cc | 2 +- + .../linux/services/syscall_wrappers.cc | 2 +- .../linux/syscall_broker/broker_process.cc | 2 +- .../linux/system_headers/linux_seccomp.h | 9 + .../linux/system_headers/linux_signal.h | 2 +- @@ -34,6 +28,7 @@ Upstream: Currently being submitted .../system_headers/ppc64_linux_syscalls.h | 12 + .../system_headers/ppc64_linux_ucontext.h | 12 + .../linux/bpf_renderer_policy_linux.cc | 5 + + .../angle/src/compiler/translator/InfoSink.h | 11 +- .../angle/src/libANGLE/Constants.h | 1 + .../chromium/third_party/boringssl/BUILD.gn | 7 + .../dump_writer_common/raw_context_cpu.h | 2 + @@ -92,46 +87,64 @@ Upstream: Currently being submitted .../util/misc/capture_context_test.cc | 2 +- .../misc/capture_context_test_util_linux.cc | 6 + .../crashpad/util/posix/signals_test.cc | 12 +- - .../chromium/third_party/dav1d/BUILD.gn | 17 + + .../chromium/third_party/dav1d/BUILD.gn | 21 + .../dav1d/config/linux/ppc64/config.h | 35 + + .../third_party/dav1d/dav1d_generated.gni | 5 + + .../third_party/dav1d/generate_source.py | 3 +- + .../dav1d/libdav1d/src/ppc/types.h | 15 + .../chromium/third_party/libdrm/src/xf86drm.c | 4 +- .../chromium/third_party/libpng/BUILD.gn | 5 + .../libpng/powerpc/filter_vsx_intrinsics.c | 767 ++++++++++++++++++ .../third_party/libpng/powerpc/powerpc_init.c | 125 +++ .../third_party/lss/linux_syscall_support.h | 4 +- .../chromium/third_party/node/node.py | 11 +- - .../page_allocator_constants.h | 6 +- - .../partition_alloc_constants.h | 2 + .../chromium/third_party/pffft/src/pffft.c | 1 + - .../third_party/sqlite/amalgamation/sqlite3.c | 9 +- - .../sqlite/patched/ext/rtree/rtree.c | 4 +- - .../sqlite/patched/src/sqliteInt.h | 5 +- + .../third_party/skia/src/sksl/SkSLString.cpp | 7 +- + .../third_party/sqlite/amalgamation/sqlite3.c | 3 +- .../modules/desktop_capture/differ_block.cc | 10 +- .../third_party/webrtc/rtc_base/system/arch.h | 12 + src/3rdparty/chromium/v8/BUILD.gn | 6 + - src/3rdparty/chromium/v8/test/BUILD.gn | 16 +- - 99 files changed, 2423 insertions(+), 144 deletions(-) + 100 files changed, 2450 insertions(+), 141 deletions(-) create mode 100644 src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_syscalls.h create mode 100644 src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_ucontext.h create mode 100644 src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h create mode 100644 src/3rdparty/chromium/third_party/libpng/powerpc/filter_vsx_intrinsics.c create mode 100644 src/3rdparty/chromium/third_party/libpng/powerpc/powerpc_init.c -diff --git a/src/3rdparty/chromium/build/download_nacl_toolchains.py b/src/3rdparty/chromium/build/download_nacl_toolchains.py -index 286a92a27..ec36a85d3 100755 ---- a/src/3rdparty/chromium/build/download_nacl_toolchains.py -+++ b/src/3rdparty/chromium/build/download_nacl_toolchains.py -@@ -13,6 +13,10 @@ import sys +diff --git a/src/3rdparty/chromium/chrome/installer/linux/BUILD.gn b/src/3rdparty/chromium/chrome/installer/linux/BUILD.gn +index 64ba93f44..0cb3d1623 100644 +--- a/src/3rdparty/chromium/chrome/installer/linux/BUILD.gn ++++ b/src/3rdparty/chromium/chrome/installer/linux/BUILD.gn +@@ -62,8 +62,6 @@ packaging_files = packaging_files_binaries + [ + "$root_out_dir/xdg-mime", + "$root_out_dir/xdg-settings", + "$root_out_dir/locales/en-US.pak", +- "$root_out_dir/MEIPreload/manifest.json", +- "$root_out_dir/MEIPreload/preloaded_data.pb", + ] + action_foreach("calculate_deb_dependencies") { +@@ -350,7 +348,6 @@ group("installer_deps") { + ":theme_files", + "//chrome", + "//chrome:packed_resources", +- "//chrome/browser/resources/media/mei_preload:component", + "//sandbox/linux:chrome_sandbox", + "//third_party/crashpad/crashpad/handler:crashpad_handler", + ] +diff --git a/src/3rdparty/chromium/media/gpu/vaapi/vaapi_picture_tfp.cc b/src/3rdparty/chromium/media/gpu/vaapi/vaapi_picture_tfp.cc +index f65d580da..abd9aa969 100644 +--- a/src/3rdparty/chromium/media/gpu/vaapi/vaapi_picture_tfp.cc ++++ b/src/3rdparty/chromium/media/gpu/vaapi/vaapi_picture_tfp.cc +@@ -55,7 +55,7 @@ bool VaapiTFPPicture::Initialize() { + if (make_context_current_cb_ && !make_context_current_cb_.Run()) + return false; - def Main(args): -+ # If `disable_nacl=1` is in GYP_DEFINES, exit -+ if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''): -+ return 0 -+ - script_dir = os.path.dirname(os.path.abspath(__file__)) - src_dir = os.path.dirname(script_dir) - nacl_dir = os.path.join(src_dir, 'native_client') +- glx_image_ = new gl::GLImageGLX(size_, GL_RGB); ++ glx_image_ = new gl::GLImageGLX(size_, gfx::BufferFormat::BGRX_8888); + if (!glx_image_->Initialize(x_pixmap_)) { + // x_pixmap_ will be freed in the destructor. + DLOG(ERROR) << "Failed creating a GLX Pixmap for TFP"; diff --git a/src/3rdparty/chromium/sandbox/features.gni b/src/3rdparty/chromium/sandbox/features.gni index 89693c54c..6017c7eea 100644 --- a/src/3rdparty/chromium/sandbox/features.gni @@ -158,11 +171,11 @@ index b00a88cfa..b3e55d5cb 100644 "system_headers/arm_linux_syscalls.h", "system_headers/arm_linux_ucontext.h", diff --git a/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h b/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h -index 73c26c4ba..e312589dc 100644 +index 313511f22..0ca3a326f 100644 --- a/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h +++ b/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h -@@ -55,6 +55,13 @@ - #define MAX_PUBLIC_SYSCALL 279u +@@ -56,6 +56,13 @@ + #define MAX_PUBLIC_SYSCALL __NR_syscalls #define MAX_SYSCALL MAX_PUBLIC_SYSCALL +#elif defined(__powerpc64__) @@ -242,7 +255,7 @@ index 1a407b952..a6aec544e 100644 #error Unsupported target platform diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc -index 806d13c1a..f7f59621a 100644 +index 768025ce1..e436910c0 100644 --- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc @@ -88,7 +88,8 @@ bool IsBaselinePolicyWatched(int sysno) { @@ -284,20 +297,22 @@ index 806d13c1a..f7f59621a 100644 return RestrictSocketcallCommand(); #endif diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc -index 060181bd4..abb323f5e 100644 +index 41fdde3bf..7a38e73c0 100644 --- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc +++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc -@@ -287,7 +287,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo) - TEST_BASELINE_SIGSYS(__NR_syslog) - TEST_BASELINE_SIGSYS(__NR_timer_create) - --#if !defined(__aarch64__) -+#if !defined(__aarch64__) && !defined(__powerpc64__) +@@ -291,8 +291,10 @@ TEST_BASELINE_SIGSYS(__NR_timer_create) + #if !defined(__aarch64__) TEST_BASELINE_SIGSYS(__NR_eventfd) TEST_BASELINE_SIGSYS(__NR_inotify_init) ++#if !defined(__powerpc64__) TEST_BASELINE_SIGSYS(__NR_vserver) + #endif ++#endif + + #if defined(LIBC_GLIBC) && !defined(OS_CHROMEOS) + BPF_TEST_C(BaselinePolicy, FutexEINVAL, BaselinePolicy) { diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc -index be8225987..d21c24bf0 100644 +index d9789a713..6ff40c9b0 100644 --- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc @@ -36,7 +36,8 @@ @@ -305,8 +320,8 @@ index be8225987..d21c24bf0 100644 #include #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \ - !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA) -+ !defined(__aarch64__) && !defined(__powerpc64__) && \ -+ !defined(PTRACE_GET_THREAD_AREA) ++ !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA) && \ ++ !defined(__powerpc64__) // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA. // asm/ptrace-abi.h doesn't exist on arm32 and PTRACE_GET_THREAD_AREA isn't @@ -338,7 +353,7 @@ index be8225987..d21c24bf0 100644 // Ubuntu's version of glibc has a race condition in sem_post that can cause // it to call futex(2) with bogus op arguments. To workaround this, we need // to allow those futex(2) calls to fail with EINVAL, instead of crashing the -@@ -257,7 +272,8 @@ ResultExpr RestrictFcntlCommands() { +@@ -246,9 +261,11 @@ ResultExpr RestrictFcntlCommands() { // operator. // Glibc overrides the kernel's O_LARGEFILE value. Account for this. uint64_t kOLargeFileFlag = O_LARGEFILE; @@ -347,8 +362,29 @@ index be8225987..d21c24bf0 100644 + || IsArchitecturePPC64()) kOLargeFileFlag = 0100000; ++ const Arg cmd(1); -@@ -280,7 +296,7 @@ ResultExpr RestrictFcntlCommands() { + const Arg long_arg(2); + +@@ -262,14 +279,23 @@ ResultExpr RestrictFcntlCommands() { + F_SETLKW, + F_GETLK, + F_DUPFD, +- F_DUPFD_CLOEXEC), +- Allow()) ++ F_DUPFD_CLOEXEC ++#if defined(__powerpc64__) ++// On PPC64, F_SETLK, F_GETLK, F_SETLKW are defined as the 64-bit variants ++// but glibc will sometimes still use the 32-bit versions. Allow both. ++ , ++ 5, /* F_GETLK (32) */ ++ 6, /* F_SETLK (32) */ ++ 7 /* F_SETLKW (32) */ ++#endif ++ ), ++ Allow()) + .Case(F_SETFL, + If((long_arg & ~kAllowedMask) == 0, Allow()).Else(CrashSIGSYS())) .Default(CrashSIGSYS()); } @@ -357,7 +393,7 @@ index be8225987..d21c24bf0 100644 ResultExpr RestrictSocketcallCommand() { // Unfortunately, we are unable to restrict the first parameter to // socketpair(2). Whilst initially sounding bad, it's noteworthy that very -@@ -421,7 +437,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) { +@@ -409,7 +435,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) { ResultExpr RestrictPtrace() { const Arg request(0); return Switch(request).CASES(( @@ -367,7 +403,7 @@ index be8225987..d21c24bf0 100644 PTRACE_GETFPREGS, PTRACE_GET_THREAD_AREA, diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h -index cb563dfc5..2b17800d4 100644 +index 15442892b..50fa559f3 100644 --- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h +++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h @@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags(); @@ -380,7 +416,7 @@ index cb563dfc5..2b17800d4 100644 // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2). SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand(); diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc -index 525e40a83..82081a7b3 100644 +index d9d18822f..4ce4263ff 100644 --- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc @@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) { @@ -393,7 +429,14 @@ index 525e40a83..82081a7b3 100644 case __NR_time: #endif return true; -@@ -45,7 +46,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) { +@@ -41,12 +42,14 @@ bool SyscallSets::IsAllowedGettime(int sysno) { + case __NR_clock_nanosleep: // Parameters filtered by RestrictClockID(). + case __NR_clock_settime: // Privileged. + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_ftime: // Obsolete. #endif case __NR_settimeofday: // Privileged. #if defined(__i386__) || \ @@ -403,7 +446,7 @@ index 525e40a83..82081a7b3 100644 case __NR_stime: #endif default: -@@ -111,7 +113,7 @@ bool SyscallSets::IsFileSystem(int sysno) { +@@ -112,7 +115,7 @@ bool SyscallSets::IsFileSystem(int sysno) { case __NR_faccessat: // EPERM not a valid errno. case __NR_fchmodat: case __NR_fchownat: // Should be called chownat ? @@ -412,7 +455,7 @@ index 525e40a83..82081a7b3 100644 case __NR_newfstatat: // fstatat(). EPERM not a valid errno. #elif defined(__i386__) || defined(__arm__) || \ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) -@@ -130,7 +132,7 @@ bool SyscallSets::IsFileSystem(int sysno) { +@@ -131,7 +134,7 @@ bool SyscallSets::IsFileSystem(int sysno) { case __NR_memfd_create: case __NR_mkdirat: case __NR_mknodat: @@ -421,7 +464,17 @@ index 525e40a83..82081a7b3 100644 case __NR_oldlstat: case __NR_oldstat: #endif -@@ -154,7 +156,8 @@ bool SyscallSets::IsFileSystem(int sysno) { +@@ -145,7 +148,8 @@ bool SyscallSets::IsFileSystem(int sysno) { + #endif + case __NR_statfs: // EPERM not a valid errno. + #if defined(__i386__) || defined(__arm__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_statfs64: + #endif + case __NR_symlinkat: +@@ -155,7 +159,8 @@ bool SyscallSets::IsFileSystem(int sysno) { case __NR_truncate64: #endif case __NR_unlinkat: @@ -431,7 +484,7 @@ index 525e40a83..82081a7b3 100644 case __NR_utime: #endif case __NR_utimensat: // New. -@@ -173,7 +176,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) { +@@ -174,7 +179,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) { #endif return true; // TODO(jln): these should be denied gracefully as well (moved below). @@ -441,7 +494,7 @@ index 525e40a83..82081a7b3 100644 case __NR_fadvise64: // EPERM not a valid errno. #endif #if defined(__i386__) -@@ -186,7 +190,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) { +@@ -187,11 +193,12 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) { case __NR_flock: // EPERM not a valid errno. case __NR_fstatfs: // Give information about the whole filesystem. #if defined(__i386__) || defined(__arm__) || \ @@ -451,7 +504,12 @@ index 525e40a83..82081a7b3 100644 case __NR_fstatfs64: #endif case __NR_fsync: // EPERM not a valid errno. -@@ -198,6 +203,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) { +-#if defined(__i386__) ++#if defined(__i386__) || defined(__powerpc64__) + case __NR_oldfstat: + #endif + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ +@@ -199,6 +206,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) { case __NR_sync_file_range: // EPERM not a valid errno. #elif defined(__arm__) case __NR_arm_sync_file_range: // EPERM not a valid errno. @@ -460,7 +518,7 @@ index 525e40a83..82081a7b3 100644 #endif default: return false; -@@ -223,7 +230,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) { +@@ -224,7 +233,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) { #endif case __NR_getdents64: // EPERM not a valid errno. #if defined(__i386__) || \ @@ -470,7 +528,7 @@ index 525e40a83..82081a7b3 100644 case __NR_readdir: #endif return true; -@@ -264,7 +272,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) { +@@ -265,7 +275,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) { bool SyscallSets::IsProcessPrivilegeChange(int sysno) { switch (sysno) { case __NR_capset: @@ -479,9 +537,9 @@ index 525e40a83..82081a7b3 100644 case __NR_ioperm: // Intel privilege. case __NR_iopl: // Intel privilege. #endif -@@ -314,7 +322,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) { - case __NR_rt_sigprocmask: +@@ -316,7 +326,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) { case __NR_rt_sigreturn: + case __NR_rt_sigtimedwait: #if defined(__i386__) || defined(__arm__) || \ - (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ @@ -489,7 +547,7 @@ index 525e40a83..82081a7b3 100644 case __NR_sigaction: case __NR_sigprocmask: case __NR_sigreturn: -@@ -331,7 +340,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) { +@@ -332,7 +343,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) { #endif case __NR_signalfd4: #if defined(__i386__) || defined(__arm__) || \ @@ -499,7 +557,7 @@ index 525e40a83..82081a7b3 100644 case __NR_sigpending: case __NR_sigsuspend: #endif -@@ -355,7 +365,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) { +@@ -356,7 +368,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) { #endif case __NR_dup3: #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ @@ -508,25 +566,25 @@ index 525e40a83..82081a7b3 100644 case __NR_shutdown: #endif return true; -@@ -389,7 +399,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { - case __NR_membarrier: +@@ -389,7 +401,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { + case __NR_exit_group: case __NR_wait4: case __NR_waitid: -#if defined(__i386__) +#if defined(__i386__) || defined(__powerpc64__) case __NR_waitpid: #endif - #if !defined(__GLIBC__) -@@ -411,7 +421,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { - case __NR_set_tid_address: + return true; +@@ -406,7 +418,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { #endif + case __NR_set_tid_address: case __NR_unshare: -#if !defined(__mips__) && !defined(__aarch64__) +#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__) case __NR_vfork: #endif default: -@@ -460,7 +470,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) { +@@ -455,7 +467,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) { return true; default: #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ @@ -535,7 +593,7 @@ index 525e40a83..82081a7b3 100644 case __NR_socketpair: // We will want to inspect its argument. #endif return false; -@@ -470,7 +480,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) { +@@ -465,7 +477,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) { bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) { switch (sysno) { #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ @@ -544,7 +602,7 @@ index 525e40a83..82081a7b3 100644 case __NR_accept: case __NR_accept4: case __NR_bind: -@@ -485,7 +495,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) { +@@ -480,7 +492,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) { } #if defined(__i386__) || \ @@ -554,7 +612,7 @@ index 525e40a83..82081a7b3 100644 // Big multiplexing system call for sockets. bool SyscallSets::IsSocketCall(int sysno) { switch (sysno) { -@@ -499,7 +510,8 @@ bool SyscallSets::IsSocketCall(int sysno) { +@@ -494,7 +507,8 @@ bool SyscallSets::IsSocketCall(int sysno) { } #endif @@ -564,7 +622,7 @@ index 525e40a83..82081a7b3 100644 bool SyscallSets::IsNetworkSocketInformation(int sysno) { switch (sysno) { case __NR_getpeername: -@@ -527,7 +539,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) { +@@ -519,7 +533,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) { case __NR_mincore: case __NR_mlockall: #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ @@ -573,7 +631,7 @@ index 525e40a83..82081a7b3 100644 case __NR_mmap: #endif #if defined(__i386__) || defined(__arm__) || \ -@@ -559,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) { +@@ -549,7 +563,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) { switch (sysno) { case __NR_lseek: #if defined(__i386__) || defined(__arm__) || \ @@ -583,7 +641,7 @@ index 525e40a83..82081a7b3 100644 case __NR__llseek: #endif #if !defined(__aarch64__) -@@ -571,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) { +@@ -561,26 +576,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) { case __NR_readv: case __NR_pread64: #if defined(__arm__) || \ @@ -618,7 +676,7 @@ index 525e40a83..82081a7b3 100644 case __NR_sendmsg: // Could specify destination. case __NR_sendto: // Could specify destination. #endif -@@ -647,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) { +@@ -637,7 +654,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) { return true; case __NR_getpriority: #if defined(__i386__) || defined(__arm__) || \ @@ -628,7 +686,7 @@ index 525e40a83..82081a7b3 100644 case __NR_nice: #endif case __NR_setpriority: -@@ -659,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) { +@@ -649,7 +667,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) { bool SyscallSets::IsAdminOperation(int sysno) { switch (sysno) { #if defined(__i386__) || defined(__arm__) || \ @@ -638,7 +696,7 @@ index 525e40a83..82081a7b3 100644 case __NR_bdflush: #endif case __NR_kexec_load: -@@ -675,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) { +@@ -665,7 +684,8 @@ bool SyscallSets::IsAdminOperation(int sysno) { bool SyscallSets::IsKernelModule(int sysno) { switch (sysno) { @@ -648,7 +706,7 @@ index 525e40a83..82081a7b3 100644 case __NR_create_module: case __NR_get_kernel_syms: // Should ENOSYS. case __NR_query_module: -@@ -708,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) { +@@ -698,7 +718,8 @@ bool SyscallSets::IsFsControl(int sysno) { case __NR_swapoff: case __NR_swapon: #if defined(__i386__) || \ @@ -658,7 +716,7 @@ index 525e40a83..82081a7b3 100644 case __NR_umount: #endif case __NR_umount2: -@@ -724,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) { +@@ -714,7 +735,7 @@ bool SyscallSets::IsNuma(int sysno) { case __NR_getcpu: case __NR_mbind: #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ @@ -667,7 +725,7 @@ index 525e40a83..82081a7b3 100644 case __NR_migrate_pages: #endif case __NR_move_pages: -@@ -753,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) { +@@ -743,14 +764,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) { switch (sysno) { case __NR_acct: // Privileged. #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ @@ -686,7 +744,7 @@ index 525e40a83..82081a7b3 100644 case __NR_ulimit: #endif case __NR_getrusage: -@@ -794,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) { +@@ -784,7 +806,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) { #endif case __NR_sysinfo: case __NR_uname: @@ -695,7 +753,7 @@ index 525e40a83..82081a7b3 100644 case __NR_olduname: case __NR_oldolduname: #endif -@@ -888,7 +908,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) { +@@ -879,7 +902,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) { #endif #if defined(__i386__) || \ @@ -705,7 +763,7 @@ index 525e40a83..82081a7b3 100644 // Big system V multiplexing system call. bool SyscallSets::IsSystemVIpc(int sysno) { switch (sysno) { -@@ -908,7 +929,8 @@ bool SyscallSets::IsAnySystemV(int sysno) { +@@ -899,7 +923,8 @@ bool SyscallSets::IsAnySystemV(int sysno) { return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) || IsSystemVSharedMemory(sysno); #elif defined(__i386__) || \ @@ -715,7 +773,7 @@ index 525e40a83..82081a7b3 100644 return IsSystemVIpc(sysno); #endif } -@@ -961,7 +983,8 @@ bool SyscallSets::IsFaNotify(int sysno) { +@@ -952,7 +977,8 @@ bool SyscallSets::IsFaNotify(int sysno) { bool SyscallSets::IsTimer(int sysno) { switch (sysno) { case __NR_getitimer: @@ -725,7 +783,7 @@ index 525e40a83..82081a7b3 100644 case __NR_alarm: #endif case __NR_setitimer: -@@ -1020,18 +1043,22 @@ bool SyscallSets::IsMisc(int sysno) { +@@ -1011,18 +1037,22 @@ bool SyscallSets::IsMisc(int sysno) { case __NR_syncfs: case __NR_vhangup: // The system calls below are not implemented. @@ -752,7 +810,7 @@ index 525e40a83..82081a7b3 100644 case __NR_gtty: case __NR_idle: case __NR_lock: -@@ -1039,20 +1066,22 @@ bool SyscallSets::IsMisc(int sysno) { +@@ -1030,20 +1060,22 @@ bool SyscallSets::IsMisc(int sysno) { case __NR_prof: case __NR_profil: #endif @@ -780,7 +838,7 @@ index 525e40a83..82081a7b3 100644 #endif return true; diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h -index acd92da39..c2cb6d126 100644 +index 923533ec9..99184a7f9 100644 --- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h +++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h @@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets { @@ -800,15 +858,15 @@ index acd92da39..c2cb6d126 100644 static bool IsNetworkSocketInformation(int sysno); #endif -@@ -87,7 +88,8 @@ class SANDBOX_EXPORT SyscallSets { +@@ -77,7 +78,8 @@ class SANDBOX_EXPORT SyscallSets { #endif - - #if defined(__i386__) || \ -- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) -+ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ + #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \ + defined(__aarch64__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \ + defined(__powerpc64__) - // Big system V multiplexing system call. - static bool IsSystemVIpc(int sysno); + // These give a lot of ambient authority and bypass the setuid sandbox. + static bool IsSystemVSharedMemory(int sysno); #endif diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc index 34edabd2b..10fa5fd07 100644 @@ -911,10 +969,10 @@ index 34edabd2b..10fa5fd07 100644 SECCOMP_RESULT(ctx) = static_cast(ret_val); } diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc -index e9c51940c..35a8f0d67 100644 +index 003708d2c..8f9b3af4e 100644 --- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc +++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc -@@ -230,6 +230,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) { +@@ -225,6 +225,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) { SetIsInSigHandler(); } @@ -948,11 +1006,24 @@ index 542567f3e..31d493c26 100644 // The stack grows downward. void* stack = stack_buf + sizeof(stack_buf); #else +diff --git a/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.cc b/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.cc +index fcfd2aa12..f6eb32fb7 100644 +--- a/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.cc ++++ b/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.cc +@@ -58,7 +58,7 @@ long sys_clone(unsigned long flags, + #if defined(ARCH_CPU_X86_64) + return syscall(__NR_clone, flags, child_stack, ptid, ctid, tls); + #elif defined(ARCH_CPU_X86) || defined(ARCH_CPU_ARM_FAMILY) || \ +- defined(ARCH_CPU_MIPS_FAMILY) ++ defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY) + // CONFIG_CLONE_BACKWARDS defined. + return syscall(__NR_clone, flags, child_stack, ptid, tls, ctid); + #endif diff --git a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc -index 56d4964cf..a2e94eada 100644 +index 19b825a15..474d17351 100644 --- a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc +++ b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc -@@ -151,7 +151,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const { +@@ -153,7 +153,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const { #if defined(__NR_fstatat) case __NR_fstatat: #endif @@ -1065,7 +1136,7 @@ index 000000000..07728e087 + +#endif // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_ diff --git a/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc -index 5cfdb7a09..9c56942a8 100644 +index 017f13cf7..a76e579b7 100644 --- a/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc +++ b/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc @@ -15,6 +15,11 @@ @@ -1080,8 +1151,30 @@ index 5cfdb7a09..9c56942a8 100644 // TODO(vignatti): replace the local definitions below with #include // once kernel version 4.6 becomes widely used. #include +diff --git a/src/3rdparty/chromium/third_party/angle/src/compiler/translator/InfoSink.h b/src/3rdparty/chromium/third_party/angle/src/compiler/translator/InfoSink.h +index 3a807e1e3..5258617a7 100644 +--- a/src/3rdparty/chromium/third_party/angle/src/compiler/translator/InfoSink.h ++++ b/src/3rdparty/chromium/third_party/angle/src/compiler/translator/InfoSink.h +@@ -92,7 +92,16 @@ class TInfoSinkBase + stream.precision(8); + stream << f; + } +- sink.append(stream.str()); ++ ++ // Hack to work around a bug where negative floating point values ++ // are rendered like '.0.5' instead of '-0.5' ++ std::string res(stream.str()); ++ ++ if (signbit(f)) { // test if f is negative ++ res[0] = '-'; ++ } ++ ++ sink.append(res); + return *this; + } + // Write boolean values as their names instead of integral value. diff --git a/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h b/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h -index 0fd38748c..baed8b400 100644 +index 016426651..9b6a9aef9 100644 --- a/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h +++ b/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h @@ -9,6 +9,7 @@ @@ -1093,10 +1186,10 @@ index 0fd38748c..baed8b400 100644 #include diff --git a/src/3rdparty/chromium/third_party/boringssl/BUILD.gn b/src/3rdparty/chromium/third_party/boringssl/BUILD.gn -index 250ed8542..c75f4e0c2 100644 +index a8aa9c9ec..5478458ad 100644 --- a/src/3rdparty/chromium/third_party/boringssl/BUILD.gn +++ b/src/3rdparty/chromium/third_party/boringssl/BUILD.gn -@@ -103,6 +103,13 @@ if (is_win && !is_msan && current_cpu != "arm64") { +@@ -100,6 +100,13 @@ if (is_win && !is_msan && current_cpu != "arm64") { } else { public_configs = [ ":no_asm_config" ] } @@ -1210,7 +1303,7 @@ index aae1dc13b..03afec7a5 100644 + } // namespace google_breakpad diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h -index fb216fa6d..593aac822 100644 +index fb216fa6d..fb669126f 100644 --- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h +++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h @@ -68,6 +68,10 @@ struct ThreadInfo { @@ -1237,7 +1330,7 @@ index fb216fa6d..593aac822 100644 } // namespace google_breakpad diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc -index a8f9ccc72..7620cf6f7 100644 +index 6ee6cc1e4..477352e37 100644 --- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc +++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc @@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { @@ -1290,7 +1383,7 @@ index a8f9ccc72..7620cf6f7 100644 } // namespace google_breakpad diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h -index f3dde1f4d..96079169d 100644 +index f830618f2..6248818e7 100644 --- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h +++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h @@ -54,6 +54,9 @@ struct UContextReader { @@ -1482,10 +1575,10 @@ index c2fea0225..8c62c524a 100644 ASSERT_NE(std::string::npos, buf.find("M 00001000 0000002A 00001000 " diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc -index 4756a5416..4805fb694 100644 +index 415068983..b93e4afcf 100644 --- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc +++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc -@@ -117,6 +117,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) { +@@ -112,6 +112,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) { #elif defined(__mips__) stack_pointer = reinterpret_cast(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]); @@ -1495,7 +1588,7 @@ index 4756a5416..4805fb694 100644 #else #error "This code hasn't been ported to your platform yet." #endif -@@ -202,7 +205,10 @@ bool LinuxCoreDumper::EnumerateThreads() { +@@ -197,7 +200,10 @@ bool LinuxCoreDumper::EnumerateThreads() { memset(&info, 0, sizeof(ThreadInfo)); info.tgid = status->pr_pgrp; info.ppid = status->pr_ppid; @@ -1508,10 +1601,10 @@ index 4756a5416..4805fb694 100644 for (int i = EF_R0; i <= EF_R31; i++) info.mcontext.gregs[i - EF_R0] = status->pr_reg[i]; diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc -index dbedecd53..f91f7f994 100644 +index 1112035bc..8523dad63 100644 --- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc +++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc -@@ -798,7 +798,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len, +@@ -765,7 +765,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len, reinterpret_cast(int_stack_pointer & ~(page_size - 1)); // The number of bytes of stack which we try to capture. @@ -1550,10 +1643,10 @@ index 3ad48e501..1688c365e 100644 #error This test has not been ported to this platform. #endif diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc -index 8a3f04e29..e607b28d5 100644 +index e3ddb81a6..fa28575ef 100644 --- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc -@@ -154,19 +154,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child, +@@ -149,19 +149,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child, return true; } @@ -1585,7 +1678,7 @@ index 8a3f04e29..e607b28d5 100644 return true; #else return false; -@@ -303,6 +311,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) { +@@ -298,6 +306,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) { #elif defined(__mips__) stack_pointer = reinterpret_cast(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]); @@ -1676,7 +1769,7 @@ index f8cdf2a1c..cb808c151 100644 #endif LinuxDumper* dumper_; diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h -index d1cc5624c..320847643 100644 +index d1dc33121..63d805922 100644 --- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h +++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h @@ -47,6 +47,8 @@ class ExceptionHandler; @@ -1686,7 +1779,7 @@ index d1cc5624c..320847643 100644 +#elif defined(__powerpc64__) +typedef vrregset_t vstate_t; #elif !defined(__ARM_EABI__) && !defined(__mips__) - typedef struct _fpstate fpstate_t; + typedef struct _libc_fpstate fpstate_t; #endif diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc index c951e69d8..e1d6e40d6 100644 @@ -2502,10 +2595,10 @@ index b96abfe74..df12ca566 100644 #error Port. #endif diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc -index d76770020..40ad41d74 100644 +index 5b5723616..049c32858 100644 --- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc +++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc -@@ -613,6 +613,8 @@ bool WriteTestModule(const base::FilePath& module_path) { +@@ -612,6 +612,8 @@ bool WriteTestModule(const base::FilePath& module_path) { module.ehdr.e_machine = EM_AARCH64; #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL) module.ehdr.e_machine = EM_MIPS; @@ -3156,7 +3249,7 @@ index de71e7231..af0ffff39 100644 + blr #endif // __i386__ diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc -index cf23c2def..bcb837b17 100644 +index cf23c2def..5f264bc92 100644 --- a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc +++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc @@ -57,7 +57,7 @@ void TestCaptureContext() { @@ -3164,7 +3257,7 @@ index cf23c2def..bcb837b17 100644 #if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \ - !defined(MEMORY_SANITIZER) -+ !defined(ARCH_CPU_PPC64_FAMILY) && !defined(MEMORY_SANITIZER) ++ !defined(MEMORY_SANITIZER) && !defined(ARCH_CPU_PPC64_FAMILY) // Sanitizers can cause enough code bloat that the “nearby” check would // likely fail. const uintptr_t kReferencePC = @@ -3200,7 +3293,7 @@ index 9fc5db28c..5f69f8dce 100644 } diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc -index d91e3cc66..b1ffc7b15 100644 +index 58bfa8f83..8fc37c464 100644 --- a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc +++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc @@ -46,12 +46,12 @@ bool CanCauseSignal(int sig) { @@ -3242,10 +3335,28 @@ index d91e3cc66..b1ffc7b15 100644 #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL) case SIGILL: { diff --git a/src/3rdparty/chromium/third_party/dav1d/BUILD.gn b/src/3rdparty/chromium/third_party/dav1d/BUILD.gn -index 37ced877c..be8ae8304 100644 +index 63f12f805..99cc13fd9 100644 --- a/src/3rdparty/chromium/third_party/dav1d/BUILD.gn +++ b/src/3rdparty/chromium/third_party/dav1d/BUILD.gn -@@ -233,6 +233,21 @@ if (current_cpu == "x86" || current_cpu == "x64") { +@@ -177,6 +177,8 @@ static_library("dav1d_8bit") { + sources += arm_template_sources + } else if (current_cpu == "arm64") { + sources += arm_template_sources ++ } else if (current_cpu == "ppc64") { ++ sources += ppc64_template_sources + } + + cflags = dav1d_copts +@@ -205,6 +207,8 @@ static_library("dav1d_10bit") { + sources += arm_template_sources + } else if (current_cpu == "arm64") { + sources += arm_template_sources ++ } else if (current_cpu == "ppc64") { ++ sources += ppc64_template_sources + } + + cflags = dav1d_copts +@@ -244,6 +248,21 @@ if (current_cpu == "x86" || current_cpu == "x64") { ":dav1d_config", ] @@ -3267,7 +3378,7 @@ index 37ced877c..be8ae8304 100644 cflags = dav1d_copts } } -@@ -262,5 +277,7 @@ static_library("dav1d") { +@@ -273,5 +292,7 @@ static_library("dav1d") { } } else if (current_cpu == "arm" || current_cpu == "arm64") { deps += [ ":dav1d_arm" ] @@ -3316,6 +3427,60 @@ index 000000000..f6ca57f7f + +#define HAVE_UNISTD_H 1 + +diff --git a/src/3rdparty/chromium/third_party/dav1d/dav1d_generated.gni b/src/3rdparty/chromium/third_party/dav1d/dav1d_generated.gni +index e5c6fda31..34c0320f4 100644 +--- a/src/3rdparty/chromium/third_party/dav1d/dav1d_generated.gni ++++ b/src/3rdparty/chromium/third_party/dav1d/dav1d_generated.gni +@@ -61,6 +61,11 @@ arm_template_sources = [ + "libdav1d/src/arm/mc_init_tmpl.c", + ] + ++ppc64_template_sources = [ ++ "libdav1d/src/ppc/cdef_init_tmpl.c", ++ "libdav1d/src/ppc/looprestoration_init_tmpl.c", ++] ++ + template_sources = [ + "libdav1d/src/cdef_apply_tmpl.c", + "libdav1d/src/cdef_tmpl.c", +diff --git a/src/3rdparty/chromium/third_party/dav1d/generate_source.py b/src/3rdparty/chromium/third_party/dav1d/generate_source.py +index 0ca1c5595..46ae92ec7 100755 +--- a/src/3rdparty/chromium/third_party/dav1d/generate_source.py ++++ b/src/3rdparty/chromium/third_party/dav1d/generate_source.py +@@ -53,7 +53,8 @@ def WriteGn(fd): + WriteArray(fd, "arm32_asm_sources", glob.glob("libdav1d/src/arm/32/*.S")) + WriteArray(fd, "arm64_asm_sources", glob.glob("libdav1d/src/arm/64/*.S")) + WriteArray(fd, "arm_template_sources", glob.glob("libdav1d/src/arm/*_tmpl.c")) +- ++ WriteArray(fd, "ppc64_template_sources", glob.glob("libdav1d/src/ppc/*_tmpl.c")) ++ + template_sources = glob.glob("libdav1d/src/*_tmpl.c") + WriteArray(fd, "template_sources", template_sources) + +diff --git a/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/ppc/types.h b/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/ppc/types.h +index 0b4bd72f0..a0caa5e71 100644 +--- a/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/ppc/types.h ++++ b/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/ppc/types.h +@@ -51,4 +51,19 @@ + #define u16l_to_i32(v) ((i32x4) vec_mergel((u16x8) v, vec_splat_u16(0))) + #define i16l_to_i32(v) ((i32x4) vec_unpackl((i16x8)v)) + ++#if defined(__clang__) ++#undef vec_splats ++#define vec_splats(N) \ ++ _Generic((N), \ ++ unsigned char: ((u8x16)(N)), \ ++ signed char: ((i8x16)(N)), \ ++ unsigned short: ((u16x8)(N)), \ ++ signed short: ((i16x8)(N)), \ ++ unsigned int: ((u32x4)(N)), \ ++ signed int: ((i32x4)(N)), \ ++ unsigned long long: ((u64x2)(N)), \ ++ signed long long: ((i64x2)(N)) \ ++ ) ++#endif ++ + #endif /* DAV1D_SRC_PPC_TYPES_H */ diff --git a/src/3rdparty/chromium/third_party/libdrm/src/xf86drm.c b/src/3rdparty/chromium/third_party/libdrm/src/xf86drm.c index 1e87610b6..d1283f256 100644 --- a/src/3rdparty/chromium/third_party/libdrm/src/xf86drm.c @@ -4254,7 +4419,7 @@ index 000000000..07016177c +#endif /* PNG_POWERPC_VSX_OPT > 0 */ +#endif /* READ */ diff --git a/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h b/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h -index 0f3d399b1..5cc45ba02 100644 +index 8e0cc3857..70b4da2e0 100644 --- a/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h +++ b/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h @@ -3914,7 +3914,7 @@ struct kernel_statfs { @@ -4266,7 +4431,7 @@ index 0f3d399b1..5cc45ba02 100644 #define __NR__mmap2 __NR_mmap2 LSS_INLINE _syscall6(void*, _mmap2, void*, s, size_t, l, int, p, -@@ -4045,7 +4045,7 @@ struct kernel_statfs { +@@ -4025,7 +4025,7 @@ struct kernel_statfs { #if defined(__i386__) || \ defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \ (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \ @@ -4297,43 +4462,6 @@ index 8097e2c49..10e6a16ea 100755 def RunNode(cmd_parts, stdout=None): -diff --git a/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h b/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h -index 945273b1f..e1735f2e5 100644 ---- a/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h -+++ b/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h -@@ -11,7 +11,7 @@ - - namespace pdfium { - namespace base { --#if defined(OS_WIN) -+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64) - static constexpr size_t kPageAllocationGranularityShift = 16; // 64KB - #elif defined(_MIPS_ARCH_LOONGSON) - static constexpr size_t kPageAllocationGranularityShift = 14; // 16KB -@@ -27,6 +27,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask = - - #if defined(_MIPS_ARCH_LOONGSON) - static constexpr size_t kSystemPageSize = 16384; -+#elif defined(ARCH_CPU_PPC64) -+// TODO: modern ppc64 can do 4k and 64k page sizes -+// for now, 64k is assumed -+static constexpr size_t kSystemPageSize = 65536; - #else - static constexpr size_t kSystemPageSize = 4096; - #endif -diff --git a/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h b/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h -index 437e4dffd..a42a9b085 100644 ---- a/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h -+++ b/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h -@@ -36,6 +36,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2; - - #if defined(_MIPS_ARCH_LOONGSON) - static const size_t kPartitionPageShift = 16; // 64 KiB -+#elif defined(ARCH_CPU_PPC64) -+static const size_t kPartitionPageShift = 18; // 256 KiB - #else - static const size_t kPartitionPageShift = 14; // 16 KiB - #endif diff --git a/src/3rdparty/chromium/third_party/pffft/src/pffft.c b/src/3rdparty/chromium/third_party/pffft/src/pffft.c index bdac4d784..51e0f2cac 100644 --- a/src/3rdparty/chromium/third_party/pffft/src/pffft.c @@ -4346,70 +4474,38 @@ index bdac4d784..51e0f2cac 100644 typedef vector float v4sf; # define SIMD_SZ 4 # define VZERO() ((vector float) vec_splat_u8(0)) +diff --git a/src/3rdparty/chromium/third_party/skia/src/sksl/SkSLString.cpp b/src/3rdparty/chromium/third_party/skia/src/sksl/SkSLString.cpp +index 88eb1c7d3..4be33fa5b 100644 +--- a/src/3rdparty/chromium/third_party/skia/src/sksl/SkSLString.cpp ++++ b/src/3rdparty/chromium/third_party/skia/src/sksl/SkSLString.cpp +@@ -240,7 +240,12 @@ String to_string(double value) { + if (needsDotZero) { + buffer << ".0"; + } +- return String(buffer.str().c_str()); ++ ++ std::string ret(buffer.str()); ++ if (signbit(value) && ret[0] == '.') { ++ ret[0] = '-'; ++ } ++ return String(ret.c_str()); + } + + SKSL_INT stoi(const String& s) { diff --git a/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c b/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c -index 59bdd500f..78d2924d7 100644 +index 4d60a82f6..717128149 100644 --- a/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c +++ b/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c -@@ -13986,10 +13986,11 @@ typedef INT16_TYPE LogEst; +@@ -14301,7 +14301,8 @@ typedef INT16_TYPE LogEst; # if defined(i386) || defined(__i386__) || defined(_M_IX86) || \ defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \ defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \ - defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) + defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) || \ -+ defined(__LITTLE_ENDIAN__) ++ defined(__powerpc64__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) # define SQLITE_BYTEORDER 1234 # elif defined(sparc) || defined(__ppc__) || \ -- defined(__ARMEB__) || defined(__AARCH64EB__) -+ defined(__ARMEB__) || defined(__AARCH64EB__) || defined(__BIG_ENDIAN__) - # define SQLITE_BYTEORDER 4321 - # else - # define SQLITE_BYTEORDER 0 -@@ -181728,9 +181729,9 @@ struct RtreeMatchArg { - #if defined(i386) || defined(__i386__) || defined(_M_IX86) || \ - defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \ - defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \ -- defined(__arm__) -+ defined(__arm__) || defined(__LITTLE_ENDIAN__) - # define SQLITE_BYTEORDER 1234 --#elif defined(sparc) || defined(__ppc__) -+#elif defined(sparc) || defined(__ppc__) || defined(__BIG_ENDIAN__) - # define SQLITE_BYTEORDER 4321 - #else - # define SQLITE_BYTEORDER 0 /* 0 means "unknown at compile-time" */ -diff --git a/src/3rdparty/chromium/third_party/sqlite/patched/ext/rtree/rtree.c b/src/3rdparty/chromium/third_party/sqlite/patched/ext/rtree/rtree.c -index bd8b08eec..da3d77307 100644 ---- a/src/3rdparty/chromium/third_party/sqlite/patched/ext/rtree/rtree.c -+++ b/src/3rdparty/chromium/third_party/sqlite/patched/ext/rtree/rtree.c -@@ -425,9 +425,9 @@ struct RtreeMatchArg { - #if defined(i386) || defined(__i386__) || defined(_M_IX86) || \ - defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \ - defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \ -- defined(__arm__) -+ defined(__arm__) || defined(__LITTLE_ENDIAN__) - # define SQLITE_BYTEORDER 1234 --#elif defined(sparc) || defined(__ppc__) -+#elif defined(sparc) || defined(__ppc__) || defined(__BIG_ENDIAN__) - # define SQLITE_BYTEORDER 4321 - #else - # define SQLITE_BYTEORDER 0 /* 0 means "unknown at compile-time" */ -diff --git a/src/3rdparty/chromium/third_party/sqlite/patched/src/sqliteInt.h b/src/3rdparty/chromium/third_party/sqlite/patched/src/sqliteInt.h -index 017809295..1acd10264 100644 ---- a/src/3rdparty/chromium/third_party/sqlite/patched/src/sqliteInt.h -+++ b/src/3rdparty/chromium/third_party/sqlite/patched/src/sqliteInt.h -@@ -833,10 +833,11 @@ typedef INT16_TYPE LogEst; - # if defined(i386) || defined(__i386__) || defined(_M_IX86) || \ - defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \ - defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \ -- defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) -+ defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) || \ -+ defined(__LITTLE_ENDIAN__) - # define SQLITE_BYTEORDER 1234 - # elif defined(sparc) || defined(__ppc__) || \ -- defined(__ARMEB__) || defined(__AARCH64EB__) -+ defined(__ARMEB__) || defined(__AARCH64EB__) || defined(__BIG_ENDIAN__) - # define SQLITE_BYTEORDER 4321 - # else - # define SQLITE_BYTEORDER 0 + defined(__ARMEB__) || defined(__AARCH64EB__) diff --git a/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc b/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc index dd9ab457e..c005d9599 100644 --- a/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc @@ -4439,7 +4535,7 @@ index dd9ab457e..c005d9599 100644 } diff --git a/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h b/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h -index eb77ffa8f..e60b81a05 100644 +index ed216e660..25d36c071 100644 --- a/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h +++ b/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h @@ -50,6 +50,18 @@ @@ -4462,10 +4558,10 @@ index eb77ffa8f..e60b81a05 100644 #error Please add support for your architecture in rtc_base/system/arch.h #endif diff --git a/src/3rdparty/chromium/v8/BUILD.gn b/src/3rdparty/chromium/v8/BUILD.gn -index e21400265..23456628b 100644 +index 9107b3024..e885696d5 100644 --- a/src/3rdparty/chromium/v8/BUILD.gn +++ b/src/3rdparty/chromium/v8/BUILD.gn -@@ -588,6 +588,12 @@ config("toolchain") { +@@ -620,6 +620,12 @@ config("toolchain") { } if (host_byteorder == "little") { defines += [ "V8_TARGET_ARCH_PPC_LE" ] @@ -4478,48 +4574,6 @@ index e21400265..23456628b 100644 } else if (host_byteorder == "big") { defines += [ "V8_TARGET_ARCH_PPC_BE" ] if (current_os == "aix") { -diff --git a/src/3rdparty/chromium/v8/test/BUILD.gn b/src/3rdparty/chromium/v8/test/BUILD.gn -index 6bf9ca643..66ce4ad31 100644 ---- a/src/3rdparty/chromium/v8/test/BUILD.gn -+++ b/src/3rdparty/chromium/v8/test/BUILD.gn -@@ -32,7 +32,7 @@ group("gn_all") { - deps += [ - "cctest:cctest", - "cctest:generate-bytecode-expectations", -- "unittests:unittests", -+ #"unittests:unittests", - ] - } - } -@@ -82,10 +82,10 @@ group("v8_bot_default") { - "mjsunit:v8_mjsunit", - "mkgrokdump:mkgrokdump", - "preparser:v8_preparser", -- "unittests:unittests", -- "wasm-api-tests:wasm_api_tests", -+ #"unittests:unittests", -+ #"wasm-api-tests:wasm_api_tests", - "wasm-js:v8_wasm_js", -- "wasm-spec-tests:v8_wasm_spec_tests", -+ #"wasm-spec-tests:v8_wasm_spec_tests", - "webkit:v8_webkit", - ] - } -@@ -103,10 +103,10 @@ group("v8_default") { - "mjsunit:v8_mjsunit", - "mkgrokdump:mkgrokdump", - "preparser:v8_preparser", -- "unittests:unittests", -- "wasm-api-tests:wasm_api_tests", -- "wasm-js:v8_wasm_js", -- "wasm-spec-tests:v8_wasm_spec_tests", -+ #"unittests:unittests", -+ #"wasm-api-tests:wasm_api_tests", -+ #"wasm-js:v8_wasm_js", -+ #"wasm-spec-tests:v8_wasm_spec_tests", - ] - } - -- -2.26.0 +2.26.2 diff --git a/srcpkgs/qt5-webengine/patches/0100-sndio.patch b/srcpkgs/qt5-webengine/patches/0100-sndio.patch new file mode 100644 index 00000000000..cc1cbfb2e97 --- /dev/null +++ b/srcpkgs/qt5-webengine/patches/0100-sndio.patch @@ -0,0 +1,14 @@ +--- a/src/buildtools/config/linux.pri 2020-03-24 10:16:30.000000000 +0100 ++++ - 2020-04-06 14:42:50.189729758 +0200 +@@ -190,6 +190,11 @@ + } else { + gn_args += use_alsa=false + } ++ qtConfig(webengine-sndio) { ++ gn_args += use_sndio=true ++ } else { ++ gn_args += use_sndio=true ++ } + !packagesExist(libpci): gn_args += use_libpci=false + + qtConfig(webengine-ozone-x11) { diff --git a/srcpkgs/qt5-webengine/patches/0102-sndio.patch b/srcpkgs/qt5-webengine/patches/0102-sndio.patch new file mode 100644 index 00000000000..a5681b0eb43 --- /dev/null +++ b/srcpkgs/qt5-webengine/patches/0102-sndio.patch @@ -0,0 +1,56 @@ +--- a/src/core/configure.json 2020-03-24 10:16:30.000000000 +0100 ++++ - 2020-04-06 14:28:00.591236926 +0200 +@@ -21,6 +21,7 @@ + "webengine-printing-and-pdf": "boolean", + "webengine-proprietary-codecs": "boolean", + "webengine-pulseaudio": "boolean", ++ "webengine-sndio": "boolean", + "webengine-spellchecker": "boolean", + "webengine-native-spellchecker": "boolean", + "webengine-extensions": "boolean", +@@ -31,6 +32,7 @@ + "webengine-kerberos": "boolean", + "alsa": { "type": "boolean", "name": "webengine-alsa" }, + "pulseaudio": { "type": "boolean", "name": "webengine-pulseaudio" }, ++ "sndio": { "type": "boolean", "name": "webengine-sndio" }, + "ffmpeg": { "type": "enum", "name": "webengine-system-ffmpeg", "values": { "system": "yes", "qt": "no" } }, + "opus": { "type": "enum", "name": "webengine-system-opus", "values": { "system": "yes", "qt": "no" } }, + "webp": { "type": "enum", "name": "webengine-system-libwebp", "values": { "system": "yes", "qt": "no" } }, +@@ -68,7 +70,13 @@ + "sources": [ + { "type": "pkgConfig", "args": "libpulse >= 0.9.10 libpulse-mainloop-glib" } + ] +- } ++ }, ++ "sndio": { ++ "label": "sndio", ++ "sources": [ ++ { "type": "pkgConfig", "args": "libsndio >= 1.5.0 libsndio" } ++ ] ++ } + }, + "tests" : { + "webengine-host-compiler": { +@@ -136,6 +144,10 @@ + "condition": "libs.webengine-pulseaudio", + "output": [ "privateFeature" ] + }, ++ "webengine-sndio": { ++ "label": "Use sndio", ++ "output": [ "privateFeature" ] ++ }, + "webengine-pepper-plugins": { + "label": "Pepper Plugins", + "purpose": "Enables use of Pepper Flash plugins.", +@@ -308,6 +320,11 @@ + "condition": "config.unix" + }, + { ++ "type": "feature", ++ "args": "webengine-sndio", ++ "condition": "config.unix" ++ }, ++ { + "type": "feature", + "args": "webengine-sanitizer", + "condition": "config.sanitizer" diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template index 6ef5fe68c10..14327b3dc9b 100644 --- a/srcpkgs/qt5-webengine/template +++ b/srcpkgs/qt5-webengine/template @@ -1,7 +1,7 @@ # Template file for 'qt5-webengine' pkgname=qt5-webengine -version=5.14.2 -revision=4 +version=5.15.0 +revision=1 archs="x86_64* i686* armv[67]* ppc64* aarch64*" wrksrc="qtwebengine-everywhere-src-${version}" build_style=qmake @@ -9,26 +9,25 @@ configure_args="-- -webengine-icu -webengine-ffmpeg -webengine-opus -webengine-webp -webengine-pepper-plugins -webengine-printing-and-pdf -webengine-proprietary-codecs -webengine-pulseaudio -webengine-spellchecker -webengine-webrtc -webengine-geolocation - $(vopt_if snapshot '' '-no')-webengine-v8-snapshot -webengine-kerberos" + $(vopt_if sndio '-sndio') -webengine-kerberos" # Rely on auto detection (fails if forced for cross builds) -webengine-alsa hostmakedepends="qt5-qmake gperf ninja qt5-host-tools flex pkg-config which perl python protobuf" -makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel +makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel qt5-devel qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel - libXrandr-devel MesaLib-devel mit-krb5-devel alsa-lib-devel" + libXrandr-devel MesaLib-devel mit-krb5-devel alsa-lib-devel $(vopt_if sndio sndio-devel)" short_desc="Cross-platform application and UI framework (QT5) - WebEngine component" maintainer="John " license="GPL-3.0-or-later, LGPL-3.0-or-later" homepage="https://qt.io/" distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qtwebengine-everywhere-src-${version}.tar.xz" -checksum=e169d6a75d8c397e04f843bc1b9585950fb9a001255cd18d6293f66fa8a6c947 +checksum=c38e2fda7ed1b7d5a90f26abf231ec0715d78a5bc39a94673d8e39d75f04c5df patch_args="-Np1" -build_options="snapshot" -build_options_default="snapshot" +build_options="sndio" if [ "$CROSS_BUILD" ]; then hostmakedepends+=" nss-devel libevent-devel qt5-location-devel @@ -114,6 +113,22 @@ _cleanup_wrksrc_leak() { -e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \; } +post_patch() { + if [ "$build_option_sndio" ]; then + mkdir -p ${wrksrc}/src/3rdparty/chromium/media/audio/{sndio,openbsd} + cp ${FILESDIR}/sndio-files/sndio_*put.* \ + ${wrksrc}/src/3rdparty/chromium/media/audio/sndio + cp ${FILESDIR}/sndio-files/audio_manager_openbsd.* \ + ${wrksrc}/src/3rdparty/chromium/media/audio/openbsd + for f in "${FILESDIR}"/sndio-patches/*.patch; do + cd src/3rdparty/chromium/ + echo "Applying $f" + patch -Np0 -i "$f" + cd "$wrksrc" + done + fi +} + pre_configure() { export PATH=${PATH/\/builddir\/.xbps-qt5-webengine\/wrappers:/} cp ${FILESDIR}/resolv_compat.h ${wrksrc}/src/3rdparty/chromium/net/dns @@ -155,7 +170,7 @@ pre_build() { } qt5-webengine-devel_package() { - depends="${sourcepkg}>=${version}_${revision}" + depends="qt5-devel>=${version} ${sourcepkg}>=${version}_${revision}" short_desc+=" - development files" pkg_install() { vmove usr/include