<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>311527</bug_id>
          
          <creation_ts>2026-04-05 07:03:02 -0700</creation_ts>
          <short_desc>[GTK][WebRTC] WebKit main fails to link with undefined symbol gst_webrtc_error_quark() in librice ICE sources</short_desc>
          <delta_ts>2026-04-11 12:26:04 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebRTC</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=311525</see_also>
          <bug_file_loc>https://github.com/WebKit/WebKit/tree/c51e9ffac777f72df41726bdc86e3e0be9f67844</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jaron">jaron</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jaron</cc>
    
    <cc>philn</cc>
    
    <cc>webkit-unassigned</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2197048</commentid>
    <comment_count>0</comment_count>
    <who name="Jaron">jaron</who>
    <bug_when>2026-04-05 07:03:02 -0700</bug_when>
    <thetext>After working around the RiceTurnConfig / librice API mismatch from bug 311525, I reproduced a different build failure when compiling WebKit GTK main with GStreamer WebRTC and librice on Linux ARM64.

Environment
- Host: Linux ARM64
- Reproduced on: Ubuntu 24.04 ARM64
- WebKit ref: main at c51e9ffac777f72df41726bdc86e3e0be9f67844
- GStreamer WebRTC: 1.24.2
- librice: main / v0.4.2

Build configuration
- GTK port
- ENABLE_MEDIA_STREAM=ON
- ENABLE_WEB_RTC=ON
- USE_GSTREAMER_WEBRTC=ON
- USE_LIBRICE=ON
- ENABLE_MINIBROWSER=ON

Observed result
The build gets to the final link of libwebkitgtk-6.0.so.4.17.0 and fails with an undefined symbol for gst_webrtc_error_quark().

Exact error excerpt
ld.lld: error: undefined symbol: gst_webrtc_error_quark()
&gt;&gt;&gt; referenced by UnifiedSource-f8afad56-36.cpp
&gt;&gt;&gt; did you mean: extern &quot;C&quot; gst_webrtc_error_quark
&gt;&gt;&gt; defined in: /usr/lib/aarch64-linux-gnu/libgstwebrtc-1.0.so
clang++: error: linker command failed with exit code 1
ninja: build stopped: subcommand failed.

Why this looks like a WebKit source integration issue
Three librice ICE source files include gst/webrtc/webrtc.h directly:
- Source/WebCore/Modules/mediastream/gstreamer/GStreamerIceAgent.cpp
- Source/WebCore/Modules/mediastream/gstreamer/GStreamerIceStream.cpp
- Source/WebCore/Modules/mediastream/gstreamer/GStreamerIceTransport.cpp

Nearby WebRTC files already wrap the same header with GST_USE_UNSTABLE_API, for example:
- Source/WebCore/Modules/mediastream/gstreamer/GStreamerIceTransport.h
- Source/WebCore/Modules/mediastream/gstreamer/GStreamerWebRTCUtils.h

Because the linker reports that the symbol exists in libgstwebrtc-1.0.so and specifically suggests an extern &quot;C&quot; mismatch, this looks like a header / linkage integration issue rather than a missing library.

Possible fix
Wrap the direct gst/webrtc/webrtc.h includes in the three .cpp files above with:
- #define GST_USE_UNSTABLE_API
- #include &lt;gst/webrtc/webrtc.h&gt;
- #undef GST_USE_UNSTABLE_API

That would match the include pattern already used by nearby WebRTC files.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2197054</commentid>
    <comment_count>1</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-04-05 09:18:11 -0700</bug_when>
    <thetext>What is your linker out of curiosity?

Anyway the proposed fix sounds right indeed. Would you like to send a PR? In case you&apos;re up for it but not yet familiar with the workflow, it is documented at https://docs.webkit.org/Getting%20Started/ContributingCode.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2197059</commentid>
    <comment_count>2</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-04-05 09:28:20 -0700</bug_when>
    <thetext>(In reply to Philippe Normand from comment #1)
&gt; What is your linker out of curiosity?
&gt; 

Oh sorry, it&apos;s mentioned in the bug report, ld.lld</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2197107</commentid>
    <comment_count>3</comment_count>
    <who name="Jaron">jaron</who>
    <bug_when>2026-04-05 15:50:34 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/62090</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2197113</commentid>
    <comment_count>4</comment_count>
    <who name="Jaron">jaron</who>
    <bug_when>2026-04-05 16:03:13 -0700</bug_when>
    <thetext>I re-tested this on the supported librice v0.2.1 path, and the same final link failure still reproduces with ld.lld on Ubuntu 24.04 ARM64.

The original GST_USE_UNSTABLE_API hypothesis in the bug report was not the right fix.

The minimal fix that gets past this linker failure is a one-file change in Source/WebCore/Modules/mediastream/gstreamer/GStreamerIceAgent.cpp:
- add a small file-local helper returning the WebRTC error-domain quark via g_quark_from_static_string(&quot;gst-webrtc-error-quark&quot;)
- replace the four g_error_new(GST_WEBRTC_ERROR, ...) call sites in that file with g_error_new(webkitGstWebRTCErrorQuark(), ...)

With that change applied:
- libwebkitgtk-6.0.so.4.17.0 links successfully
- MiniBrowser links successfully

The build then proceeds to a later packaging/install failure that appears unrelated to this linker issue.

I sent a PR with the one-file GStreamerIceAgent.cpp fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2197219</commentid>
    <comment_count>5</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-04-06 04:35:33 -0700</bug_when>
    <thetext>Can you share the output of nm -s /usr/lib64/libgstwebrtc-1.0.so | grep quark  (or wherever is your libgstwebrtc-1.0.so) ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2197235</commentid>
    <comment_count>6</comment_count>
    <who name="Jaron">jaron</who>
    <bug_when>2026-04-06 05:39:51 -0700</bug_when>
    <thetext>(In reply to Philippe Normand from comment #5)
&gt; Can you share the output of nm -s /usr/lib64/libgstwebrtc-1.0.so | grep
&gt; quark  (or wherever is your libgstwebrtc-1.0.so) ?

On the Ubuntu 24.04 ARM64 repro machine, the library is under `/usr/lib/aarch64-linux-gnu/`, not `/usr/lib64/`.

The exact symlinks/files there are:

$ ls -l /usr/lib/aarch64-linux-gnu/libgstwebrtc-1.0.so*
lrwxrwxrwx 1 root root     21 Apr 15  2024 /usr/lib/aarch64-linux-gnu/libgstwebrtc-1.0.so -&gt; libgstwebrtc-1.0.so.0
lrwxrwxrwx 1 root root     28 Apr 15  2024 /usr/lib/aarch64-linux-gnu/libgstwebrtc-1.0.so.0 -&gt; libgstwebrtc-1.0.so.0.2402.0
-rw-r--r-- 1 root root 133144 Apr 15  2024 /usr/lib/aarch64-linux-gnu/libgstwebrtc-1.0.so.0.2402.0

The literal `nm -s /usr/lib/aarch64-linux-gnu/libgstwebrtc-1.0.so | grep quark` produced no output on this package, but the dynamic symbol table does show the symbol:

$ nm -D -C /usr/lib/aarch64-linux-gnu/libgstwebrtc-1.0.so.0 | grep -E &apos;quark|gst_webrtc_error&apos;
                 U g_quark_from_static_string
0000000000007c00 T gst_webrtc_error_get_type
000000000000aa60 T gst_webrtc_error_quark

$ readelf -Ws /usr/lib/aarch64-linux-gnu/libgstwebrtc-1.0.so.0 | grep -E &apos;quark|gst_webrtc_error&apos;
    56: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND g_quark_from_static_string
   127: 000000000000aa60    32 FUNC    GLOBAL DEFAULT   11 gst_webrtc_error_quark
   154: 0000000000007c00   136 FUNC    GLOBAL DEFAULT   11 gst_webrtc_error_get_type</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2197251</commentid>
    <comment_count>7</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-04-06 08:29:55 -0700</bug_when>
    <thetext>I was able to reproduce the issue in a ubuntu-24.04 container, I&apos;ll try to dig this further when time allows...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2199202</commentid>
    <comment_count>8</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-04-11 08:22:09 -0700</bug_when>
    <thetext>I&apos;ve done some tests on an arm64 machine using ubuntu containers, building with GCC and the default linker. Indeed on 24.04 the build fails as described in this report. On 25.10 and 26.04 the build succeeded.

On 24.04 I also tried a build with mold as linker (export LDFLAGS=-fuse-ld=mold before calling cmake) and the build also failed.

So I&apos;m not entirely sure, but this looks like a toolchain bug in ubuntu 24.04 that was addressed in more recent versions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2199209</commentid>
    <comment_count>9</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-04-11 08:31:39 -0700</bug_when>
    <thetext>Or maybe addressed via gstreamer updates...

In any case, upstreaming a workaround in WebKit doesn&apos;t seem appropriate, we have no issue with similar gst error macros. So I&apos;ll close this bug, sorry :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2199242</commentid>
    <comment_count>10</comment_count>
    <who name="Jaron">jaron</who>
    <bug_when>2026-04-11 12:26:04 -0700</bug_when>
    <thetext>Adding one more data point from April 11, 2026.

I re-ran this on a fresh `origin/main` checkout on Ubuntu 24.04 ARM64, with only one local WebKit source change on top of upstream:

* Source/WebCore/platform/graphics/gstreamer/GUniquePtrGStreamer.h

The only change was to wrap the `gst/webrtc/webrtc.h` include in `extern &quot;C&quot;` for C++ builds, i.e. from:

    #define GST_USE_UNSTABLE_API
    #include &lt;gst/webrtc/webrtc.h&gt;
    #undef GST_USE_UNSTABLE_API

to:

    extern &quot;C&quot; {
    #define GST_USE_UNSTABLE_API
    #include &lt;gst/webrtc/webrtc.h&gt;
    #undef GST_USE_UNSTABLE_API
    }

This seems consistent with the original linker diagnostic, which specifically suggested an `extern &quot;C&quot;` mismatch for `gst_webrtc_error_quark()`.

With no other WebKit source changes applied, the GTK/WebRTC build completed successfully and `MiniBrowser` linked successfully. In this setup, the undefined `gst_webrtc_error_quark()` link failure from this bug no longer reproduced.

I realize the bug is already resolved as INVALID, so I am only adding this as another reproducibility data point. I am not claiming this proves the root cause is definitely WebKit-side rather than a Ubuntu 24.04 toolchain/package issue, only that this header-linkage change is sufficient to avoid the failure in my environment.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>