Fix Launcher for M1, fix frida_libpng harness compilation, fix CI (#987)

* Fix harness compilation for frida_libpng

* M1: Always use fast cores

* always ignore result

* seeing if manualy installing libunistring fixes wget

* seeing if manualy installing wget fixes it, instead

* un-remove comment
This commit is contained in:
Dominik Maier 2023-01-05 14:26:20 +01:00 committed by GitHub
parent 266677bb88
commit 159e6ea480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 24 deletions

View File

@ -182,7 +182,7 @@ jobs:
# todo: remove afl++-clang when nyx support samcov_pcguard
linux: llvm llvm-dev clang nasm ninja-build gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libgtk-3-dev afl++-clang pax-utils
# update bash for macos to support `declare -A` command`
macos: llvm libpng nasm coreutils z3 bash
macos: llvm libpng nasm coreutils z3 bash wget
- name: pip install
run: python3 -m pip install msgpack jinja2
# Note that nproc needs to have coreutils installed on macOS, so the order of CI commands matters.

View File

@ -22,7 +22,7 @@
#include <vector>
#define PNG_INTERNAL
#include "png.h"
#include "libpng-1.6.37/png.h"
#define PNG_CLEANUP \
if (png_handler.png_ptr) { \

View File

@ -538,10 +538,7 @@ mod apple {
THREAD_AFFINITY_POLICY_COUNT,
};
#[cfg(target_arch = "aarch64")]
use libc::{
pthread_set_qos_class_self_np, qos_class_t::QOS_CLASS_BACKGROUND,
qos_class_t::QOS_CLASS_USER_INITIATED,
};
use libc::{pthread_set_qos_class_self_np, qos_class_t::QOS_CLASS_USER_INITIATED};
use super::CoreId;
use crate::Error;
@ -596,26 +593,18 @@ mod apple {
}
#[cfg(target_arch = "aarch64")]
pub fn set_for_current(core_id: CoreId) -> Result<(), Error> {
unsafe {
// This is the best we can do, unlike on intel architecture
// the system does not allow to pin a process/thread to specific cpu
// but instead choosing at best between the two available groups
// energy consumption's efficient one and the other focusing more on performance.
let mut qos_class = QOS_CLASS_USER_INITIATED;
if core_id.id % 2 != 0 {
qos_class = QOS_CLASS_BACKGROUND;
}
let result = pthread_set_qos_class_self_np(qos_class, 0);
pub fn set_for_current(_core_id: CoreId) -> Result<(), Error> {
// This is the best we can do, unlike on intel architecture
// the system does not allow to pin a process/thread to specific cpu.
// We just tell the system that we want performance.
//
// Furthermore, this seems to fail on background threads, so we ignore errors (result != 0).
if result == 0 {
Ok(())
} else {
Err(Error::unknown(format!(
"Failed to set_for_current {result:?}"
)))
}
unsafe {
let _result = pthread_set_qos_class_self_np(QOS_CLASS_USER_INITIATED, 0);
}
Ok(())
}
}