Skip to content

Commit

Permalink
games/punchy: replace 316a89e with upstream fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeich committed Jul 11, 2023
1 parent 9b2ee36 commit f4a7497
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 3 deletions.
5 changes: 2 additions & 3 deletions games/punchy/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PORTNAME= punchy
DISTVERSIONPREFIX= v
DISTVERSION= 0.3.0
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= games wayland

MAINTAINER= jbeich@FreeBSD.org
Expand All @@ -24,11 +24,10 @@ PORTDATA= *

# Bundled v8
BUILD_DEPENDS+= gn:devel/gn
USES+= compiler ninja:build python:build
USES+= ninja:build python:build
BINARY_ALIAS+= python=${PYTHON_CMD}
CARGO_ENV+= V8_FROM_SOURCE=1 CLANG_BASE_PATH="/usr" GN_ARGS='${GN_ARGS}'
GN_ARGS+= use_custom_libcxx=false
CXXFLAGS+= ${${ARCH} == aarch64 && ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160:?-Wno-enum-constexpr-conversion:}

post-patch:
# Search assets under PREFIX instead of current directory
Expand Down
104 changes: 104 additions & 0 deletions games/punchy/files/patch-clang16-aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
https://chromium.googlesource.com/v8/v8/+/d15d49b09dc7%5E%21/

--- cargo-crates/v8-0.47.1/v8/include/v8-internal.h.orig 1973-11-29 21:33:09 UTC
+++ cargo-crates/v8-0.47.1/v8/include/v8-internal.h
@@ -413,7 +413,7 @@ class Internals {

static const int kNodeClassIdOffset = 1 * kApiSystemPointerSize;
static const int kNodeFlagsOffset = 1 * kApiSystemPointerSize + 3;
- static const int kNodeStateMask = 0x7;
+ static const int kNodeStateMask = 0x3;
static const int kNodeStateIsWeakValue = 2;

static const int kFirstNonstringType = 0x80;
--- cargo-crates/v8-0.47.1/v8/src/ast/ast.h.orig 1973-11-29 21:33:09 UTC
+++ cargo-crates/v8-0.47.1/v8/src/ast/ast.h
@@ -1006,7 +1006,7 @@ class Literal final : public Expression {
friend class AstNodeFactory;
friend Zone;

- using TypeField = Expression::NextBitField<Type, 4>;
+ using TypeField = Expression::NextBitField<Type, 3>;

Literal(int smi, int position) : Expression(position, kLiteral), smi_(smi) {
bit_field_ = TypeField::update(bit_field_, kSmi);
--- cargo-crates/v8-0.47.1/v8/src/base/bit-field.h.orig 1973-11-29 21:33:09 UTC
+++ cargo-crates/v8-0.47.1/v8/src/base/bit-field.h
@@ -40,6 +40,11 @@ class BitField final {
static constexpr U kNumValues = U{1} << kSize;

// Value for the field with all bits set.
+ // If clang complains
+ // "constexpr variable 'kMax' must be initialized by a constant expression"
+ // on this line, then you're creating a BitField for an enum with more bits
+ // than needed for the enum values. Either reduce the BitField size,
+ // or give the enum an explicit underlying type.
static constexpr T kMax = static_cast<T>(kNumValues - 1);

template <class T2, int size2>
--- cargo-crates/v8-0.47.1/v8/src/compiler/backend/instruction-codes.h.orig 1973-11-29 21:33:09 UTC
+++ cargo-crates/v8-0.47.1/v8/src/compiler/backend/instruction-codes.h
@@ -195,7 +195,7 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostrea
V(None) \
TARGET_ADDRESSING_MODE_LIST(V)

-enum AddressingMode {
+enum AddressingMode : uint8_t {
#define DECLARE_ADDRESSING_MODE(Name) kMode_##Name,
ADDRESSING_MODE_LIST(DECLARE_ADDRESSING_MODE)
#undef DECLARE_ADDRESSING_MODE
@@ -306,7 +306,7 @@ using LaneSizeField = base::BitField<int, 22, 8>;
// LaneSizeField and AccessModeField are helper types to encode/decode a lane
// size, an access mode, or both inside the overlapping MiscField.
using LaneSizeField = base::BitField<int, 22, 8>;
-using AccessModeField = base::BitField<MemoryAccessMode, 30, 2>;
+using AccessModeField = base::BitField<MemoryAccessMode, 30, 1>;
// TODO(turbofan): {HasMemoryAccessMode} is currently only used to guard
// decoding (in CodeGenerator and InstructionScheduler). Encoding (in
// InstructionSelector) is not yet guarded. There are in fact instructions for
--- cargo-crates/v8-0.47.1/v8/src/compiler/backend/instruction.h.orig 1973-11-29 21:33:09 UTC
+++ cargo-crates/v8-0.47.1/v8/src/compiler/backend/instruction.h
@@ -591,8 +591,8 @@ class LocationOperand : public InstructionOperand {
}

static_assert(KindField::kSize == 3);
- using LocationKindField = base::BitField64<LocationKind, 3, 2>;
- using RepresentationField = base::BitField64<MachineRepresentation, 5, 8>;
+ using LocationKindField = base::BitField64<LocationKind, 3, 1>;
+ using RepresentationField = LocationKindField::Next<MachineRepresentation, 8>;
using IndexField = base::BitField64<int32_t, 35, 29>;
};

--- cargo-crates/v8-0.47.1/v8/src/handles/global-handles.cc.orig 1973-11-29 21:33:09 UTC
+++ cargo-crates/v8-0.47.1/v8/src/handles/global-handles.cc
@@ -573,7 +573,7 @@ class GlobalHandles::Node final : public NodeBase<Glob

// This stores three flags (independent, partially_dependent and
// in_young_list) and a State.
- using NodeState = base::BitField8<State, 0, 3>;
+ using NodeState = base::BitField8<State, 0, 2>;
// Tracks whether the node is contained in the set of young nodes. This bit
// persists across allocating and freeing a node as it's only cleaned up
// when young nodes are proccessed.
--- cargo-crates/v8-0.47.1/v8/src/maglev/maglev-ir.h.orig 1973-11-29 21:33:09 UTC
+++ cargo-crates/v8-0.47.1/v8/src/maglev/maglev-ir.h
@@ -271,7 +271,7 @@ class OpProperties {
return kValueRepresentationBits::decode(bitfield_);
}
constexpr bool is_pure() const {
- return (bitfield_ | kPureMask) == kPureValue;
+ return (bitfield_ & kPureMask) == kPureValue;
}
constexpr bool is_required_when_unused() const {
return can_write() || non_memory_side_effects();
--- cargo-crates/v8-0.47.1/v8/src/wasm/wasm-code-manager.h.orig 1973-11-29 21:33:09 UTC
+++ cargo-crates/v8-0.47.1/v8/src/wasm/wasm-code-manager.h
@@ -463,7 +463,7 @@ class V8_EXPORT_PRIVATE WasmCode final {
int trap_handler_index_ = -1;

// Bits encoded in {flags_}:
- using KindField = base::BitField8<Kind, 0, 3>;
+ using KindField = base::BitField8<Kind, 0, 2>;
using ExecutionTierField = KindField::Next<ExecutionTier, 2>;
using ForDebuggingField = ExecutionTierField::Next<ForDebugging, 2>;

0 comments on commit f4a7497

Please sign in to comment.