From nobody Wed May 15 20:15:09 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vfkws5hLtz4t1GX; Wed, 15 May 2024 20:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vfkws4vk0z55QY; Wed, 15 May 2024 20:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715804109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0rIqnCA77K1RBhhKCVJKPa2U5+04gy5Vls4a0laXHoo=; b=i3uoTbzUtYs0A/kd86HG9nWQwM+O0+F+ZiiOBy1RxOD0uOT9uGEccPoz6dViOuKhxJDQre 7Z9DiYBHRu/EtnhflJ2mNE1f4YTuA1umpiKe4DMJPOVgLDfOuxgIvJGwXCo1PYTkEBQwXS NWcpjmyZl9NkveKWOn3so9D8cWiobjAQljpxQNzmedFbXvLDvkwWwRN8wK6HJSKU6yhALy IoEzgUTBFHsAe8Y4CYX1ccauhrQF4CQFysBFEbo71WFMl7u02abAJLwZD0ZCvGSWQEAfLM UGK9I7vQ/TPgAYACORVARsKanb/1nW0ckDMYyhv6gjBlVgPpT/1cNe3cI96wUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715804109; a=rsa-sha256; cv=none; b=lJ01s20F0RZ3W+GFlzuFhGPTPe9Lcbf7gTMAk4obOnQVZxfMWyuQp6CsUO4lLcVVurTH+E v4+pLfr3C4CYqvxpX0/YfdSfQx2lKb9seGWf3J+iL63aXqZ8V4XGpdRfFHglzaapngkE96 TLtQhr0kOhwlGWGzgdNwkCbkmQxRECW8bv3W01cP5/UVtglaggfOCVy9+F+lmDXumsbFi4 h2uVaitaAEkq46ayUkcQt7G7E8CYjygeoB4QlEIeWGIOzUH8nU8dDuwkeKgrVnnncIiHOn omLWtVrDWhBouvrjJw4ZA04Gde4FbTjaPpbKTRqZDRoBaBa6auwjnYOOum99ZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715804109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0rIqnCA77K1RBhhKCVJKPa2U5+04gy5Vls4a0laXHoo=; b=ZJrxjiIfrMobvIiYVVIp87Oa+2fVia/ndQwE5r899ZUL/y7l4SmQ5FfHQZ54GcEegentJi fPyoFyBuU7rPpkh2dkHzXwxw0HEaAftU5osSdIPFkN8bqgZTQtoYkBSbeJNdJYJTQ4fCXF oUy2xivD/PkZwjQSAgFWoaI6CktYzs+6Doc5NGR6Ptc1bVM6xeqxYKlfmm8rRJstY6vpne 9TVcrtMbtccwRz0oFX+LOO3Mc7JLwb3BNmFDbIBJSXGJB1xM3JvGrQN8ou439lnX2/cuGg Ged/RfwagBId3JdVolASxA9QzfxZekvCPS+SLG98lO4r+edkJ6GLg9bAF+M1Ug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vfkws4W3KzTdt; Wed, 15 May 2024 20:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44FKF94o096523; Wed, 15 May 2024 20:15:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44FKF9EV096520; Wed, 15 May 2024 20:15:09 GMT (envelope-from git) Date: Wed, 15 May 2024 20:15:09 GMT Message-Id: <202405152015.44FKF9EV096520@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Christoph Moench-Tegeder Subject: git: 3c6cc9a9508c - main - www/firefox-esr: fix build with clang18 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cmt X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c6cc9a9508c7b947bf9ed5d08e48056729c2b69 Auto-Submitted: auto-generated The branch main has been updated by cmt: URL: https://cgit.FreeBSD.org/ports/commit/?id=3c6cc9a9508c7b947bf9ed5d08e48056729c2b69 commit 3c6cc9a9508c7b947bf9ed5d08e48056729c2b69 Author: Christoph Moench-Tegeder AuthorDate: 2024-05-15 20:14:29 +0000 Commit: Christoph Moench-Tegeder CommitDate: 2024-05-15 20:14:29 +0000 www/firefox-esr: fix build with clang18 Submitted by: jkim PR: 278989 --- www/firefox-esr/files/patch-llvm18 | 199 +++++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) diff --git a/www/firefox-esr/files/patch-llvm18 b/www/firefox-esr/files/patch-llvm18 new file mode 100644 index 000000000000..f88e1eb079a8 --- /dev/null +++ b/www/firefox-esr/files/patch-llvm18 @@ -0,0 +1,199 @@ +From cd10f3ba0d83f34ca978cc4c7a552b72fdd068aa Mon Sep 17 00:00:00 2001 +From: David Tolnay +Date: Tue, 28 Nov 2023 11:18:39 -0800 +Subject: [PATCH 1/2] Flatten cursor.kind() matching in Item::parse down to one + match + +--- + bindgen/ir/item.rs | 84 ++++++++++++++++++++++------------------------ + 1 file changed, 41 insertions(+), 43 deletions(-) + +diff --git bindgen/ir/item.rs bindgen/ir/item.rs +index 0556452bfa..4f2d361e51 100644 +--- third_party/rust/bindgen/ir/item.rs ++++ third_party/rust/bindgen/ir/item.rs +@@ -1427,53 +1427,52 @@ + } + } + +- // Guess how does clang treat extern "C" blocks? +- if cursor.kind() == CXCursor_UnexposedDecl { +- Err(ParseError::Recurse) +- } else { ++ match cursor.kind() { ++ // Guess how does clang treat extern "C" blocks? ++ CXCursor_UnexposedDecl => Err(ParseError::Recurse), ++ + // We allowlist cursors here known to be unhandled, to prevent being + // too noisy about this. +- match cursor.kind() { +- CXCursor_MacroDefinition | +- CXCursor_MacroExpansion | +- CXCursor_UsingDeclaration | +- CXCursor_UsingDirective | +- CXCursor_StaticAssert | +- CXCursor_FunctionTemplate => { +- debug!( +- "Unhandled cursor kind {:?}: {:?}", +- cursor.kind(), +- cursor +- ); +- } +- CXCursor_InclusionDirective => { +- let file = cursor.get_included_file_name(); +- match file { +- None => { +- warn!( +- "Inclusion of a nameless file in {:?}", +- cursor +- ); +- } +- Some(filename) => { +- ctx.include_file(filename); +- } +- } +- } +- _ => { +- // ignore toplevel operator overloads +- let spelling = cursor.spelling(); +- if !spelling.starts_with("operator") { ++ CXCursor_MacroDefinition | ++ CXCursor_MacroExpansion | ++ CXCursor_UsingDeclaration | ++ CXCursor_UsingDirective | ++ CXCursor_StaticAssert | ++ CXCursor_FunctionTemplate => { ++ debug!( ++ "Unhandled cursor kind {:?}: {:?}", ++ cursor.kind(), ++ cursor ++ ); ++ Err(ParseError::Continue) ++ } ++ CXCursor_InclusionDirective => { ++ let file = cursor.get_included_file_name(); ++ match file { ++ None => { + warn!( +- "Unhandled cursor kind {:?}: {:?}", +- cursor.kind(), ++ "Inclusion of a nameless file in {:?}", + cursor + ); + } ++ Some(filename) => { ++ ctx.include_file(filename); ++ } + } ++ Err(ParseError::Continue) ++ } ++ _ => { ++ // ignore toplevel operator overloads ++ let spelling = cursor.spelling(); ++ if !spelling.starts_with("operator") { ++ warn!( ++ "Unhandled cursor kind {:?}: {:?}", ++ cursor.kind(), ++ cursor ++ ); ++ } ++ Err(ParseError::Continue) + } +- +- Err(ParseError::Continue) + } + } + + +From 2997017b5a3065b83e9d76f0080d6cb99c94c0c1 Mon Sep 17 00:00:00 2001 +From: David Tolnay +Date: Tue, 28 Nov 2023 11:21:18 -0800 +Subject: [PATCH 2/2] Handle CXCursor_LinkageSpec in Clang 18+ + +--- + bindgen/ir/item.rs | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git bindgen/ir/item.rs bindgen/ir/item.rs +index 4f2d361e51..dd587b088b 100644 +--- third_party/rust/bindgen/ir/item.rs ++++ third_party/rust/bindgen/ir/item.rs +@@ -1433,8 +1433,11 @@ impl Item { + } + + match cursor.kind() { +- // Guess how does clang treat extern "C" blocks? +- CXCursor_UnexposedDecl => Err(ParseError::Recurse), ++ // On Clang 18+, extern "C" is reported accurately as a LinkageSpec. ++ // Older LLVM treat it as UnexposedDecl. ++ CXCursor_LinkageSpec | CXCursor_UnexposedDecl => { ++ Err(ParseError::Recurse) ++ } + + // We allowlist cursors here known to be unhandled, to prevent being + // too noisy about this. +diff --git dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp +--- dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp ++++ dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp +@@ -97,11 +97,11 @@ + uint32_t width_; + uint32_t height_; + uint8_t y_; + uint8_t u_; + uint8_t v_; +- uint32_t timestamp_; ++ uint64_t timestamp_; + } idr_nalu; + }; + #pragma pack(pop) + + #define ENCODED_FRAME_MAGIC 0x004000b8 +diff --git dom/media/gtest/TestGMPRemoveAndDelete.cpp dom/media/gtest/TestGMPRemoveAndDelete.cpp +--- dom/media/gtest/TestGMPRemoveAndDelete.cpp ++++ dom/media/gtest/TestGMPRemoveAndDelete.cpp +@@ -359,11 +359,11 @@ + uint32_t width_; + uint32_t height_; + uint8_t y_; + uint8_t u_; + uint8_t v_; +- uint32_t timestamp_; ++ uint64_t timestamp_; + } idr_nalu; + }; + #pragma pack(pop) + + GMPVideoFrame* absFrame; +diff --git dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h +--- dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h ++++ dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h +@@ -300,11 +300,11 @@ + + struct InputImageData { + int64_t timestamp_us; + }; + // Map rtp time -> input image data +- DataMutex> mInputImageMap; ++ DataMutex> mInputImageMap; + + MediaEventProducer mInitPluginEvent; + MediaEventProducer mReleasePluginEvent; + }; + +diff --git dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp +--- dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp ++++ dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp +@@ -538,11 +538,11 @@ + return; + } + + webrtc::VideoFrameType ft; + GmpFrameTypeToWebrtcFrameType(aEncodedFrame->FrameType(), &ft); +- uint32_t timestamp = (aEncodedFrame->TimeStamp() * 90ll + 999) / 1000; ++ uint64_t timestamp = (aEncodedFrame->TimeStamp() * 90ll + 999) / 1000; + + GMP_LOG_DEBUG("GMP Encoded: %" PRIu64 ", type %d, len %d", + aEncodedFrame->TimeStamp(), aEncodedFrame->BufferType(), + aEncodedFrame->Size()); + +