update V8

This commit is contained in:
Alexander Frick 2023-09-03 12:40:52 -05:00
parent 6874279f00
commit 1b8e58a5f4
11 changed files with 353 additions and 5722 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,294 +0,0 @@
/* Copyright (c) 2003-2008 Jean-Marc Valin
Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Written by Jean-Marc Valin */
/**
@file arch.h
@brief Various architecture definitions for CELT
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ARCH_H
#define ARCH_H
#include "opus_types.h"
#include "opus_defines.h"
# if !defined(__GNUC_PREREQ)
# if defined(__GNUC__)&&defined(__GNUC_MINOR__)
# define __GNUC_PREREQ(_maj,_min) \
((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min))
# else
# define __GNUC_PREREQ(_maj,_min) 0
# endif
# endif
#if OPUS_GNUC_PREREQ(3, 0)
#define opus_likely(x) (__builtin_expect(!!(x), 1))
#define opus_unlikely(x) (__builtin_expect(!!(x), 0))
#else
#define opus_likely(x) (!!(x))
#define opus_unlikely(x) (!!(x))
#endif
#define CELT_SIG_SCALE 32768.f
#define CELT_FATAL(str) celt_fatal(str, __FILE__, __LINE__);
#if defined(ENABLE_ASSERTIONS) || defined(ENABLE_HARDENING)
#ifdef __GNUC__
__attribute__((noreturn))
#endif
void celt_fatal(const char *str, const char *file, int line);
#if defined(CELT_C) && !defined(OVERRIDE_celt_fatal)
#include <stdio.h>
#include <stdlib.h>
#ifdef __GNUC__
__attribute__((noreturn))
#endif
void celt_fatal(const char *str, const char *file, int line)
{
#if !defined(CHROMIUM_NO_LOGGING)
fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str);
#endif
#if defined(_MSC_VER)
_set_abort_behavior( 0, _WRITE_ABORT_MSG);
#endif
abort();
}
#endif
#define celt_assert(cond) {if (!(cond)) {CELT_FATAL("assertion failed: " #cond);}}
#define celt_assert2(cond, message) {if (!(cond)) {CELT_FATAL("assertion failed: " #cond "\n" message);}}
#define MUST_SUCCEED(call) celt_assert((call) == OPUS_OK)
#else
#define celt_assert(cond)
#define celt_assert2(cond, message)
#define MUST_SUCCEED(call) do {if((call) != OPUS_OK) {RESTORE_STACK; return OPUS_INTERNAL_ERROR;} } while (0)
#endif
#if defined(ENABLE_ASSERTIONS)
#define celt_sig_assert(cond) {if (!(cond)) {CELT_FATAL("signal assertion failed: " #cond);}}
#else
#define celt_sig_assert(cond)
#endif
#define IMUL32(a,b) ((a)*(b))
#define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Minimum 16-bit value. */
#define MAX16(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 16-bit value. */
#define MIN32(a,b) ((a) < (b) ? (a) : (b)) /**< Minimum 32-bit value. */
#define MAX32(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 32-bit value. */
#define IMIN(a,b) ((a) < (b) ? (a) : (b)) /**< Minimum int value. */
#define IMAX(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum int value. */
#define UADD32(a,b) ((a)+(b))
#define USUB32(a,b) ((a)-(b))
/* Set this if opus_int64 is a native type of the CPU. */
/* Assume that all LP64 architectures have fast 64-bit types; also x86_64
(which can be ILP32 for x32) and Win64 (which is LLP64). */
#if defined(__x86_64__) || defined(__LP64__) || defined(_WIN64)
#define OPUS_FAST_INT64 1
#else
#define OPUS_FAST_INT64 0
#endif
#define PRINT_MIPS(file)
#ifdef FIXED_POINT
typedef opus_int16 opus_val16;
typedef opus_int32 opus_val32;
typedef opus_int64 opus_val64;
typedef opus_val32 celt_sig;
typedef opus_val16 celt_norm;
typedef opus_val32 celt_ener;
#define celt_isnan(x) 0
#define Q15ONE 32767
#define SIG_SHIFT 12
/* Safe saturation value for 32-bit signals. Should be less than
2^31*(1-0.85) to avoid blowing up on DC at deemphasis.*/
#define SIG_SAT (300000000)
#define NORM_SCALING 16384
#define DB_SHIFT 10
#define EPSILON 1
#define VERY_SMALL 0
#define VERY_LARGE16 ((opus_val16)32767)
#define Q15_ONE ((opus_val16)32767)
#define SCALEIN(a) (a)
#define SCALEOUT(a) (a)
#define ABS16(x) ((x) < 0 ? (-(x)) : (x))
#define ABS32(x) ((x) < 0 ? (-(x)) : (x))
static OPUS_INLINE opus_int16 SAT16(opus_int32 x) {
return x > 32767 ? 32767 : x < -32768 ? -32768 : (opus_int16)x;
}
#ifdef FIXED_DEBUG
#include "fixed_debug.h"
#else
#include "fixed_generic.h"
#ifdef OPUS_ARM_PRESUME_AARCH64_NEON_INTR
#include "arm/fixed_arm64.h"
#elif defined (OPUS_ARM_INLINE_EDSP)
#include "arm/fixed_armv5e.h"
#elif defined (OPUS_ARM_INLINE_ASM)
#include "arm/fixed_armv4.h"
#elif defined (BFIN_ASM)
#include "fixed_bfin.h"
#elif defined (TI_C5X_ASM)
#include "fixed_c5x.h"
#elif defined (TI_C6X_ASM)
#include "fixed_c6x.h"
#endif
#endif
#else /* FIXED_POINT */
typedef float opus_val16;
typedef float opus_val32;
typedef float opus_val64;
typedef float celt_sig;
typedef float celt_norm;
typedef float celt_ener;
#define FLOAT_APPROX
#ifdef FLOAT_APPROX
/* This code should reliably detect NaN/inf even when -ffast-math is used.
Assumes IEEE 754 format. */
static OPUS_INLINE int celt_isnan(float x)
{
union {float f; opus_uint32 i;} in;
in.f = x;
return ((in.i>>23)&0xFF)==0xFF && (in.i&0x007FFFFF)!=0;
}
#else
#ifdef __FAST_MATH__
#error Cannot build libopus with -ffast-math unless FLOAT_APPROX is defined. This could result in crashes on extreme (e.g. NaN) input
#endif
#define celt_isnan(x) ((x)!=(x))
#endif
#define Q15ONE 1.0f
#define NORM_SCALING 1.f
#define EPSILON 1e-15f
#define VERY_SMALL 1e-30f
#define VERY_LARGE16 1e15f
#define Q15_ONE ((opus_val16)1.f)
/* This appears to be the same speed as C99's fabsf() but it's more portable. */
#define ABS16(x) ((float)fabs(x))
#define ABS32(x) ((float)fabs(x))
#define QCONST16(x,bits) (x)
#define QCONST32(x,bits) (x)
#define NEG16(x) (-(x))
#define NEG32(x) (-(x))
#define NEG32_ovflw(x) (-(x))
#define EXTRACT16(x) (x)
#define EXTEND32(x) (x)
#define SHR16(a,shift) (a)
#define SHL16(a,shift) (a)
#define SHR32(a,shift) (a)
#define SHL32(a,shift) (a)
#define PSHR32(a,shift) (a)
#define VSHR32(a,shift) (a)
#define PSHR(a,shift) (a)
#define SHR(a,shift) (a)
#define SHL(a,shift) (a)
#define SATURATE(x,a) (x)
#define SATURATE16(x) (x)
#define ROUND16(a,shift) (a)
#define SROUND16(a,shift) (a)
#define HALF16(x) (.5f*(x))
#define HALF32(x) (.5f*(x))
#define ADD16(a,b) ((a)+(b))
#define SUB16(a,b) ((a)-(b))
#define ADD32(a,b) ((a)+(b))
#define SUB32(a,b) ((a)-(b))
#define ADD32_ovflw(a,b) ((a)+(b))
#define SUB32_ovflw(a,b) ((a)-(b))
#define MULT16_16_16(a,b) ((a)*(b))
#define MULT16_16(a,b) ((opus_val32)(a)*(opus_val32)(b))
#define MAC16_16(c,a,b) ((c)+(opus_val32)(a)*(opus_val32)(b))
#define MULT16_32_Q15(a,b) ((a)*(b))
#define MULT16_32_Q16(a,b) ((a)*(b))
#define MULT32_32_Q31(a,b) ((a)*(b))
#define MAC16_32_Q15(c,a,b) ((c)+(a)*(b))
#define MAC16_32_Q16(c,a,b) ((c)+(a)*(b))
#define MULT16_16_Q11_32(a,b) ((a)*(b))
#define MULT16_16_Q11(a,b) ((a)*(b))
#define MULT16_16_Q13(a,b) ((a)*(b))
#define MULT16_16_Q14(a,b) ((a)*(b))
#define MULT16_16_Q15(a,b) ((a)*(b))
#define MULT16_16_P15(a,b) ((a)*(b))
#define MULT16_16_P13(a,b) ((a)*(b))
#define MULT16_16_P14(a,b) ((a)*(b))
#define MULT16_32_P16(a,b) ((a)*(b))
#define DIV32_16(a,b) (((opus_val32)(a))/(opus_val16)(b))
#define DIV32(a,b) (((opus_val32)(a))/(opus_val32)(b))
#define SCALEIN(a) ((a)*CELT_SIG_SCALE)
#define SCALEOUT(a) ((a)*(1/CELT_SIG_SCALE))
#define SIG2WORD16(x) (x)
#endif /* !FIXED_POINT */
#ifndef GLOBAL_STACK_SIZE
#ifdef FIXED_POINT
#define GLOBAL_STACK_SIZE 120000
#else
#define GLOBAL_STACK_SIZE 120000
#endif
#endif
#endif /* ARCH_H */

View File

@ -1,952 +0,0 @@
dnl Process this file with autoconf to produce a configure script. -*-m4-*-
dnl The package_version file will be automatically synced to the git revision
dnl by the update_version script when configured in the repository, but will
dnl remain constant in tarball releases unless it is manually edited.
m4_define([CURRENT_VERSION],
m4_esyscmd([ ./update_version 2>/dev/null || true
if test -e package_version; then
. ./package_version
printf "$PACKAGE_VERSION"
else
printf "unknown"
fi ]))
AC_INIT([opus],[CURRENT_VERSION],[opus@xiph.org])
AC_CONFIG_SRCDIR(src/opus_encoder.c)
AC_CONFIG_MACRO_DIR([m4])
dnl enable silent rules on automake 1.11 and later
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# For libtool.
dnl Please update these for releases.
OPUS_LT_CURRENT=8
OPUS_LT_REVISION=0
OPUS_LT_AGE=8
AC_SUBST(OPUS_LT_CURRENT)
AC_SUBST(OPUS_LT_REVISION)
AC_SUBST(OPUS_LT_AGE)
AM_INIT_AUTOMAKE([no-define])
AM_MAINTAINER_MODE([enable])
AC_CANONICAL_HOST
AC_MINGW32
AM_PROG_LIBTOOL
AM_PROG_CC_C_O
AC_PROG_CC_C99
AC_C_CONST
AC_C_INLINE
AM_PROG_AS
AC_DEFINE([OPUS_BUILD], [], [This is a build of OPUS])
#Use a hacked up version of autoconf's AC_C_RESTRICT because it's not
#strong enough a test to detect old buggy versions of GCC (e.g. 2.95.3)
#Note: Both this and the test for variable-size arrays below are also
# done by AC_PROG_CC_C99, but not thoroughly enough apparently.
AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict,
[ac_cv_c_restrict=no
# The order here caters to the fact that C++ does not require restrict.
for ac_kw in __restrict __restrict__ _Restrict restrict; do
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[typedef int * int_ptr;
int foo (int_ptr $ac_kw ip, int * $ac_kw baz[]) {
return ip[0];
}]],
[[int s[1];
int * $ac_kw t = s;
t[0] = 0;
return foo(t, (void *)0)]])],
[ac_cv_c_restrict=$ac_kw])
test "$ac_cv_c_restrict" != no && break
done
])
AH_VERBATIM([restrict],
[/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
supported directly. */
#undef restrict
/* Work around a bug in Sun C++: it does not support _Restrict or
__restrict__, even though the corresponding Sun C compiler ends up with
"#define restrict _Restrict" or "#define restrict __restrict__" in the
previous line. Perhaps some future version of Sun C++ will work with
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
#if defined __SUNPRO_CC && !defined __RESTRICT
# define _Restrict
# define __restrict__
#endif])
case $ac_cv_c_restrict in
restrict) ;;
no) AC_DEFINE([restrict], []) ;;
*) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
esac
AC_MSG_CHECKING(for C99 variable-size arrays)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[[static int x; char a[++x]; a[sizeof a - 1] = 0; int N; return a[0];]])],
[ has_var_arrays=yes
use_alloca="no (using var arrays)"
AC_DEFINE([VAR_ARRAYS], [1], [Use C99 variable-size arrays])
],[
has_var_arrays=no
])
AC_MSG_RESULT([$has_var_arrays])
AS_IF([test "$has_var_arrays" = "no"],
[
AC_CHECK_HEADERS([alloca.h])
AC_MSG_CHECKING(for alloca)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <alloca.h>]],
[[int foo=10; int *array = alloca(foo);]])],
[ use_alloca=yes;
AC_DEFINE([USE_ALLOCA], [], [Make use of alloca])
],[
use_alloca=no
])
AC_MSG_RESULT([$use_alloca])
])
LT_LIB_M
AC_ARG_ENABLE([fixed-point],
[AS_HELP_STRING([--enable-fixed-point],
[compile without floating point (for machines without a fast enough FPU)])],,
[enable_fixed_point=no])
AS_IF([test "$enable_fixed_point" = "yes"],[
enable_float="no"
AC_DEFINE([FIXED_POINT], [1], [Compile as fixed-point (for machines without a fast enough FPU)])
PC_BUILD="fixed-point"
],[
enable_float="yes";
PC_BUILD="floating-point"
])
AM_CONDITIONAL([FIXED_POINT], [test "$enable_fixed_point" = "yes"])
AC_ARG_ENABLE([fixed-point-debug],
[AS_HELP_STRING([--enable-fixed-point-debug], [debug fixed-point implementation])],,
[enable_fixed_point_debug=no])
AS_IF([test "$enable_fixed_point_debug" = "yes"],[
AC_DEFINE([FIXED_DEBUG], [1], [Debug fixed-point implementation])
])
AC_ARG_ENABLE([float_api],
[AS_HELP_STRING([--disable-float-api],
[compile without the floating point API (for machines with no float library)])],,
[enable_float_api=yes])
AM_CONDITIONAL([DISABLE_FLOAT_API], [test "$enable_float_api" = "no"])
AS_IF([test "$enable_float_api" = "no"],[
AC_DEFINE([DISABLE_FLOAT_API], [1], [Do not build the float API])
])
AC_ARG_ENABLE([custom-modes],
[AS_HELP_STRING([--enable-custom-modes], [enable non-Opus modes, e.g. 44.1 kHz & 2^n frames])],,
[enable_custom_modes=no])
AS_IF([test "$enable_custom_modes" = "yes"],[
AC_DEFINE([CUSTOM_MODES], [1], [Custom modes])
PC_BUILD="$PC_BUILD, custom modes"
])
AM_CONDITIONAL([CUSTOM_MODES], [test "$enable_custom_modes" = "yes"])
has_float_approx=yes
enable_float_approx=yes
#case "$host_cpu" in
#i[[3456]]86 | x86_64 | powerpc64 | powerpc32 | ia64)
# has_float_approx=yes
# ;;
#esac
AC_ARG_ENABLE([float-approx],
[AS_HELP_STRING([--enable-float-approx], [enable fast approximations for floating point])],
[if test "$enable_float_approx" = "yes"; then
AC_WARN([Floating point approximations are not supported on all platforms.])
fi
],
[enable_float_approx=$has_float_approx])
AS_IF([test "$enable_float_approx" = "yes"],[
AC_DEFINE([FLOAT_APPROX], [1], [Float approximations])
])
AC_ARG_ENABLE([asm],
[AS_HELP_STRING([--disable-asm], [Disable assembly optimizations])],,
[enable_asm=yes])
AC_ARG_ENABLE([rtcd],
[AS_HELP_STRING([--disable-rtcd], [Disable run-time CPU capabilities detection])],,
[enable_rtcd=yes])
AC_ARG_ENABLE([intrinsics],
[AS_HELP_STRING([--disable-intrinsics], [Disable intrinsics optimizations])],,
[enable_intrinsics=yes])
rtcd_support=no
cpu_arm=no
cpu_x86=no
AS_IF([test x"${enable_asm}" = x"yes"],[
inline_optimization="No inline ASM for your platform, please send patches"
case $host_cpu in
arm*)
dnl Currently we only have asm for fixed-point
AS_IF([test "$enable_float" != "yes"],[
cpu_arm=yes
AC_DEFINE([OPUS_ARM_ASM], [], [Make use of ARM asm optimization])
AS_GCC_INLINE_ASSEMBLY(
[inline_optimization="ARM"],
[inline_optimization="disabled"]
)
AS_ASM_ARM_EDSP([OPUS_ARM_INLINE_EDSP=1],[OPUS_ARM_INLINE_EDSP=0])
AS_ASM_ARM_MEDIA([OPUS_ARM_INLINE_MEDIA=1],
[OPUS_ARM_INLINE_MEDIA=0])
AS_ASM_ARM_NEON([OPUS_ARM_INLINE_NEON=1],[OPUS_ARM_INLINE_NEON=0])
AS_IF([test x"$inline_optimization" = x"ARM"],[
AM_CONDITIONAL([OPUS_ARM_INLINE_ASM],[true])
AC_DEFINE([OPUS_ARM_INLINE_ASM], 1,
[Use generic ARMv4 inline asm optimizations])
AS_IF([test x"$OPUS_ARM_INLINE_EDSP" = x"1"],[
AC_DEFINE([OPUS_ARM_INLINE_EDSP], [1],
[Use ARMv5E inline asm optimizations])
inline_optimization="$inline_optimization (EDSP)"
])
AS_IF([test x"$OPUS_ARM_INLINE_MEDIA" = x"1"],[
AC_DEFINE([OPUS_ARM_INLINE_MEDIA], [1],
[Use ARMv6 inline asm optimizations])
inline_optimization="$inline_optimization (Media)"
])
AS_IF([test x"$OPUS_ARM_INLINE_NEON" = x"1"],[
AC_DEFINE([OPUS_ARM_INLINE_NEON], 1,
[Use ARM NEON inline asm optimizations])
inline_optimization="$inline_optimization (NEON)"
])
])
dnl We need Perl to translate RVCT-syntax asm to gas syntax.
AC_CHECK_PROG([HAVE_PERL], perl, yes, no)
AS_IF([test x"$HAVE_PERL" = x"yes"],[
AM_CONDITIONAL([OPUS_ARM_EXTERNAL_ASM],[true])
asm_optimization="ARM"
AS_IF([test x"$OPUS_ARM_INLINE_EDSP" = x"1"], [
OPUS_ARM_PRESUME_EDSP=1
OPUS_ARM_MAY_HAVE_EDSP=1
],
[
OPUS_ARM_PRESUME_EDSP=0
OPUS_ARM_MAY_HAVE_EDSP=0
])
AS_IF([test x"$OPUS_ARM_INLINE_MEDIA" = x"1"], [
OPUS_ARM_PRESUME_MEDIA=1
OPUS_ARM_MAY_HAVE_MEDIA=1
],
[
OPUS_ARM_PRESUME_MEDIA=0
OPUS_ARM_MAY_HAVE_MEDIA=0
])
AS_IF([test x"$OPUS_ARM_INLINE_NEON" = x"1"], [
OPUS_ARM_PRESUME_NEON=1
OPUS_ARM_MAY_HAVE_NEON=1
],
[
OPUS_ARM_PRESUME_NEON=0
OPUS_ARM_MAY_HAVE_NEON=0
])
AS_IF([test x"$enable_rtcd" = x"yes"],[
AS_IF([test x"$OPUS_ARM_MAY_HAVE_EDSP" != x"1"],[
AC_MSG_NOTICE(
[Trying to force-enable armv5e EDSP instructions...])
AS_ASM_ARM_EDSP_FORCE([OPUS_ARM_MAY_HAVE_EDSP=1])
])
AS_IF([test x"$OPUS_ARM_MAY_HAVE_MEDIA" != x"1"],[
AC_MSG_NOTICE(
[Trying to force-enable ARMv6 media instructions...])
AS_ASM_ARM_MEDIA_FORCE([OPUS_ARM_MAY_HAVE_MEDIA=1])
])
AS_IF([test x"$OPUS_ARM_MAY_HAVE_NEON" != x"1"],[
AC_MSG_NOTICE(
[Trying to force-enable NEON instructions...])
AS_ASM_ARM_NEON_FORCE([OPUS_ARM_MAY_HAVE_NEON=1])
])
])
rtcd_support=
AS_IF([test x"$OPUS_ARM_MAY_HAVE_EDSP" = x"1"],[
AC_DEFINE(OPUS_ARM_MAY_HAVE_EDSP, 1,
[Define if assembler supports EDSP instructions])
AS_IF([test x"$OPUS_ARM_PRESUME_EDSP" = x"1"],[
AC_DEFINE(OPUS_ARM_PRESUME_EDSP, 1,
[Define if binary requires EDSP instruction support])
asm_optimization="$asm_optimization (EDSP)"
],
[rtcd_support="$rtcd_support (EDSP)"]
)
])
AC_SUBST(OPUS_ARM_MAY_HAVE_EDSP)
AS_IF([test x"$OPUS_ARM_MAY_HAVE_MEDIA" = x"1"],[
AC_DEFINE(OPUS_ARM_MAY_HAVE_MEDIA, 1,
[Define if assembler supports ARMv6 media instructions])
AS_IF([test x"$OPUS_ARM_PRESUME_MEDIA" = x"1"],[
AC_DEFINE(OPUS_ARM_PRESUME_MEDIA, 1,
[Define if binary requires ARMv6 media instruction support])
asm_optimization="$asm_optimization (Media)"
],
[rtcd_support="$rtcd_support (Media)"]
)
])
AC_SUBST(OPUS_ARM_MAY_HAVE_MEDIA)
AS_IF([test x"$OPUS_ARM_MAY_HAVE_NEON" = x"1"],[
AC_DEFINE(OPUS_ARM_MAY_HAVE_NEON, 1,
[Define if compiler supports NEON instructions])
AS_IF([test x"$OPUS_ARM_PRESUME_NEON" = x"1"], [
AC_DEFINE(OPUS_ARM_PRESUME_NEON, 1,
[Define if binary requires NEON instruction support])
asm_optimization="$asm_optimization (NEON)"
],
[rtcd_support="$rtcd_support (NEON)"]
)
])
AC_SUBST(OPUS_ARM_MAY_HAVE_NEON)
dnl Make sure turning on RTCD gets us at least one
dnl instruction set.
AS_IF([test x"$rtcd_support" != x""],
[rtcd_support=ARM"$rtcd_support"],
[rtcd_support="no"]
)
AC_MSG_CHECKING([for apple style tools])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
#ifndef __APPLE__
#error 1
#endif],[])],
[AC_MSG_RESULT([yes]); ARM2GNU_PARAMS="--apple"],
[AC_MSG_RESULT([no]); ARM2GNU_PARAMS=""])
AC_SUBST(ARM2GNU_PARAMS)
],
[
AC_MSG_WARN(
[*** ARM assembly requires perl -- disabling optimizations])
asm_optimization="(missing perl dependency for ARM)"
])
])
;;
esac
],[
inline_optimization="disabled"
asm_optimization="disabled"
])
AM_CONDITIONAL([OPUS_ARM_INLINE_ASM],
[test x"${inline_optimization%% *}" = x"ARM"])
AM_CONDITIONAL([OPUS_ARM_EXTERNAL_ASM],
[test x"${asm_optimization%% *}" = x"ARM"])
AM_CONDITIONAL([HAVE_SSE], [false])
AM_CONDITIONAL([HAVE_SSE2], [false])
AM_CONDITIONAL([HAVE_SSE4_1], [false])
AM_CONDITIONAL([HAVE_AVX], [false])
m4_define([DEFAULT_X86_SSE_CFLAGS], [-msse])
m4_define([DEFAULT_X86_SSE2_CFLAGS], [-msse2])
m4_define([DEFAULT_X86_SSE4_1_CFLAGS], [-msse4.1])
m4_define([DEFAULT_X86_AVX_CFLAGS], [-mavx])
m4_define([DEFAULT_ARM_NEON_INTR_CFLAGS], [-mfpu=neon])
# With GCC on ARM32 softfp architectures (e.g. Android, or older Ubuntu) you need to specify
# -mfloat-abi=softfp for -mfpu=neon to work. However, on ARM32 hardfp architectures (e.g. newer Ubuntu),
# this option will break things.
# As a heuristic, if host matches arm*eabi* but not arm*hf*, it's probably soft-float.
m4_define([DEFAULT_ARM_NEON_SOFTFP_INTR_CFLAGS], [-mfpu=neon -mfloat-abi=softfp])
AS_CASE([$host],
[arm*hf*], [AS_VAR_SET([RESOLVED_DEFAULT_ARM_NEON_INTR_CFLAGS], "DEFAULT_ARM_NEON_INTR_CFLAGS")],
[arm*eabi*], [AS_VAR_SET([RESOLVED_DEFAULT_ARM_NEON_INTR_CFLAGS], "DEFAULT_ARM_NEON_SOFTFP_INTR_CFLAGS")],
[AS_VAR_SET([RESOLVED_DEFAULT_ARM_NEON_INTR_CFLAGS], "DEFAULT_ARM_NEON_INTR_CFLAGS")])
AC_ARG_VAR([X86_SSE_CFLAGS], [C compiler flags to compile SSE intrinsics @<:@default=]DEFAULT_X86_SSE_CFLAGS[@:>@])
AC_ARG_VAR([X86_SSE2_CFLAGS], [C compiler flags to compile SSE2 intrinsics @<:@default=]DEFAULT_X86_SSE2_CFLAGS[@:>@])
AC_ARG_VAR([X86_SSE4_1_CFLAGS], [C compiler flags to compile SSE4.1 intrinsics @<:@default=]DEFAULT_X86_SSE4_1_CFLAGS[@:>@])
AC_ARG_VAR([X86_AVX_CFLAGS], [C compiler flags to compile AVX intrinsics @<:@default=]DEFAULT_X86_AVX_CFLAGS[@:>@])
AC_ARG_VAR([ARM_NEON_INTR_CFLAGS], [C compiler flags to compile ARM NEON intrinsics @<:@default=]DEFAULT_ARM_NEON_INTR_CFLAGS / DEFAULT_ARM_NEON_SOFTFP_INTR_CFLAGS[@:>@])
AS_VAR_SET_IF([X86_SSE_CFLAGS], [], [AS_VAR_SET([X86_SSE_CFLAGS], "DEFAULT_X86_SSE_CFLAGS")])
AS_VAR_SET_IF([X86_SSE2_CFLAGS], [], [AS_VAR_SET([X86_SSE2_CFLAGS], "DEFAULT_X86_SSE2_CFLAGS")])
AS_VAR_SET_IF([X86_SSE4_1_CFLAGS], [], [AS_VAR_SET([X86_SSE4_1_CFLAGS], "DEFAULT_X86_SSE4_1_CFLAGS")])
AS_VAR_SET_IF([X86_AVX_CFLAGS], [], [AS_VAR_SET([X86_AVX_CFLAGS], "DEFAULT_X86_AVX_CFLAGS")])
AS_VAR_SET_IF([ARM_NEON_INTR_CFLAGS], [], [AS_VAR_SET([ARM_NEON_INTR_CFLAGS], ["$RESOLVED_DEFAULT_ARM_NEON_INTR_CFLAGS"])])
AC_DEFUN([OPUS_PATH_NE10],
[
AC_ARG_WITH(NE10,
AC_HELP_STRING([--with-NE10=PFX],[Prefix where libNE10 is installed (optional)]),
NE10_prefix="$withval", NE10_prefix="")
AC_ARG_WITH(NE10-libraries,
AC_HELP_STRING([--with-NE10-libraries=DIR],
[Directory where libNE10 library is installed (optional)]),
NE10_libraries="$withval", NE10_libraries="")
AC_ARG_WITH(NE10-includes,
AC_HELP_STRING([--with-NE10-includes=DIR],
[Directory where libNE10 header files are installed (optional)]),
NE10_includes="$withval", NE10_includes="")
if test "x$NE10_libraries" != "x" ; then
NE10_LIBS="-L$NE10_libraries"
elif test "x$NE10_prefix" = "xno" || test "x$NE10_prefix" = "xyes" ; then
NE10_LIBS=""
elif test "x$NE10_prefix" != "x" ; then
NE10_LIBS="-L$NE10_prefix/lib"
elif test "x$prefix" != "xNONE" ; then
NE10_LIBS="-L$prefix/lib"
fi
if test "x$NE10_prefix" != "xno" ; then
NE10_LIBS="$NE10_LIBS -lNE10"
fi
if test "x$NE10_includes" != "x" ; then
NE10_CFLAGS="-I$NE10_includes"
elif test "x$NE10_prefix" = "xno" || test "x$NE10_prefix" = "xyes" ; then
NE10_CFLAGS=""
elif test "x$NE10_prefix" != "x" ; then
NE10_CFLAGS="-I$NE10_prefix/include"
elif test "x$prefix" != "xNONE"; then
NE10_CFLAGS="-I$prefix/include"
fi
AC_MSG_CHECKING(for NE10)
save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS $NE10_CFLAGS"
save_LIBS="$LIBS"; LIBS="$LIBS $NE10_LIBS $LIBM"
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <NE10_dsp.h>
]],
[[
ne10_fft_cfg_float32_t cfg;
cfg = ne10_fft_alloc_c2c_float32_neon(480);
]]
)
],[
HAVE_ARM_NE10=1
AC_MSG_RESULT([yes])
],[
HAVE_ARM_NE10=0
AC_MSG_RESULT([no])
NE10_CFLAGS=""
NE10_LIBS=""
]
)
CFLAGS="$save_CFLAGS"; LIBS="$save_LIBS"
#Now we know if libNE10 is installed or not
AS_IF([test x"$HAVE_ARM_NE10" = x"1"],
[
AC_DEFINE([HAVE_ARM_NE10], 1, [NE10 library is installed on host. Make sure it is on target!])
AC_SUBST(HAVE_ARM_NE10)
AC_SUBST(NE10_CFLAGS)
AC_SUBST(NE10_LIBS)
]
)
]
)
AS_IF([test x"$enable_intrinsics" = x"yes"],[
intrinsics_support=""
AS_CASE([$host_cpu],
[arm*|aarch64*],
[
cpu_arm=yes
OPUS_CHECK_INTRINSICS(
[ARM Neon],
[$ARM_NEON_INTR_CFLAGS],
[OPUS_ARM_MAY_HAVE_NEON_INTR],
[OPUS_ARM_PRESUME_NEON_INTR],
[[#include <arm_neon.h>
]],
[[
static float32x4_t A0, A1, SUMM;
SUMM = vmlaq_f32(SUMM, A0, A1);
return (int)vgetq_lane_f32(SUMM, 0);
]]
)
AS_IF([test x"$OPUS_ARM_MAY_HAVE_NEON_INTR" = x"1" && test x"$OPUS_ARM_PRESUME_NEON_INTR" != x"1"],
[
OPUS_ARM_NEON_INTR_CFLAGS="$ARM_NEON_INTR_CFLAGS"
AC_SUBST([OPUS_ARM_NEON_INTR_CFLAGS])
]
)
AS_IF([test x"$OPUS_ARM_MAY_HAVE_NEON_INTR" = x"1"],
[
AC_DEFINE([OPUS_ARM_MAY_HAVE_NEON_INTR], 1, [Compiler supports ARMv7/Aarch64 Neon Intrinsics])
intrinsics_support="$intrinsics_support (NEON)"
AS_IF([test x"$enable_rtcd" != x"no" && test x"$OPUS_ARM_PRESUME_NEON_INTR" != x"1"],
[AS_IF([test x"$rtcd_support" = x"no"],
[rtcd_support="ARM (NEON Intrinsics)"],
[rtcd_support="$rtcd_support (NEON Intrinsics)"])])
AS_IF([test x"$OPUS_ARM_PRESUME_NEON_INTR" = x"1"],
[AC_DEFINE([OPUS_ARM_PRESUME_NEON_INTR], 1, [Define if binary requires NEON intrinsics support])])
OPUS_PATH_NE10()
AS_IF([test x"$NE10_LIBS" != x""],
[
intrinsics_support="$intrinsics_support (NE10)"
AS_IF([test x"enable_rtcd" != x"" \
&& test x"$OPUS_ARM_PRESUME_NEON_INTR" != x"1"],
[rtcd_support="$rtcd_support (NE10)"])
])
OPUS_CHECK_INTRINSICS(
[Aarch64 Neon],
[$ARM_NEON_INTR_CFLAGS],
[OPUS_ARM_MAY_HAVE_AARCH64_NEON_INTR],
[OPUS_ARM_PRESUME_AARCH64_NEON_INTR],
[[#include <arm_neon.h>
]],
[[
static int32_t IN;
static int16_t OUT;
OUT = vqmovns_s32(IN);
]]
)
AS_IF([test x"$OPUS_ARM_PRESUME_AARCH64_NEON_INTR" = x"1"],
[
AC_DEFINE([OPUS_ARM_PRESUME_AARCH64_NEON_INTR], 1, [Define if binary requires Aarch64 Neon Intrinsics])
intrinsics_support="$intrinsics_support (NEON [Aarch64])"
])
AS_IF([test x"$intrinsics_support" = x""],
[intrinsics_support=no],
[intrinsics_support="ARM$intrinsics_support"])
],
[
AC_MSG_WARN([Compiler does not support ARM intrinsics])
intrinsics_support=no
])
],
[i?86|x86_64],
[
cpu_x86=yes
OPUS_CHECK_INTRINSICS(
[SSE],
[$X86_SSE_CFLAGS],
[OPUS_X86_MAY_HAVE_SSE],
[OPUS_X86_PRESUME_SSE],
[[#include <xmmintrin.h>
#include <time.h>
]],
[[
__m128 mtest;
mtest = _mm_set1_ps((float)time(NULL));
mtest = _mm_mul_ps(mtest, mtest);
return _mm_cvtss_si32(mtest);
]]
)
AS_IF([test x"$OPUS_X86_MAY_HAVE_SSE" = x"1" && test x"$OPUS_X86_PRESUME_SSE" != x"1"],
[
OPUS_X86_SSE_CFLAGS="$X86_SSE_CFLAGS"
AC_SUBST([OPUS_X86_SSE_CFLAGS])
]
)
OPUS_CHECK_INTRINSICS(
[SSE2],
[$X86_SSE2_CFLAGS],
[OPUS_X86_MAY_HAVE_SSE2],
[OPUS_X86_PRESUME_SSE2],
[[#include <emmintrin.h>
#include <time.h>
]],
[[
__m128i mtest;
mtest = _mm_set1_epi32((int)time(NULL));
mtest = _mm_mul_epu32(mtest, mtest);
return _mm_cvtsi128_si32(mtest);
]]
)
AS_IF([test x"$OPUS_X86_MAY_HAVE_SSE2" = x"1" && test x"$OPUS_X86_PRESUME_SSE2" != x"1"],
[
OPUS_X86_SSE2_CFLAGS="$X86_SSE2_CFLAGS"
AC_SUBST([OPUS_X86_SSE2_CFLAGS])
]
)
OPUS_CHECK_INTRINSICS(
[SSE4.1],
[$X86_SSE4_1_CFLAGS],
[OPUS_X86_MAY_HAVE_SSE4_1],
[OPUS_X86_PRESUME_SSE4_1],
[[#include <smmintrin.h>
#include <time.h>
]],
[[
__m128i mtest;
mtest = _mm_set1_epi32((int)time(NULL));
mtest = _mm_mul_epi32(mtest, mtest);
return _mm_cvtsi128_si32(mtest);
]]
)
AS_IF([test x"$OPUS_X86_MAY_HAVE_SSE4_1" = x"1" && test x"$OPUS_X86_PRESUME_SSE4_1" != x"1"],
[
OPUS_X86_SSE4_1_CFLAGS="$X86_SSE4_1_CFLAGS"
AC_SUBST([OPUS_X86_SSE4_1_CFLAGS])
]
)
OPUS_CHECK_INTRINSICS(
[AVX],
[$X86_AVX_CFLAGS],
[OPUS_X86_MAY_HAVE_AVX],
[OPUS_X86_PRESUME_AVX],
[[#include <immintrin.h>
#include <time.h>
]],
[[
__m256 mtest;
mtest = _mm256_set1_ps((float)time(NULL));
mtest = _mm256_addsub_ps(mtest, mtest);
return _mm_cvtss_si32(_mm256_extractf128_ps(mtest, 0));
]]
)
AS_IF([test x"$OPUS_X86_MAY_HAVE_AVX" = x"1" && test x"$OPUS_X86_PRESUME_AVX" != x"1"],
[
OPUS_X86_AVX_CFLAGS="$X86_AVX_CFLAGS"
AC_SUBST([OPUS_X86_AVX_CFLAGS])
]
)
AS_IF([test x"$rtcd_support" = x"no"], [rtcd_support=""])
AS_IF([test x"$OPUS_X86_MAY_HAVE_SSE" = x"1"],
[
AC_DEFINE([OPUS_X86_MAY_HAVE_SSE], 1, [Compiler supports X86 SSE Intrinsics])
intrinsics_support="$intrinsics_support SSE"
AS_IF([test x"$OPUS_X86_PRESUME_SSE" = x"1"],
[AC_DEFINE([OPUS_X86_PRESUME_SSE], 1, [Define if binary requires SSE intrinsics support])],
[rtcd_support="$rtcd_support SSE"])
],
[
AC_MSG_WARN([Compiler does not support SSE intrinsics])
])
AS_IF([test x"$OPUS_X86_MAY_HAVE_SSE2" = x"1"],
[
AC_DEFINE([OPUS_X86_MAY_HAVE_SSE2], 1, [Compiler supports X86 SSE2 Intrinsics])
intrinsics_support="$intrinsics_support SSE2"
AS_IF([test x"$OPUS_X86_PRESUME_SSE2" = x"1"],
[AC_DEFINE([OPUS_X86_PRESUME_SSE2], 1, [Define if binary requires SSE2 intrinsics support])],
[rtcd_support="$rtcd_support SSE2"])
],
[
AC_MSG_WARN([Compiler does not support SSE2 intrinsics])
])
AS_IF([test x"$OPUS_X86_MAY_HAVE_SSE4_1" = x"1"],
[
AC_DEFINE([OPUS_X86_MAY_HAVE_SSE4_1], 1, [Compiler supports X86 SSE4.1 Intrinsics])
intrinsics_support="$intrinsics_support SSE4.1"
AS_IF([test x"$OPUS_X86_PRESUME_SSE4_1" = x"1"],
[AC_DEFINE([OPUS_X86_PRESUME_SSE4_1], 1, [Define if binary requires SSE4.1 intrinsics support])],
[rtcd_support="$rtcd_support SSE4.1"])
],
[
AC_MSG_WARN([Compiler does not support SSE4.1 intrinsics])
])
AS_IF([test x"$OPUS_X86_MAY_HAVE_AVX" = x"1"],
[
AC_DEFINE([OPUS_X86_MAY_HAVE_AVX], 1, [Compiler supports X86 AVX Intrinsics])
intrinsics_support="$intrinsics_support AVX"
AS_IF([test x"$OPUS_X86_PRESUME_AVX" = x"1"],
[AC_DEFINE([OPUS_X86_PRESUME_AVX], 1, [Define if binary requires AVX intrinsics support])],
[rtcd_support="$rtcd_support AVX"])
],
[
AC_MSG_WARN([Compiler does not support AVX intrinsics])
])
AS_IF([test x"$intrinsics_support" = x""],
[intrinsics_support=no],
[intrinsics_support="x86$intrinsics_support"]
)
AS_IF([test x"$rtcd_support" = x""],
[rtcd_support=no],
[rtcd_support="x86$rtcd_support"],
)
AS_IF([test x"$enable_rtcd" = x"yes" && test x"$rtcd_support" != x""],[
get_cpuid_by_asm="no"
AC_MSG_CHECKING([How to get X86 CPU Info])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
]],[[
unsigned int CPUInfo0;
unsigned int CPUInfo1;
unsigned int CPUInfo2;
unsigned int CPUInfo3;
unsigned int InfoType;
#if defined(__i386__) && defined(__PIC__)
__asm__ __volatile__ (
"xchg %%ebx, %1\n"
"cpuid\n"
"xchg %%ebx, %1\n":
"=a" (CPUInfo0),
"=r" (CPUInfo1),
"=c" (CPUInfo2),
"=d" (CPUInfo3) :
"a" (InfoType), "c" (0)
);
#else
__asm__ __volatile__ (
"cpuid":
"=a" (CPUInfo0),
"=b" (CPUInfo1),
"=c" (CPUInfo2),
"=d" (CPUInfo3) :
"a" (InfoType), "c" (0)
);
#endif
]])],
[get_cpuid_by_asm="yes"
AC_MSG_RESULT([Inline Assembly])
AC_DEFINE([CPU_INFO_BY_ASM], [1], [Get CPU Info by asm method])],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <cpuid.h>
]],[[
unsigned int CPUInfo0;
unsigned int CPUInfo1;
unsigned int CPUInfo2;
unsigned int CPUInfo3;
unsigned int InfoType;
__get_cpuid_count(InfoType, 0, &CPUInfo0, &CPUInfo1, &CPUInfo2, &CPUInfo3);
]])],
[AC_MSG_RESULT([C method])
AC_DEFINE([CPU_INFO_BY_C], [1], [Get CPU Info by c method])],
[AC_MSG_ERROR([no supported Get CPU Info method, please disable run-time CPU capabilities detection or intrinsics])])])])
],
[
AC_MSG_WARN([No intrinsics support for your architecture])
intrinsics_support="no"
])
],
[
intrinsics_support="no"
])
AM_CONDITIONAL([CPU_ARM], [test "$cpu_arm" = "yes"])
AM_CONDITIONAL([HAVE_ARM_NEON_INTR],
[test x"$OPUS_ARM_MAY_HAVE_NEON_INTR" = x"1"])
AM_CONDITIONAL([HAVE_ARM_NE10],
[test x"$HAVE_ARM_NE10" = x"1"])
AM_CONDITIONAL([CPU_X86], [test "$cpu_x86" = "yes"])
AM_CONDITIONAL([HAVE_SSE],
[test x"$OPUS_X86_MAY_HAVE_SSE" = x"1"])
AM_CONDITIONAL([HAVE_SSE2],
[test x"$OPUS_X86_MAY_HAVE_SSE2" = x"1"])
AM_CONDITIONAL([HAVE_SSE4_1],
[test x"$OPUS_X86_MAY_HAVE_SSE4_1" = x"1"])
AM_CONDITIONAL([HAVE_AVX],
[test x"$OPUS_X86_MAY_HAVE_AVX" = x"1"])
AM_CONDITIONAL([HAVE_RTCD],
[test x"$enable_rtcd" = x"yes" -a x"$rtcd_support" != x"no"])
AS_IF([test x"$enable_rtcd" = x"yes"],[
AS_IF([test x"$rtcd_support" != x"no"],[
AC_DEFINE([OPUS_HAVE_RTCD], [1],
[Use run-time CPU capabilities detection])
OPUS_HAVE_RTCD=1
AC_SUBST(OPUS_HAVE_RTCD)
])
],[
rtcd_support="disabled"
])
AC_ARG_ENABLE([assertions],
[AS_HELP_STRING([--enable-assertions],[enable additional software error checking])],,
[enable_assertions=no])
AS_IF([test "$enable_assertions" = "yes"], [
AC_DEFINE([ENABLE_ASSERTIONS], [1], [Assertions])
])
AC_ARG_ENABLE([hardening],
[AS_HELP_STRING([--disable-hardening],[disable run-time checks that are cheap and safe for use in production])],,
[enable_hardening=yes])
AS_IF([test "$enable_hardening" = "yes"], [
AC_DEFINE([ENABLE_HARDENING], [1], [Hardening])
])
AC_ARG_ENABLE([fuzzing],
[AS_HELP_STRING([--enable-fuzzing],[causes the encoder to make random decisions (do not use in production)])],,
[enable_fuzzing=no])
AS_IF([test "$enable_fuzzing" = "yes"], [
AC_DEFINE([FUZZING], [1], [Fuzzing])
])
AC_ARG_ENABLE([check-asm],
[AS_HELP_STRING([--enable-check-asm],
[enable bit-exactness checks between optimized and c implementations])],,
[enable_check_asm=no])
AS_IF([test "$enable_check_asm" = "yes"], [
AC_DEFINE([OPUS_CHECK_ASM], [1], [Run bit-exactness checks between optimized and c implementations])
])
AC_ARG_ENABLE([doc],
[AS_HELP_STRING([--disable-doc], [Do not build API documentation])],,
[enable_doc=yes])
AS_IF([test "$enable_doc" = "yes"], [
AC_CHECK_PROG(HAVE_DOXYGEN, [doxygen], [yes], [no])
AC_CHECK_PROG(HAVE_DOT, [dot], [yes], [no])
],[
HAVE_DOXYGEN=no
])
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$HAVE_DOXYGEN" = "yes"])
AC_ARG_ENABLE([extra-programs],
[AS_HELP_STRING([--disable-extra-programs], [Do not build extra programs (demo and tests)])],,
[enable_extra_programs=yes])
AM_CONDITIONAL([EXTRA_PROGRAMS], [test "$enable_extra_programs" = "yes"])
AC_ARG_ENABLE([rfc8251],
AS_HELP_STRING([--disable-rfc8251], [Disable bitstream fixes from RFC 8251]),,
[enable_rfc8251=yes])
AS_IF([test "$enable_rfc8251" = "no"], [
AC_DEFINE([DISABLE_UPDATE_DRAFT], [1], [Disable bitstream fixes from RFC 8251])
])
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
[ AC_MSG_RESULT([yes]) ],
[ AC_MSG_RESULT([no])
CFLAGS="$saved_CFLAGS"
])
on_x86=no
case "$host_cpu" in
i[[3456]]86 | x86_64)
on_x86=yes
;;
esac
on_windows=no
case $host in
*cygwin*|*mingw*)
on_windows=yes
;;
esac
dnl Enable stack-protector-all only on x86 where it's well supported.
dnl on some platforms it causes crashes. Hopefully the OS's default's
dnl include this on platforms that work but have been missed here.
AC_ARG_ENABLE([stack-protector],
[AS_HELP_STRING([--disable-stack-protector],[Disable compiler stack hardening])],,
[
AS_IF([test "$ac_cv_c_compiler_gnu" = "yes" && test "$on_x86" = "yes" && test "$on_windows" = "no"],
[enable_stack_protector=yes],[enable_stack_protector=no])
])
AS_IF([test "$enable_stack_protector" = "yes"],
[
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fstack-protector-strong"
AC_MSG_CHECKING([if ${CC} supports -fstack-protector-strong])
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[[char foo;]])],
[ AC_MSG_RESULT([yes]) ],
[
AC_MSG_RESULT([no])
enable_stack_protector=no
CFLAGS="$saved_CFLAGS"
])
])
AS_IF([test x$ac_cv_c_compiler_gnu = xyes],
[AX_ADD_FORTIFY_SOURCE]
)
CFLAGS="$CFLAGS -W"
warn_CFLAGS="-Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes"
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $warn_CFLAGS"
AC_MSG_CHECKING([if ${CC} supports ${warn_CFLAGS}])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
[ AC_MSG_RESULT([yes]) ],
[ AC_MSG_RESULT([no])
CFLAGS="$saved_CFLAGS"
])
saved_LIBS="$LIBS"
LIBS="$LIBS $LIBM"
AC_CHECK_FUNCS([lrintf])
AC_CHECK_FUNCS([lrint])
LIBS="$saved_LIBS"
AC_CHECK_FUNCS([__malloc_hook])
AC_SUBST([PC_BUILD])
AC_CONFIG_FILES([
Makefile
opus.pc
opus-uninstalled.pc
celt/arm/armopts.s
doc/Makefile
doc/Doxyfile
])
AC_CONFIG_HEADERS([config.h])
AC_OUTPUT
AC_MSG_NOTICE([
------------------------------------------------------------------------
$PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK.
Compiler support:
C99 var arrays: ................ ${has_var_arrays}
C99 lrintf: .................... ${ac_cv_func_lrintf}
Use alloca: .................... ${use_alloca}
General configuration:
Floating point support: ........ ${enable_float}
Fast float approximations: ..... ${enable_float_approx}
Fixed point debugging: ......... ${enable_fixed_point_debug}
Inline Assembly Optimizations: . ${inline_optimization}
External Assembly Optimizations: ${asm_optimization}
Intrinsics Optimizations: ...... ${intrinsics_support}
Run-time CPU detection: ........ ${rtcd_support}
Custom modes: .................. ${enable_custom_modes}
Assertion checking: ............ ${enable_assertions}
Hardening: ..................... ${enable_hardening}
Fuzzing: ....................... ${enable_fuzzing}
Check ASM: ..................... ${enable_check_asm}
API documentation: ............. ${enable_doc}
Extra programs: ................ ${enable_extra_programs}
------------------------------------------------------------------------
Type "make; make install" to compile and install
Type "make check" to run the test suite
])

View File

@ -12,10 +12,6 @@ import("//build/config/riscv.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build_overrides/build.gni")
if (is_android) {
import("//build/config/android/rules.gni")
}
import("gni/snapshot_toolchain.gni")
import("gni/v8.gni")
@ -323,6 +319,10 @@ declare_args() {
# Sets -DV8_ENABLE_SANDBOX.
v8_enable_sandbox = ""
# Enable experimental code pointer sandboxing for the V8 sandbox.
# Sets -DV8_CODE_POINTER_SANDBOXING
v8_code_pointer_sandboxing = false
# Expose the memory corruption API to JavaScript. Useful for testing the sandbox.
# WARNING This will expose builtins that (by design) cause memory corruption.
# Sets -DV8_EXPOSE_MEMORY_CORRUPTION_API
@ -372,13 +372,6 @@ declare_args() {
# (incomplete and experimental).
v8_enable_cet_shadow_stack = false
# Get VMEX priviledge at startup.
# It allows to run V8 without "deprecated-ambient-replace-as-executable".
# Sets -DV8_USE_VMEX_RESOURCE.
# TODO(victorgomes): Remove this flag once Chormium no longer needs
# the deprecated feature.
v8_fuchsia_use_vmex_resource = is_fuchsia && !build_with_chromium
# Enables pointer compression for 8GB heaps.
# Sets -DV8_COMPRESS_POINTERS_8GB.
v8_enable_pointer_compression_8gb = ""
@ -397,6 +390,10 @@ declare_args() {
# iOS (non-simulator) does not have executable pages for 3rd party
# applications yet so disable jit.
v8_jitless = v8_enable_lite_mode || target_is_ios_device
# Enable Maglev's graph printer.
# Sets -DV8_MAGLEV_GRAPH_PRINTER.
v8_enable_maglev_graph_printer = !build_with_chromium
}
# Derived defaults.
@ -476,13 +473,13 @@ if (v8_enable_short_builtin_calls == "") {
if (v8_enable_external_code_space == "") {
v8_enable_external_code_space =
v8_enable_pointer_compression &&
(v8_current_cpu == "x64" ||
(target_os != "fuchsia" && v8_current_cpu == "arm64"))
(v8_current_cpu == "x64" || v8_current_cpu == "arm64")
}
if (v8_enable_maglev == "") {
v8_enable_maglev = v8_enable_turbofan &&
(v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression
(v8_current_cpu == "arm" ||
((v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression))
}
assert(v8_enable_turbofan || !v8_enable_maglev,
"Maglev is not available when Turbofan is disabled.")
@ -645,6 +642,9 @@ assert(!v8_enable_sandbox || v8_enable_pointer_compression_shared_cage,
assert(!v8_enable_sandbox || v8_enable_external_code_space,
"The sandbox requires the external code space")
assert(!v8_code_pointer_sandboxing || v8_enable_sandbox,
"Code pointer sandboxing requires the sandbox")
assert(!v8_expose_memory_corruption_api || v8_enable_sandbox,
"The Memory Corruption API requires the sandbox")
@ -678,10 +678,6 @@ if (v8_enable_single_generation == true) {
"Requires unconditional write barriers or none (which disables incremental marking)")
}
if (v8_fuchsia_use_vmex_resource) {
assert(target_os == "fuchsia", "VMEX resource only available on Fuchsia")
}
assert(!v8_enable_snapshot_compression || v8_use_zlib,
"Snapshot compression requires zlib")
@ -724,7 +720,9 @@ config("internal_config") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -796,7 +794,9 @@ config("external_config") {
}
if (current_cpu == "riscv64" || current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -1142,9 +1142,6 @@ config("features") {
if (v8_advanced_bigint_algorithms) {
defines += [ "V8_ADVANCED_BIGINT_ALGORITHMS" ]
}
if (v8_fuchsia_use_vmex_resource) {
defines += [ "V8_USE_VMEX_RESOURCE" ]
}
if (v8_expose_memory_corruption_api) {
defines += [ "V8_EXPOSE_MEMORY_CORRUPTION_API" ]
}
@ -1169,6 +1166,12 @@ config("features") {
if (v8_enable_wasm_simd256_revec) {
defines += [ "V8_ENABLE_WASM_SIMD256_REVEC" ]
}
if (v8_code_pointer_sandboxing) {
defines += [ "V8_CODE_POINTER_SANDBOXING" ]
}
if (v8_enable_maglev_graph_printer) {
defines += [ "V8_ENABLE_MAGLEV_GRAPH_PRINTER" ]
}
}
config("toolchain") {
@ -1313,6 +1316,12 @@ config("toolchain") {
defines += [ "V8_TARGET_ARCH_RISCV32" ]
defines += [ "__riscv_xlen=32" ]
defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
# TODO(riscv32): Add condition riscv_use_rvv and riscv_rvv_vlen here after
# 4538202 merge.
if (target_is_simulator) {
defines += [ "CAN_USE_RVV_INSTRUCTIONS" ]
}
}
if (v8_current_cpu == "x86") {
@ -1331,7 +1340,7 @@ config("toolchain") {
cflags += [ "/O2", "/arch:AVX2" ]
ldflags += [ "/STACK:2097152" ]
}
if (is_linux) {
if (is_linux || is_chromeos) {
# Full optimization for V8.
cflags += [ "-O3", "-mavx2", "-maes" ]
ldflags += [ "-Wl,-O3", "-mavx2", "-maes" ]
@ -1339,7 +1348,6 @@ config("toolchain") {
}
if (is_android && v8_android_log_stdout) {
defines += [ "V8_ANDROID_LOG_STDOUT" ]
cflags += [ "-O3" ]
}
# V8_TARGET_OS_ defines. The target OS may differ from host OS e.g. in
@ -1408,15 +1416,18 @@ config("toolchain") {
"-Wmissing-field-initializers",
"-Wunreachable-code",
# Google3 enables this warning, so we should also enable it to find issue
# earlier. See https://reviews.llvm.org/D56731 for details about this
# warning.
"-Wctad-maybe-unsupported",
# TODO(v8:12245): Fix shadowing instances and remove.
"-Wno-shadow",
]
# TODO(fuchsia:127411): Re-enable once FIDL bindings are compatible.
if (!is_fuchsia) {
# Google3 enables this warning, so we should also enable it to find issue
# earlier. See https://reviews.llvm.org/D56731 for details about this
# warning.
cflags += [ "-Wctad-maybe-unsupported" ]
}
if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
v8_current_cpu == "mips64el" || v8_current_cpu == "riscv64") {
cflags += [ "-Wshorten-64-to-32" ]
@ -1760,6 +1771,7 @@ if (v8_postmortem_support) {
"src/objects/string-inl.h",
"src/objects/struct.h",
"src/objects/struct-inl.h",
"src/objects/tagged.h",
]
outputs = [ "$target_gen_dir/debug-support.cc" ]
@ -1826,9 +1838,11 @@ torque_files = [
"src/builtins/iterator.tq",
"src/builtins/iterator-from.tq",
"src/builtins/iterator-helpers.tq",
"src/builtins/map-groupby.tq",
"src/builtins/math.tq",
"src/builtins/number.tq",
"src/builtins/object-fromentries.tq",
"src/builtins/object-groupby.tq",
"src/builtins/object.tq",
"src/builtins/promise-abstract-operations.tq",
"src/builtins/promise-all.tq",
@ -1864,6 +1878,8 @@ torque_files = [
"src/builtins/regexp-split.tq",
"src/builtins/regexp-test.tq",
"src/builtins/regexp.tq",
"src/builtins/set-intersection.tq",
"src/builtins/set-union.tq",
"src/builtins/string-at.tq",
"src/builtins/string-endswith.tq",
"src/builtins/string-html.tq",
@ -2003,6 +2019,7 @@ if (v8_enable_i18n_support) {
if (v8_enable_webassembly) {
torque_files += [
"src/builtins/js-to-wasm.tq",
"src/builtins/wasm.tq",
"src/debug/debug-wasm-objects.tq",
"src/wasm/wasm-objects.tq",
@ -3082,6 +3099,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/js-create-lowering.h",
"src/compiler/js-generic-lowering.h",
"src/compiler/js-graph.h",
"src/compiler/js-heap-broker-inl.h",
"src/compiler/js-heap-broker.h",
"src/compiler/js-inlining-heuristic.h",
"src/compiler/js-inlining.h",
@ -3181,7 +3199,6 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/store-store-elimination-phase.h",
"src/compiler/turboshaft/store-store-elimination-reducer.h",
"src/compiler/turboshaft/structural-optimization-reducer.h",
"src/compiler/turboshaft/tag-untag-lowering-reducer.h",
"src/compiler/turboshaft/tracing.h",
"src/compiler/turboshaft/type-assertions-phase.h",
"src/compiler/turboshaft/type-inference-analysis.h",
@ -3361,6 +3378,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/marking-worklist.h",
"src/heap/marking.h",
"src/heap/memory-allocator.h",
"src/heap/memory-balancer.h",
"src/heap/memory-chunk-inl.h",
"src/heap/memory-chunk-layout.h",
"src/heap/memory-chunk.h",
@ -3377,6 +3395,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/paged-spaces-inl.h",
"src/heap/paged-spaces.h",
"src/heap/parallel-work-item.h",
"src/heap/parked-scope-inl.h",
"src/heap/parked-scope.h",
"src/heap/pretenuring-handler-inl.h",
"src/heap/pretenuring-handler.h",
@ -3649,6 +3668,7 @@ v8_header_set("v8_internal_headers") {
"src/objects/tagged-index.h",
"src/objects/tagged-value-inl.h",
"src/objects/tagged-value.h",
"src/objects/tagged.h",
"src/objects/template-objects-inl.h",
"src/objects/template-objects.h",
"src/objects/templates-inl.h",
@ -3733,6 +3753,10 @@ v8_header_set("v8_internal_headers") {
"src/runtime/runtime.h",
"src/sandbox/bounded-size-inl.h",
"src/sandbox/bounded-size.h",
"src/sandbox/code-pointer-inl.h",
"src/sandbox/code-pointer-table-inl.h",
"src/sandbox/code-pointer-table.h",
"src/sandbox/code-pointer.h",
"src/sandbox/external-entity-table-inl.h",
"src/sandbox/external-entity-table.h",
"src/sandbox/external-pointer-inl.h",
@ -3752,6 +3776,7 @@ v8_header_set("v8_internal_headers") {
"src/snapshot/embedded/embedded-file-writer-interface.h",
"src/snapshot/object-deserializer.h",
"src/snapshot/read-only-deserializer.h",
"src/snapshot/read-only-serializer-deserializer.h",
"src/snapshot/read-only-serializer.h",
"src/snapshot/references.h",
"src/snapshot/roots-serializer.h",
@ -3856,7 +3881,9 @@ v8_header_set("v8_internal_headers") {
"src/maglev/maglev-register-frame-array.h",
"src/maglev/maglev.h",
]
if (v8_current_cpu == "arm64") {
if (v8_current_cpu == "arm") {
sources += [ "src/maglev/arm/maglev-assembler-arm-inl.h" ]
} else if (v8_current_cpu == "arm64") {
sources += [ "src/maglev/arm64/maglev-assembler-arm64-inl.h" ]
} else if (v8_current_cpu == "x64") {
sources += [ "src/maglev/x64/maglev-assembler-x64-inl.h" ]
@ -3871,6 +3898,7 @@ v8_header_set("v8_internal_headers") {
"src/asmjs/asm-scanner.h",
"src/asmjs/asm-types.h",
"src/compiler/int64-lowering.h",
"src/compiler/turboshaft/wasm-js-lowering-reducer.h",
"src/compiler/wasm-address-reassociation.h",
"src/compiler/wasm-call-descriptors.h",
"src/compiler/wasm-compiler-definitions.h",
@ -3881,6 +3909,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/wasm-graph-assembler.h",
"src/compiler/wasm-inlining-into-js.h",
"src/compiler/wasm-inlining.h",
"src/compiler/wasm-js-lowering.h",
"src/compiler/wasm-load-elimination.h",
"src/compiler/wasm-loop-peeling.h",
"src/compiler/wasm-typer.h",
@ -4538,6 +4567,7 @@ if (v8_enable_webassembly) {
"src/compiler/wasm-graph-assembler.cc",
"src/compiler/wasm-inlining-into-js.cc",
"src/compiler/wasm-inlining.cc",
"src/compiler/wasm-js-lowering.cc",
"src/compiler/wasm-load-elimination.cc",
"src/compiler/wasm-loop-peeling.cc",
"src/compiler/wasm-typer.cc",
@ -4889,6 +4919,7 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/marking-worklist.cc",
"src/heap/marking.cc",
"src/heap/memory-allocator.cc",
"src/heap/memory-balancer.cc",
"src/heap/memory-chunk-layout.cc",
"src/heap/memory-chunk.cc",
"src/heap/memory-measurement.cc",
@ -5100,6 +5131,7 @@ v8_source_set("v8_base_without_compiler") {
"src/runtime/runtime-typedarray.cc",
"src/runtime/runtime-weak-refs.cc",
"src/runtime/runtime.cc",
"src/sandbox/code-pointer-table.cc",
"src/sandbox/external-pointer-table.cc",
"src/sandbox/sandbox.cc",
"src/sandbox/testing.cc",
@ -5174,7 +5206,12 @@ v8_source_set("v8_base_without_compiler") {
"src/maglev/maglev-regalloc.cc",
"src/maglev/maglev.cc",
]
if (v8_current_cpu == "arm64") {
if (v8_current_cpu == "arm") {
sources += [
"src/maglev/arm/maglev-assembler-arm.cc",
"src/maglev/arm/maglev-ir-arm.cc",
]
} else if (v8_current_cpu == "arm64") {
sources += [
"src/maglev/arm64/maglev-assembler-arm64.cc",
"src/maglev/arm64/maglev-ir-arm64.cc",
@ -5589,7 +5626,9 @@ v8_source_set("v8_base_without_compiler") {
v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" ||
v8_current_cpu == "s390" || v8_current_cpu == "s390x" ||
v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs += [ "atomic" ]
if (!is_clang) {
libs += [ "atomic" ]
}
}
if (v8_enable_vtunetracemark && (is_linux || is_chromeos || is_win)) {
@ -5936,8 +5975,8 @@ v8_component("v8_libbase") {
"src/base/platform/platform-fuchsia.cc",
]
deps += [
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.kernel",
"//third_party/fuchsia-sdk/sdk/pkg/fdio",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp",
"//third_party/fuchsia-sdk/sdk/pkg/component_incoming_cpp",
"//third_party/fuchsia-sdk/sdk/pkg/zx",
]
} else if (is_mac) {
@ -5989,7 +6028,9 @@ v8_component("v8_libbase") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs += [ "atomic" ]
if (!is_clang) {
libs += [ "atomic" ]
}
}
if (is_tsan && !build_with_chromium) {
@ -6099,7 +6140,9 @@ v8_component("v8_libplatform") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -7038,7 +7081,9 @@ v8_executable("cppgc_hello_world") {
sources = [ "samples/cppgc/hello-world.cc" ]
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
configs = [

File diff suppressed because it is too large Load Diff

View File

@ -12,10 +12,6 @@ import("//build/config/riscv.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build_overrides/build.gni")
if (is_android) {
import("//build/config/android/rules.gni")
}
import("gni/snapshot_toolchain.gni")
import("gni/v8.gni")
@ -323,6 +319,10 @@ declare_args() {
# Sets -DV8_ENABLE_SANDBOX.
v8_enable_sandbox = ""
# Enable experimental code pointer sandboxing for the V8 sandbox.
# Sets -DV8_CODE_POINTER_SANDBOXING
v8_code_pointer_sandboxing = false
# Expose the memory corruption API to JavaScript. Useful for testing the sandbox.
# WARNING This will expose builtins that (by design) cause memory corruption.
# Sets -DV8_EXPOSE_MEMORY_CORRUPTION_API
@ -372,13 +372,6 @@ declare_args() {
# (incomplete and experimental).
v8_enable_cet_shadow_stack = false
# Get VMEX priviledge at startup.
# It allows to run V8 without "deprecated-ambient-replace-as-executable".
# Sets -DV8_USE_VMEX_RESOURCE.
# TODO(victorgomes): Remove this flag once Chormium no longer needs
# the deprecated feature.
v8_fuchsia_use_vmex_resource = is_fuchsia && !build_with_chromium
# Enables pointer compression for 8GB heaps.
# Sets -DV8_COMPRESS_POINTERS_8GB.
v8_enable_pointer_compression_8gb = ""
@ -397,6 +390,10 @@ declare_args() {
# iOS (non-simulator) does not have executable pages for 3rd party
# applications yet so disable jit.
v8_jitless = v8_enable_lite_mode || target_is_ios_device
# Enable Maglev's graph printer.
# Sets -DV8_MAGLEV_GRAPH_PRINTER.
v8_enable_maglev_graph_printer = !build_with_chromium
}
# Derived defaults.
@ -476,13 +473,13 @@ if (v8_enable_short_builtin_calls == "") {
if (v8_enable_external_code_space == "") {
v8_enable_external_code_space =
v8_enable_pointer_compression &&
(v8_current_cpu == "x64" ||
(target_os != "fuchsia" && v8_current_cpu == "arm64"))
(v8_current_cpu == "x64" || v8_current_cpu == "arm64")
}
if (v8_enable_maglev == "") {
v8_enable_maglev = v8_enable_turbofan &&
(v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression
(v8_current_cpu == "arm" ||
((v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression))
}
assert(v8_enable_turbofan || !v8_enable_maglev,
"Maglev is not available when Turbofan is disabled.")
@ -645,6 +642,9 @@ assert(!v8_enable_sandbox || v8_enable_pointer_compression_shared_cage,
assert(!v8_enable_sandbox || v8_enable_external_code_space,
"The sandbox requires the external code space")
assert(!v8_code_pointer_sandboxing || v8_enable_sandbox,
"Code pointer sandboxing requires the sandbox")
assert(!v8_expose_memory_corruption_api || v8_enable_sandbox,
"The Memory Corruption API requires the sandbox")
@ -678,10 +678,6 @@ if (v8_enable_single_generation == true) {
"Requires unconditional write barriers or none (which disables incremental marking)")
}
if (v8_fuchsia_use_vmex_resource) {
assert(target_os == "fuchsia", "VMEX resource only available on Fuchsia")
}
assert(!v8_enable_snapshot_compression || v8_use_zlib,
"Snapshot compression requires zlib")
@ -724,7 +720,9 @@ config("internal_config") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -796,7 +794,9 @@ config("external_config") {
}
if (current_cpu == "riscv64" || current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -1142,9 +1142,6 @@ config("features") {
if (v8_advanced_bigint_algorithms) {
defines += [ "V8_ADVANCED_BIGINT_ALGORITHMS" ]
}
if (v8_fuchsia_use_vmex_resource) {
defines += [ "V8_USE_VMEX_RESOURCE" ]
}
if (v8_expose_memory_corruption_api) {
defines += [ "V8_EXPOSE_MEMORY_CORRUPTION_API" ]
}
@ -1169,6 +1166,12 @@ config("features") {
if (v8_enable_wasm_simd256_revec) {
defines += [ "V8_ENABLE_WASM_SIMD256_REVEC" ]
}
if (v8_code_pointer_sandboxing) {
defines += [ "V8_CODE_POINTER_SANDBOXING" ]
}
if (v8_enable_maglev_graph_printer) {
defines += [ "V8_ENABLE_MAGLEV_GRAPH_PRINTER" ]
}
}
config("toolchain") {
@ -1313,6 +1316,12 @@ config("toolchain") {
defines += [ "V8_TARGET_ARCH_RISCV32" ]
defines += [ "__riscv_xlen=32" ]
defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
# TODO(riscv32): Add condition riscv_use_rvv and riscv_rvv_vlen here after
# 4538202 merge.
if (target_is_simulator) {
defines += [ "CAN_USE_RVV_INSTRUCTIONS" ]
}
}
if (v8_current_cpu == "x86") {
@ -1339,7 +1348,6 @@ config("toolchain") {
}
if (is_android && v8_android_log_stdout) {
defines += [ "V8_ANDROID_LOG_STDOUT" ]
cflags += [ "-O3" ]
}
# V8_TARGET_OS_ defines. The target OS may differ from host OS e.g. in
@ -1408,15 +1416,18 @@ config("toolchain") {
"-Wmissing-field-initializers",
"-Wunreachable-code",
# Google3 enables this warning, so we should also enable it to find issue
# earlier. See https://reviews.llvm.org/D56731 for details about this
# warning.
"-Wctad-maybe-unsupported",
# TODO(v8:12245): Fix shadowing instances and remove.
"-Wno-shadow",
]
# TODO(fuchsia:127411): Re-enable once FIDL bindings are compatible.
if (!is_fuchsia) {
# Google3 enables this warning, so we should also enable it to find issue
# earlier. See https://reviews.llvm.org/D56731 for details about this
# warning.
cflags += [ "-Wctad-maybe-unsupported" ]
}
if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
v8_current_cpu == "mips64el" || v8_current_cpu == "riscv64") {
cflags += [ "-Wshorten-64-to-32" ]
@ -1760,6 +1771,7 @@ if (v8_postmortem_support) {
"src/objects/string-inl.h",
"src/objects/struct.h",
"src/objects/struct-inl.h",
"src/objects/tagged.h",
]
outputs = [ "$target_gen_dir/debug-support.cc" ]
@ -1826,9 +1838,11 @@ torque_files = [
"src/builtins/iterator.tq",
"src/builtins/iterator-from.tq",
"src/builtins/iterator-helpers.tq",
"src/builtins/map-groupby.tq",
"src/builtins/math.tq",
"src/builtins/number.tq",
"src/builtins/object-fromentries.tq",
"src/builtins/object-groupby.tq",
"src/builtins/object.tq",
"src/builtins/promise-abstract-operations.tq",
"src/builtins/promise-all.tq",
@ -1864,6 +1878,8 @@ torque_files = [
"src/builtins/regexp-split.tq",
"src/builtins/regexp-test.tq",
"src/builtins/regexp.tq",
"src/builtins/set-intersection.tq",
"src/builtins/set-union.tq",
"src/builtins/string-at.tq",
"src/builtins/string-endswith.tq",
"src/builtins/string-html.tq",
@ -2003,6 +2019,7 @@ if (v8_enable_i18n_support) {
if (v8_enable_webassembly) {
torque_files += [
"src/builtins/js-to-wasm.tq",
"src/builtins/wasm.tq",
"src/debug/debug-wasm-objects.tq",
"src/wasm/wasm-objects.tq",
@ -3082,6 +3099,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/js-create-lowering.h",
"src/compiler/js-generic-lowering.h",
"src/compiler/js-graph.h",
"src/compiler/js-heap-broker-inl.h",
"src/compiler/js-heap-broker.h",
"src/compiler/js-inlining-heuristic.h",
"src/compiler/js-inlining.h",
@ -3181,7 +3199,6 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/store-store-elimination-phase.h",
"src/compiler/turboshaft/store-store-elimination-reducer.h",
"src/compiler/turboshaft/structural-optimization-reducer.h",
"src/compiler/turboshaft/tag-untag-lowering-reducer.h",
"src/compiler/turboshaft/tracing.h",
"src/compiler/turboshaft/type-assertions-phase.h",
"src/compiler/turboshaft/type-inference-analysis.h",
@ -3361,6 +3378,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/marking-worklist.h",
"src/heap/marking.h",
"src/heap/memory-allocator.h",
"src/heap/memory-balancer.h",
"src/heap/memory-chunk-inl.h",
"src/heap/memory-chunk-layout.h",
"src/heap/memory-chunk.h",
@ -3377,6 +3395,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/paged-spaces-inl.h",
"src/heap/paged-spaces.h",
"src/heap/parallel-work-item.h",
"src/heap/parked-scope-inl.h",
"src/heap/parked-scope.h",
"src/heap/pretenuring-handler-inl.h",
"src/heap/pretenuring-handler.h",
@ -3649,6 +3668,7 @@ v8_header_set("v8_internal_headers") {
"src/objects/tagged-index.h",
"src/objects/tagged-value-inl.h",
"src/objects/tagged-value.h",
"src/objects/tagged.h",
"src/objects/template-objects-inl.h",
"src/objects/template-objects.h",
"src/objects/templates-inl.h",
@ -3733,6 +3753,10 @@ v8_header_set("v8_internal_headers") {
"src/runtime/runtime.h",
"src/sandbox/bounded-size-inl.h",
"src/sandbox/bounded-size.h",
"src/sandbox/code-pointer-inl.h",
"src/sandbox/code-pointer-table-inl.h",
"src/sandbox/code-pointer-table.h",
"src/sandbox/code-pointer.h",
"src/sandbox/external-entity-table-inl.h",
"src/sandbox/external-entity-table.h",
"src/sandbox/external-pointer-inl.h",
@ -3752,6 +3776,7 @@ v8_header_set("v8_internal_headers") {
"src/snapshot/embedded/embedded-file-writer-interface.h",
"src/snapshot/object-deserializer.h",
"src/snapshot/read-only-deserializer.h",
"src/snapshot/read-only-serializer-deserializer.h",
"src/snapshot/read-only-serializer.h",
"src/snapshot/references.h",
"src/snapshot/roots-serializer.h",
@ -3856,7 +3881,9 @@ v8_header_set("v8_internal_headers") {
"src/maglev/maglev-register-frame-array.h",
"src/maglev/maglev.h",
]
if (v8_current_cpu == "arm64") {
if (v8_current_cpu == "arm") {
sources += [ "src/maglev/arm/maglev-assembler-arm-inl.h" ]
} else if (v8_current_cpu == "arm64") {
sources += [ "src/maglev/arm64/maglev-assembler-arm64-inl.h" ]
} else if (v8_current_cpu == "x64") {
sources += [ "src/maglev/x64/maglev-assembler-x64-inl.h" ]
@ -3871,6 +3898,7 @@ v8_header_set("v8_internal_headers") {
"src/asmjs/asm-scanner.h",
"src/asmjs/asm-types.h",
"src/compiler/int64-lowering.h",
"src/compiler/turboshaft/wasm-js-lowering-reducer.h",
"src/compiler/wasm-address-reassociation.h",
"src/compiler/wasm-call-descriptors.h",
"src/compiler/wasm-compiler-definitions.h",
@ -3881,6 +3909,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/wasm-graph-assembler.h",
"src/compiler/wasm-inlining-into-js.h",
"src/compiler/wasm-inlining.h",
"src/compiler/wasm-js-lowering.h",
"src/compiler/wasm-load-elimination.h",
"src/compiler/wasm-loop-peeling.h",
"src/compiler/wasm-typer.h",
@ -4538,6 +4567,7 @@ if (v8_enable_webassembly) {
"src/compiler/wasm-graph-assembler.cc",
"src/compiler/wasm-inlining-into-js.cc",
"src/compiler/wasm-inlining.cc",
"src/compiler/wasm-js-lowering.cc",
"src/compiler/wasm-load-elimination.cc",
"src/compiler/wasm-loop-peeling.cc",
"src/compiler/wasm-typer.cc",
@ -4889,6 +4919,7 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/marking-worklist.cc",
"src/heap/marking.cc",
"src/heap/memory-allocator.cc",
"src/heap/memory-balancer.cc",
"src/heap/memory-chunk-layout.cc",
"src/heap/memory-chunk.cc",
"src/heap/memory-measurement.cc",
@ -5100,6 +5131,7 @@ v8_source_set("v8_base_without_compiler") {
"src/runtime/runtime-typedarray.cc",
"src/runtime/runtime-weak-refs.cc",
"src/runtime/runtime.cc",
"src/sandbox/code-pointer-table.cc",
"src/sandbox/external-pointer-table.cc",
"src/sandbox/sandbox.cc",
"src/sandbox/testing.cc",
@ -5174,7 +5206,12 @@ v8_source_set("v8_base_without_compiler") {
"src/maglev/maglev-regalloc.cc",
"src/maglev/maglev.cc",
]
if (v8_current_cpu == "arm64") {
if (v8_current_cpu == "arm") {
sources += [
"src/maglev/arm/maglev-assembler-arm.cc",
"src/maglev/arm/maglev-ir-arm.cc",
]
} else if (v8_current_cpu == "arm64") {
sources += [
"src/maglev/arm64/maglev-assembler-arm64.cc",
"src/maglev/arm64/maglev-ir-arm64.cc",
@ -5589,7 +5626,9 @@ v8_source_set("v8_base_without_compiler") {
v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" ||
v8_current_cpu == "s390" || v8_current_cpu == "s390x" ||
v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs += [ "atomic" ]
if (!is_clang) {
libs += [ "atomic" ]
}
}
if (v8_enable_vtunetracemark && (is_linux || is_chromeos || is_win)) {
@ -5936,8 +5975,8 @@ v8_component("v8_libbase") {
"src/base/platform/platform-fuchsia.cc",
]
deps += [
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.kernel",
"//third_party/fuchsia-sdk/sdk/pkg/fdio",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp",
"//third_party/fuchsia-sdk/sdk/pkg/component_incoming_cpp",
"//third_party/fuchsia-sdk/sdk/pkg/zx",
]
} else if (is_mac) {
@ -5989,7 +6028,9 @@ v8_component("v8_libbase") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs += [ "atomic" ]
if (!is_clang) {
libs += [ "atomic" ]
}
}
if (is_tsan && !build_with_chromium) {
@ -6099,7 +6140,9 @@ v8_component("v8_libplatform") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -7038,7 +7081,9 @@ v8_executable("cppgc_hello_world") {
sources = [ "samples/cppgc/hello-world.cc" ]
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
configs = [

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -12,10 +12,6 @@ import("//build/config/riscv.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build_overrides/build.gni")
if (is_android) {
import("//build/config/android/rules.gni")
}
import("gni/snapshot_toolchain.gni")
import("gni/v8.gni")
@ -323,6 +319,10 @@ declare_args() {
# Sets -DV8_ENABLE_SANDBOX.
v8_enable_sandbox = ""
# Enable experimental code pointer sandboxing for the V8 sandbox.
# Sets -DV8_CODE_POINTER_SANDBOXING
v8_code_pointer_sandboxing = false
# Expose the memory corruption API to JavaScript. Useful for testing the sandbox.
# WARNING This will expose builtins that (by design) cause memory corruption.
# Sets -DV8_EXPOSE_MEMORY_CORRUPTION_API
@ -372,13 +372,6 @@ declare_args() {
# (incomplete and experimental).
v8_enable_cet_shadow_stack = false
# Get VMEX priviledge at startup.
# It allows to run V8 without "deprecated-ambient-replace-as-executable".
# Sets -DV8_USE_VMEX_RESOURCE.
# TODO(victorgomes): Remove this flag once Chormium no longer needs
# the deprecated feature.
v8_fuchsia_use_vmex_resource = is_fuchsia && !build_with_chromium
# Enables pointer compression for 8GB heaps.
# Sets -DV8_COMPRESS_POINTERS_8GB.
v8_enable_pointer_compression_8gb = ""
@ -397,6 +390,10 @@ declare_args() {
# iOS (non-simulator) does not have executable pages for 3rd party
# applications yet so disable jit.
v8_jitless = v8_enable_lite_mode || target_is_ios_device
# Enable Maglev's graph printer.
# Sets -DV8_MAGLEV_GRAPH_PRINTER.
v8_enable_maglev_graph_printer = !build_with_chromium
}
# Derived defaults.
@ -476,13 +473,13 @@ if (v8_enable_short_builtin_calls == "") {
if (v8_enable_external_code_space == "") {
v8_enable_external_code_space =
v8_enable_pointer_compression &&
(v8_current_cpu == "x64" ||
(target_os != "fuchsia" && v8_current_cpu == "arm64"))
(v8_current_cpu == "x64" || v8_current_cpu == "arm64")
}
if (v8_enable_maglev == "") {
v8_enable_maglev = v8_enable_turbofan &&
(v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression
(v8_current_cpu == "arm" ||
((v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression))
}
assert(v8_enable_turbofan || !v8_enable_maglev,
"Maglev is not available when Turbofan is disabled.")
@ -645,6 +642,9 @@ assert(!v8_enable_sandbox || v8_enable_pointer_compression_shared_cage,
assert(!v8_enable_sandbox || v8_enable_external_code_space,
"The sandbox requires the external code space")
assert(!v8_code_pointer_sandboxing || v8_enable_sandbox,
"Code pointer sandboxing requires the sandbox")
assert(!v8_expose_memory_corruption_api || v8_enable_sandbox,
"The Memory Corruption API requires the sandbox")
@ -678,10 +678,6 @@ if (v8_enable_single_generation == true) {
"Requires unconditional write barriers or none (which disables incremental marking)")
}
if (v8_fuchsia_use_vmex_resource) {
assert(target_os == "fuchsia", "VMEX resource only available on Fuchsia")
}
assert(!v8_enable_snapshot_compression || v8_use_zlib,
"Snapshot compression requires zlib")
@ -724,7 +720,9 @@ config("internal_config") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -796,7 +794,9 @@ config("external_config") {
}
if (current_cpu == "riscv64" || current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -1142,9 +1142,6 @@ config("features") {
if (v8_advanced_bigint_algorithms) {
defines += [ "V8_ADVANCED_BIGINT_ALGORITHMS" ]
}
if (v8_fuchsia_use_vmex_resource) {
defines += [ "V8_USE_VMEX_RESOURCE" ]
}
if (v8_expose_memory_corruption_api) {
defines += [ "V8_EXPOSE_MEMORY_CORRUPTION_API" ]
}
@ -1169,6 +1166,12 @@ config("features") {
if (v8_enable_wasm_simd256_revec) {
defines += [ "V8_ENABLE_WASM_SIMD256_REVEC" ]
}
if (v8_code_pointer_sandboxing) {
defines += [ "V8_CODE_POINTER_SANDBOXING" ]
}
if (v8_enable_maglev_graph_printer) {
defines += [ "V8_ENABLE_MAGLEV_GRAPH_PRINTER" ]
}
}
config("toolchain") {
@ -1313,6 +1316,12 @@ config("toolchain") {
defines += [ "V8_TARGET_ARCH_RISCV32" ]
defines += [ "__riscv_xlen=32" ]
defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
# TODO(riscv32): Add condition riscv_use_rvv and riscv_rvv_vlen here after
# 4538202 merge.
if (target_is_simulator) {
defines += [ "CAN_USE_RVV_INSTRUCTIONS" ]
}
}
if (v8_current_cpu == "x86") {
@ -1331,7 +1340,7 @@ config("toolchain") {
cflags += [ "/O2", "/arch:SSE3" ]
ldflags += [ "/STACK:2097152" ]
}
if (is_linux) {
if (is_linux || is_chromeos) {
# Full optimization for V8.
cflags += [ "-O3", "-msse3" ]
ldflags += [ "-Wl,-O3", "-msse3" ]
@ -1339,7 +1348,6 @@ config("toolchain") {
}
if (is_android && v8_android_log_stdout) {
defines += [ "V8_ANDROID_LOG_STDOUT" ]
cflags += [ "-O3" ]
}
# V8_TARGET_OS_ defines. The target OS may differ from host OS e.g. in
@ -1408,15 +1416,18 @@ config("toolchain") {
"-Wmissing-field-initializers",
"-Wunreachable-code",
# Google3 enables this warning, so we should also enable it to find issue
# earlier. See https://reviews.llvm.org/D56731 for details about this
# warning.
"-Wctad-maybe-unsupported",
# TODO(v8:12245): Fix shadowing instances and remove.
"-Wno-shadow",
]
# TODO(fuchsia:127411): Re-enable once FIDL bindings are compatible.
if (!is_fuchsia) {
# Google3 enables this warning, so we should also enable it to find issue
# earlier. See https://reviews.llvm.org/D56731 for details about this
# warning.
cflags += [ "-Wctad-maybe-unsupported" ]
}
if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
v8_current_cpu == "mips64el" || v8_current_cpu == "riscv64") {
cflags += [ "-Wshorten-64-to-32" ]
@ -1760,6 +1771,7 @@ if (v8_postmortem_support) {
"src/objects/string-inl.h",
"src/objects/struct.h",
"src/objects/struct-inl.h",
"src/objects/tagged.h",
]
outputs = [ "$target_gen_dir/debug-support.cc" ]
@ -1826,9 +1838,11 @@ torque_files = [
"src/builtins/iterator.tq",
"src/builtins/iterator-from.tq",
"src/builtins/iterator-helpers.tq",
"src/builtins/map-groupby.tq",
"src/builtins/math.tq",
"src/builtins/number.tq",
"src/builtins/object-fromentries.tq",
"src/builtins/object-groupby.tq",
"src/builtins/object.tq",
"src/builtins/promise-abstract-operations.tq",
"src/builtins/promise-all.tq",
@ -1864,6 +1878,8 @@ torque_files = [
"src/builtins/regexp-split.tq",
"src/builtins/regexp-test.tq",
"src/builtins/regexp.tq",
"src/builtins/set-intersection.tq",
"src/builtins/set-union.tq",
"src/builtins/string-at.tq",
"src/builtins/string-endswith.tq",
"src/builtins/string-html.tq",
@ -2003,6 +2019,7 @@ if (v8_enable_i18n_support) {
if (v8_enable_webassembly) {
torque_files += [
"src/builtins/js-to-wasm.tq",
"src/builtins/wasm.tq",
"src/debug/debug-wasm-objects.tq",
"src/wasm/wasm-objects.tq",
@ -3082,6 +3099,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/js-create-lowering.h",
"src/compiler/js-generic-lowering.h",
"src/compiler/js-graph.h",
"src/compiler/js-heap-broker-inl.h",
"src/compiler/js-heap-broker.h",
"src/compiler/js-inlining-heuristic.h",
"src/compiler/js-inlining.h",
@ -3181,7 +3199,6 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/store-store-elimination-phase.h",
"src/compiler/turboshaft/store-store-elimination-reducer.h",
"src/compiler/turboshaft/structural-optimization-reducer.h",
"src/compiler/turboshaft/tag-untag-lowering-reducer.h",
"src/compiler/turboshaft/tracing.h",
"src/compiler/turboshaft/type-assertions-phase.h",
"src/compiler/turboshaft/type-inference-analysis.h",
@ -3361,6 +3378,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/marking-worklist.h",
"src/heap/marking.h",
"src/heap/memory-allocator.h",
"src/heap/memory-balancer.h",
"src/heap/memory-chunk-inl.h",
"src/heap/memory-chunk-layout.h",
"src/heap/memory-chunk.h",
@ -3377,6 +3395,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/paged-spaces-inl.h",
"src/heap/paged-spaces.h",
"src/heap/parallel-work-item.h",
"src/heap/parked-scope-inl.h",
"src/heap/parked-scope.h",
"src/heap/pretenuring-handler-inl.h",
"src/heap/pretenuring-handler.h",
@ -3649,6 +3668,7 @@ v8_header_set("v8_internal_headers") {
"src/objects/tagged-index.h",
"src/objects/tagged-value-inl.h",
"src/objects/tagged-value.h",
"src/objects/tagged.h",
"src/objects/template-objects-inl.h",
"src/objects/template-objects.h",
"src/objects/templates-inl.h",
@ -3733,6 +3753,10 @@ v8_header_set("v8_internal_headers") {
"src/runtime/runtime.h",
"src/sandbox/bounded-size-inl.h",
"src/sandbox/bounded-size.h",
"src/sandbox/code-pointer-inl.h",
"src/sandbox/code-pointer-table-inl.h",
"src/sandbox/code-pointer-table.h",
"src/sandbox/code-pointer.h",
"src/sandbox/external-entity-table-inl.h",
"src/sandbox/external-entity-table.h",
"src/sandbox/external-pointer-inl.h",
@ -3752,6 +3776,7 @@ v8_header_set("v8_internal_headers") {
"src/snapshot/embedded/embedded-file-writer-interface.h",
"src/snapshot/object-deserializer.h",
"src/snapshot/read-only-deserializer.h",
"src/snapshot/read-only-serializer-deserializer.h",
"src/snapshot/read-only-serializer.h",
"src/snapshot/references.h",
"src/snapshot/roots-serializer.h",
@ -3856,7 +3881,9 @@ v8_header_set("v8_internal_headers") {
"src/maglev/maglev-register-frame-array.h",
"src/maglev/maglev.h",
]
if (v8_current_cpu == "arm64") {
if (v8_current_cpu == "arm") {
sources += [ "src/maglev/arm/maglev-assembler-arm-inl.h" ]
} else if (v8_current_cpu == "arm64") {
sources += [ "src/maglev/arm64/maglev-assembler-arm64-inl.h" ]
} else if (v8_current_cpu == "x64") {
sources += [ "src/maglev/x64/maglev-assembler-x64-inl.h" ]
@ -3871,6 +3898,7 @@ v8_header_set("v8_internal_headers") {
"src/asmjs/asm-scanner.h",
"src/asmjs/asm-types.h",
"src/compiler/int64-lowering.h",
"src/compiler/turboshaft/wasm-js-lowering-reducer.h",
"src/compiler/wasm-address-reassociation.h",
"src/compiler/wasm-call-descriptors.h",
"src/compiler/wasm-compiler-definitions.h",
@ -3881,6 +3909,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/wasm-graph-assembler.h",
"src/compiler/wasm-inlining-into-js.h",
"src/compiler/wasm-inlining.h",
"src/compiler/wasm-js-lowering.h",
"src/compiler/wasm-load-elimination.h",
"src/compiler/wasm-loop-peeling.h",
"src/compiler/wasm-typer.h",
@ -4538,6 +4567,7 @@ if (v8_enable_webassembly) {
"src/compiler/wasm-graph-assembler.cc",
"src/compiler/wasm-inlining-into-js.cc",
"src/compiler/wasm-inlining.cc",
"src/compiler/wasm-js-lowering.cc",
"src/compiler/wasm-load-elimination.cc",
"src/compiler/wasm-loop-peeling.cc",
"src/compiler/wasm-typer.cc",
@ -4889,6 +4919,7 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/marking-worklist.cc",
"src/heap/marking.cc",
"src/heap/memory-allocator.cc",
"src/heap/memory-balancer.cc",
"src/heap/memory-chunk-layout.cc",
"src/heap/memory-chunk.cc",
"src/heap/memory-measurement.cc",
@ -5100,6 +5131,7 @@ v8_source_set("v8_base_without_compiler") {
"src/runtime/runtime-typedarray.cc",
"src/runtime/runtime-weak-refs.cc",
"src/runtime/runtime.cc",
"src/sandbox/code-pointer-table.cc",
"src/sandbox/external-pointer-table.cc",
"src/sandbox/sandbox.cc",
"src/sandbox/testing.cc",
@ -5174,7 +5206,12 @@ v8_source_set("v8_base_without_compiler") {
"src/maglev/maglev-regalloc.cc",
"src/maglev/maglev.cc",
]
if (v8_current_cpu == "arm64") {
if (v8_current_cpu == "arm") {
sources += [
"src/maglev/arm/maglev-assembler-arm.cc",
"src/maglev/arm/maglev-ir-arm.cc",
]
} else if (v8_current_cpu == "arm64") {
sources += [
"src/maglev/arm64/maglev-assembler-arm64.cc",
"src/maglev/arm64/maglev-ir-arm64.cc",
@ -5589,7 +5626,9 @@ v8_source_set("v8_base_without_compiler") {
v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" ||
v8_current_cpu == "s390" || v8_current_cpu == "s390x" ||
v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs += [ "atomic" ]
if (!is_clang) {
libs += [ "atomic" ]
}
}
if (v8_enable_vtunetracemark && (is_linux || is_chromeos || is_win)) {
@ -5936,8 +5975,8 @@ v8_component("v8_libbase") {
"src/base/platform/platform-fuchsia.cc",
]
deps += [
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.kernel",
"//third_party/fuchsia-sdk/sdk/pkg/fdio",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp",
"//third_party/fuchsia-sdk/sdk/pkg/component_incoming_cpp",
"//third_party/fuchsia-sdk/sdk/pkg/zx",
]
} else if (is_mac) {
@ -5989,7 +6028,9 @@ v8_component("v8_libbase") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs += [ "atomic" ]
if (!is_clang) {
libs += [ "atomic" ]
}
}
if (is_tsan && !build_with_chromium) {
@ -6099,7 +6140,9 @@ v8_component("v8_libplatform") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -7038,7 +7081,9 @@ v8_executable("cppgc_hello_world") {
sources = [ "samples/cppgc/hello-world.cc" ]
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
configs = [

View File

@ -121,6 +121,7 @@
#include "base/message_loop/message_pump_default.h"
#include "base/message_loop/message_pump_kqueue.h"
#include "base/message_loop/message_pump_mac.h"
#include "base/synchronization/condition_variable.h"
#include "chrome/app/chrome_main_mac.h"
#include "chrome/browser/chrome_browser_application_mac.h"
#include "chrome/browser/headless/headless_mode_util.h"
@ -156,10 +157,9 @@
#include "chrome/browser/ash/boot_times_recorder.h"
#include "chrome/browser/ash/dbus/ash_dbus_helper.h"
#include "chrome/browser/ash/startup_settings_cache.h"
#include "chromeos/ash/components/memory/kstaled.h"
#include "chromeos/ash/components/memory/memory.h"
#include "chromeos/ash/components/memory/mglru.h"
#include "chromeos/ash/components/memory/swap_configuration.h"
#include "chromeos/hugepage_text/hugepage_text.h"
#include "ui/lottie/resource.h" // nogncheck
#endif
@ -217,6 +217,7 @@
#endif // BUILDFLAG(ENABLE_PROCESS_SINGLETON)
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "base/scoped_add_feature_flags.h"
#include "chrome/common/chrome_paths_lacros.h"
#include "chromeos/crosapi/cpp/crosapi_constants.h" // nogncheck
#include "chromeos/crosapi/mojom/crosapi.mojom.h" // nogncheck
@ -230,6 +231,7 @@
#include "content/public/browser/zygote_host/zygote_host_linux.h"
#include "media/base/media_switches.h"
#include "ui/base/resource/data_pack_with_resource_sharing_lacros.h"
#include "ui/base/ui_base_features.h"
#include "ui/gfx/switches.h"
#endif
@ -592,8 +594,7 @@ void InitLogging(const std::string& process_type) {
// the min level on ChromeOS.
if (process_type.empty()) {
LOG(WARNING) << "This is " << chrome::kBrandName << " version: "
<< chrome::kChromeVersion
<< " (not a warning)";
<< chrome::kChromeVersion << " (not a warning)";
}
}
#endif // !BUILDFLAG(IS_ANDROID)
@ -778,6 +779,13 @@ absl::optional<int> ChromeMainDelegate::PostEarlyInitialization(
// Redirect logs from system directory to cryptohome.
if (chromeos::IsLaunchedWithPostLoginParams())
RedirectLacrosLogging();
// Must be added before feature list is created otherwise the added flag won't
// be picked up.
if (chromeos::BrowserParamsProxy::Get()->IsVariableRefreshRateEnabled()) {
base::ScopedAddFeatureFlags(base::CommandLine::ForCurrentProcess())
.EnableIfNotSet(features::kEnableVariableRefreshRate);
}
#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
// The DBus initialization above is needed for FeatureList creation here;
@ -930,7 +938,7 @@ void ChromeMainDelegate::CommonEarlyInitialization() {
if (is_browser_process) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
ash::ConfigureSwap(arc::IsArcAvailable());
ash::InitializeKstaled();
ash::InitializeMGLRU();
#endif
}
@ -965,6 +973,7 @@ void ChromeMainDelegate::CommonEarlyInitialization() {
base::PlatformThread::InitFeaturesPostFieldTrial();
base::MessagePumpCFRunLoopBase::InitializeFeatures();
base::MessagePumpKqueue::InitializeFeatures();
base::ConditionVariable::InitializeFeatures();
#endif
}
@ -1648,10 +1657,6 @@ void ChromeMainDelegate::ProcessExiting(const std::string& process_type) {
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
void ChromeMainDelegate::ZygoteStarting(
std::vector<std::unique_ptr<content::ZygoteForkDelegate>>* delegates) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
chromeos::InitHugepagesAndMlockSelf();
#endif
#if BUILDFLAG(ENABLE_NACL)
nacl::AddNaClZygoteForkDelegates(delegates);
#endif

View File

@ -12,10 +12,6 @@ import("//build/config/riscv.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build_overrides/build.gni")
if (is_android) {
import("//build/config/android/rules.gni")
}
import("gni/snapshot_toolchain.gni")
import("gni/v8.gni")
@ -323,6 +319,10 @@ declare_args() {
# Sets -DV8_ENABLE_SANDBOX.
v8_enable_sandbox = ""
# Enable experimental code pointer sandboxing for the V8 sandbox.
# Sets -DV8_CODE_POINTER_SANDBOXING
v8_code_pointer_sandboxing = false
# Expose the memory corruption API to JavaScript. Useful for testing the sandbox.
# WARNING This will expose builtins that (by design) cause memory corruption.
# Sets -DV8_EXPOSE_MEMORY_CORRUPTION_API
@ -372,13 +372,6 @@ declare_args() {
# (incomplete and experimental).
v8_enable_cet_shadow_stack = false
# Get VMEX priviledge at startup.
# It allows to run V8 without "deprecated-ambient-replace-as-executable".
# Sets -DV8_USE_VMEX_RESOURCE.
# TODO(victorgomes): Remove this flag once Chormium no longer needs
# the deprecated feature.
v8_fuchsia_use_vmex_resource = is_fuchsia && !build_with_chromium
# Enables pointer compression for 8GB heaps.
# Sets -DV8_COMPRESS_POINTERS_8GB.
v8_enable_pointer_compression_8gb = ""
@ -397,6 +390,10 @@ declare_args() {
# iOS (non-simulator) does not have executable pages for 3rd party
# applications yet so disable jit.
v8_jitless = v8_enable_lite_mode || target_is_ios_device
# Enable Maglev's graph printer.
# Sets -DV8_MAGLEV_GRAPH_PRINTER.
v8_enable_maglev_graph_printer = !build_with_chromium
}
# Derived defaults.
@ -476,13 +473,13 @@ if (v8_enable_short_builtin_calls == "") {
if (v8_enable_external_code_space == "") {
v8_enable_external_code_space =
v8_enable_pointer_compression &&
(v8_current_cpu == "x64" ||
(target_os != "fuchsia" && v8_current_cpu == "arm64"))
(v8_current_cpu == "x64" || v8_current_cpu == "arm64")
}
if (v8_enable_maglev == "") {
v8_enable_maglev = v8_enable_turbofan &&
(v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression
(v8_current_cpu == "arm" ||
((v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
v8_enable_pointer_compression))
}
assert(v8_enable_turbofan || !v8_enable_maglev,
"Maglev is not available when Turbofan is disabled.")
@ -645,6 +642,9 @@ assert(!v8_enable_sandbox || v8_enable_pointer_compression_shared_cage,
assert(!v8_enable_sandbox || v8_enable_external_code_space,
"The sandbox requires the external code space")
assert(!v8_code_pointer_sandboxing || v8_enable_sandbox,
"Code pointer sandboxing requires the sandbox")
assert(!v8_expose_memory_corruption_api || v8_enable_sandbox,
"The Memory Corruption API requires the sandbox")
@ -678,10 +678,6 @@ if (v8_enable_single_generation == true) {
"Requires unconditional write barriers or none (which disables incremental marking)")
}
if (v8_fuchsia_use_vmex_resource) {
assert(target_os == "fuchsia", "VMEX resource only available on Fuchsia")
}
assert(!v8_enable_snapshot_compression || v8_use_zlib,
"Snapshot compression requires zlib")
@ -724,7 +720,9 @@ config("internal_config") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -796,7 +794,9 @@ config("external_config") {
}
if (current_cpu == "riscv64" || current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -1142,9 +1142,6 @@ config("features") {
if (v8_advanced_bigint_algorithms) {
defines += [ "V8_ADVANCED_BIGINT_ALGORITHMS" ]
}
if (v8_fuchsia_use_vmex_resource) {
defines += [ "V8_USE_VMEX_RESOURCE" ]
}
if (v8_expose_memory_corruption_api) {
defines += [ "V8_EXPOSE_MEMORY_CORRUPTION_API" ]
}
@ -1169,6 +1166,12 @@ config("features") {
if (v8_enable_wasm_simd256_revec) {
defines += [ "V8_ENABLE_WASM_SIMD256_REVEC" ]
}
if (v8_code_pointer_sandboxing) {
defines += [ "V8_CODE_POINTER_SANDBOXING" ]
}
if (v8_enable_maglev_graph_printer) {
defines += [ "V8_ENABLE_MAGLEV_GRAPH_PRINTER" ]
}
}
config("toolchain") {
@ -1313,6 +1316,12 @@ config("toolchain") {
defines += [ "V8_TARGET_ARCH_RISCV32" ]
defines += [ "__riscv_xlen=32" ]
defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
# TODO(riscv32): Add condition riscv_use_rvv and riscv_rvv_vlen here after
# 4538202 merge.
if (target_is_simulator) {
defines += [ "CAN_USE_RVV_INSTRUCTIONS" ]
}
}
if (v8_current_cpu == "x86") {
@ -1331,7 +1340,7 @@ config("toolchain") {
cflags += [ "/O2", "/arch:AVX" ]
ldflags += [ "/STACK:2097152" ]
}
if (is_linux) {
if (is_linux || is_chromeos) {
# Full optimization for V8.
cflags += [ "-O3", "-mavx", "-maes" ]
ldflags += [ "-Wl,-O3", "-mavx", "-maes" ]
@ -1339,7 +1348,6 @@ config("toolchain") {
}
if (is_android && v8_android_log_stdout) {
defines += [ "V8_ANDROID_LOG_STDOUT" ]
cflags += [ "-O3" ]
}
# V8_TARGET_OS_ defines. The target OS may differ from host OS e.g. in
@ -1408,15 +1416,18 @@ config("toolchain") {
"-Wmissing-field-initializers",
"-Wunreachable-code",
# Google3 enables this warning, so we should also enable it to find issue
# earlier. See https://reviews.llvm.org/D56731 for details about this
# warning.
"-Wctad-maybe-unsupported",
# TODO(v8:12245): Fix shadowing instances and remove.
"-Wno-shadow",
]
# TODO(fuchsia:127411): Re-enable once FIDL bindings are compatible.
if (!is_fuchsia) {
# Google3 enables this warning, so we should also enable it to find issue
# earlier. See https://reviews.llvm.org/D56731 for details about this
# warning.
cflags += [ "-Wctad-maybe-unsupported" ]
}
if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
v8_current_cpu == "mips64el" || v8_current_cpu == "riscv64") {
cflags += [ "-Wshorten-64-to-32" ]
@ -1760,6 +1771,7 @@ if (v8_postmortem_support) {
"src/objects/string-inl.h",
"src/objects/struct.h",
"src/objects/struct-inl.h",
"src/objects/tagged.h",
]
outputs = [ "$target_gen_dir/debug-support.cc" ]
@ -1826,9 +1838,11 @@ torque_files = [
"src/builtins/iterator.tq",
"src/builtins/iterator-from.tq",
"src/builtins/iterator-helpers.tq",
"src/builtins/map-groupby.tq",
"src/builtins/math.tq",
"src/builtins/number.tq",
"src/builtins/object-fromentries.tq",
"src/builtins/object-groupby.tq",
"src/builtins/object.tq",
"src/builtins/promise-abstract-operations.tq",
"src/builtins/promise-all.tq",
@ -1864,6 +1878,8 @@ torque_files = [
"src/builtins/regexp-split.tq",
"src/builtins/regexp-test.tq",
"src/builtins/regexp.tq",
"src/builtins/set-intersection.tq",
"src/builtins/set-union.tq",
"src/builtins/string-at.tq",
"src/builtins/string-endswith.tq",
"src/builtins/string-html.tq",
@ -2003,6 +2019,7 @@ if (v8_enable_i18n_support) {
if (v8_enable_webassembly) {
torque_files += [
"src/builtins/js-to-wasm.tq",
"src/builtins/wasm.tq",
"src/debug/debug-wasm-objects.tq",
"src/wasm/wasm-objects.tq",
@ -3082,6 +3099,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/js-create-lowering.h",
"src/compiler/js-generic-lowering.h",
"src/compiler/js-graph.h",
"src/compiler/js-heap-broker-inl.h",
"src/compiler/js-heap-broker.h",
"src/compiler/js-inlining-heuristic.h",
"src/compiler/js-inlining.h",
@ -3181,7 +3199,6 @@ v8_header_set("v8_internal_headers") {
"src/compiler/turboshaft/store-store-elimination-phase.h",
"src/compiler/turboshaft/store-store-elimination-reducer.h",
"src/compiler/turboshaft/structural-optimization-reducer.h",
"src/compiler/turboshaft/tag-untag-lowering-reducer.h",
"src/compiler/turboshaft/tracing.h",
"src/compiler/turboshaft/type-assertions-phase.h",
"src/compiler/turboshaft/type-inference-analysis.h",
@ -3361,6 +3378,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/marking-worklist.h",
"src/heap/marking.h",
"src/heap/memory-allocator.h",
"src/heap/memory-balancer.h",
"src/heap/memory-chunk-inl.h",
"src/heap/memory-chunk-layout.h",
"src/heap/memory-chunk.h",
@ -3377,6 +3395,7 @@ v8_header_set("v8_internal_headers") {
"src/heap/paged-spaces-inl.h",
"src/heap/paged-spaces.h",
"src/heap/parallel-work-item.h",
"src/heap/parked-scope-inl.h",
"src/heap/parked-scope.h",
"src/heap/pretenuring-handler-inl.h",
"src/heap/pretenuring-handler.h",
@ -3649,6 +3668,7 @@ v8_header_set("v8_internal_headers") {
"src/objects/tagged-index.h",
"src/objects/tagged-value-inl.h",
"src/objects/tagged-value.h",
"src/objects/tagged.h",
"src/objects/template-objects-inl.h",
"src/objects/template-objects.h",
"src/objects/templates-inl.h",
@ -3733,6 +3753,10 @@ v8_header_set("v8_internal_headers") {
"src/runtime/runtime.h",
"src/sandbox/bounded-size-inl.h",
"src/sandbox/bounded-size.h",
"src/sandbox/code-pointer-inl.h",
"src/sandbox/code-pointer-table-inl.h",
"src/sandbox/code-pointer-table.h",
"src/sandbox/code-pointer.h",
"src/sandbox/external-entity-table-inl.h",
"src/sandbox/external-entity-table.h",
"src/sandbox/external-pointer-inl.h",
@ -3752,6 +3776,7 @@ v8_header_set("v8_internal_headers") {
"src/snapshot/embedded/embedded-file-writer-interface.h",
"src/snapshot/object-deserializer.h",
"src/snapshot/read-only-deserializer.h",
"src/snapshot/read-only-serializer-deserializer.h",
"src/snapshot/read-only-serializer.h",
"src/snapshot/references.h",
"src/snapshot/roots-serializer.h",
@ -3856,7 +3881,9 @@ v8_header_set("v8_internal_headers") {
"src/maglev/maglev-register-frame-array.h",
"src/maglev/maglev.h",
]
if (v8_current_cpu == "arm64") {
if (v8_current_cpu == "arm") {
sources += [ "src/maglev/arm/maglev-assembler-arm-inl.h" ]
} else if (v8_current_cpu == "arm64") {
sources += [ "src/maglev/arm64/maglev-assembler-arm64-inl.h" ]
} else if (v8_current_cpu == "x64") {
sources += [ "src/maglev/x64/maglev-assembler-x64-inl.h" ]
@ -3871,6 +3898,7 @@ v8_header_set("v8_internal_headers") {
"src/asmjs/asm-scanner.h",
"src/asmjs/asm-types.h",
"src/compiler/int64-lowering.h",
"src/compiler/turboshaft/wasm-js-lowering-reducer.h",
"src/compiler/wasm-address-reassociation.h",
"src/compiler/wasm-call-descriptors.h",
"src/compiler/wasm-compiler-definitions.h",
@ -3881,6 +3909,7 @@ v8_header_set("v8_internal_headers") {
"src/compiler/wasm-graph-assembler.h",
"src/compiler/wasm-inlining-into-js.h",
"src/compiler/wasm-inlining.h",
"src/compiler/wasm-js-lowering.h",
"src/compiler/wasm-load-elimination.h",
"src/compiler/wasm-loop-peeling.h",
"src/compiler/wasm-typer.h",
@ -4538,6 +4567,7 @@ if (v8_enable_webassembly) {
"src/compiler/wasm-graph-assembler.cc",
"src/compiler/wasm-inlining-into-js.cc",
"src/compiler/wasm-inlining.cc",
"src/compiler/wasm-js-lowering.cc",
"src/compiler/wasm-load-elimination.cc",
"src/compiler/wasm-loop-peeling.cc",
"src/compiler/wasm-typer.cc",
@ -4889,6 +4919,7 @@ v8_source_set("v8_base_without_compiler") {
"src/heap/marking-worklist.cc",
"src/heap/marking.cc",
"src/heap/memory-allocator.cc",
"src/heap/memory-balancer.cc",
"src/heap/memory-chunk-layout.cc",
"src/heap/memory-chunk.cc",
"src/heap/memory-measurement.cc",
@ -5100,6 +5131,7 @@ v8_source_set("v8_base_without_compiler") {
"src/runtime/runtime-typedarray.cc",
"src/runtime/runtime-weak-refs.cc",
"src/runtime/runtime.cc",
"src/sandbox/code-pointer-table.cc",
"src/sandbox/external-pointer-table.cc",
"src/sandbox/sandbox.cc",
"src/sandbox/testing.cc",
@ -5174,7 +5206,12 @@ v8_source_set("v8_base_without_compiler") {
"src/maglev/maglev-regalloc.cc",
"src/maglev/maglev.cc",
]
if (v8_current_cpu == "arm64") {
if (v8_current_cpu == "arm") {
sources += [
"src/maglev/arm/maglev-assembler-arm.cc",
"src/maglev/arm/maglev-ir-arm.cc",
]
} else if (v8_current_cpu == "arm64") {
sources += [
"src/maglev/arm64/maglev-assembler-arm64.cc",
"src/maglev/arm64/maglev-ir-arm64.cc",
@ -5589,7 +5626,9 @@ v8_source_set("v8_base_without_compiler") {
v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" ||
v8_current_cpu == "s390" || v8_current_cpu == "s390x" ||
v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs += [ "atomic" ]
if (!is_clang) {
libs += [ "atomic" ]
}
}
if (v8_enable_vtunetracemark && (is_linux || is_chromeos || is_win)) {
@ -5936,8 +5975,8 @@ v8_component("v8_libbase") {
"src/base/platform/platform-fuchsia.cc",
]
deps += [
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.kernel",
"//third_party/fuchsia-sdk/sdk/pkg/fdio",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp",
"//third_party/fuchsia-sdk/sdk/pkg/component_incoming_cpp",
"//third_party/fuchsia-sdk/sdk/pkg/zx",
]
} else if (is_mac) {
@ -5989,7 +6028,9 @@ v8_component("v8_libbase") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs += [ "atomic" ]
if (!is_clang) {
libs += [ "atomic" ]
}
}
if (is_tsan && !build_with_chromium) {
@ -6099,7 +6140,9 @@ v8_component("v8_libplatform") {
}
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
}
@ -7038,7 +7081,9 @@ v8_executable("cppgc_hello_world") {
sources = [ "samples/cppgc/hello-world.cc" ]
if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
libs = [ "atomic" ]
if (!is_clang) {
libs = [ "atomic" ]
}
}
configs = [