Open Bug 1930997 Opened 3 months ago Updated 1 month ago

armv7a-unknown-linux-gnueabihf: libxul fails to link in nightly with: undefined reference to `void mozilla::dom::TrustedTypePolicy::DetermineTrustedPolicyValue<mozilla::dom::CreateHTMLCallback>

Categories

(Core :: DOM: Security, defect)

Firefox 134
defect

Tracking

()

Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox134 --- wontfix
firefox135 --- fix-optional
firefox136 --- fix-optional

People

(Reporter: herrtimson, Unassigned, NeedInfo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

2.02 MB, application/x-xz
Details
Attached file build.log.xz

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0

Steps to reproduce:

I downloaded latest firefox-134.0 git sources and compiled them

Actual results:

I get this error when linking the final libxul:


134:09.43 /usr/bin/armv7a-unknown-linux-gnueabihf-g++ --sysroot /usr/armv7a-unknown-linux-gnueabihf -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mfloat-abi=hard -fno-rtti -pthread -fno-sized-deallocation -fno-aligned-new -ffunction-sections -fdata-sections -fno-math-errno -fno-exceptions -pipe -fPIC -pipe -fomit-frame-pointer -O2 -fno-omit-frame-pointer -funwind-tables -shared -Wl,-z,defs -Wl,--gc-sections -Wl,-h,libxul.so -o ../../../dist/bin/libxul.so -Wl,@/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox_build/toolkit/library/build/libxul_so.list    -Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--reduce-memory-overheads -Wl,--compress-debug-sections=zlib -Wl,-rpath=/usr/lib/firefox,--enable-new-dtags -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,now -Wl,-z,nocopyreloc -fuse-ld=bfd -fstack-protector-strong -Wl,-rpath-link,/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox_build/dist/bin  ../../../js/src/build/libjs_static.a ../../../build/pure_virtual/libpure_virtual.a ../../../armv7-unknown-linux-gnueabihf/release/libgkrust.a ../../../dist/bin/libmozsandbox.so ../../../dist/bin/libgkcodecs.so ../../../dist/bin/liblgpllibs.so ../../../dist/bin/libmozsqlite3.so ../../../dist/bin/libmozgtk.so -Wl,--version-script,libxul.so.symbols  -licui18n -licuuc -licudata -lresolv -ldl -lrt -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrandr -lXrender -lasound -lpthread -lc -lffi -lplds4 -lplc4 -lnspr4 -lz -lm -lssl3 -lsmime3 -lnss3 -lnssutil3 -lfreetype -lfontconfig -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgraphite2 -ljpeg -lpng16 -lwebp -lwebpdemux -levent -lvpx -lpixman-1 -lxcb-shm -lX11-xcb -lxcb -lXcursor -lXi
134:09.43 /usr/libexec/gcc/armv7a-unknown-linux-gnueabihf/ld.bfd: ../../../dom/security/trusted-types/TrustedTypeUtils.o: in function `mozilla::dom::TrustedTypeUtils::ProcessValueWithADefaultPolicy(mozilla::dom::Document const&, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, mozilla::dom::TrustedHTML**, mozilla::ErrorResult&)':
134:09.44 TrustedTypeUtils.cpp:(.text._ZN7mozilla3dom16TrustedTypeUtils30ProcessValueWithADefaultPolicyERKNS0_8DocumentERK12nsTSubstringIDsES8_PPNS0_11TrustedHTMLERNS_11ErrorResultE+0x210): undefined reference to `void mozilla::dom::TrustedTypePolicy::DetermineTrustedPolicyValue<mozilla::dom::CreateHTMLCallback>(RefPtr<mozilla::dom::CreateHTMLCallback> const&, nsTSubstring<char16_t> const&, nsTArray<JS::Value> const&, bool, mozilla::ErrorResult&, nsTSubstring<char16_t>&) const'
134:09.44 /usr/libexec/gcc/armv7a-unknown-linux-gnueabihf/ld.bfd: ../../../dist/bin/libxul.so: hidden symbol `_ZNK7mozilla3dom17TrustedTypePolicy27DetermineTrustedPolicyValueINS0_18CreateHTMLCallbackEEEvRK6RefPtrIT_ERK12nsTSubstringIDsERK8nsTArrayIN2JS5ValueEEbRNS_11ErrorResultERSA_' isn't defined
134:09.44 /usr/libexec/gcc/armv7a-unknown-linux-gnueabihf/ld.bfd: final link failed: bad value
134:09.44 collect2: error: ld returned 1 exit status
134:09.44 gmake[4]: *** [/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox-134.0/config/rules.mk:539: ../../../dist/bin/libxul.so] Error 1
134:09.44 gmake[4]: Leaving directory '/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox_build/toolkit/library/build'
134:09.44 gmake[3]: *** [/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox-134.0/config/recurse.mk:72: toolkit/library/build/target] Error 2
134:09.44 gmake[2]: *** [/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox-134.0/config/recurse.mk:34: compile] Error 2
134:09.44 gmake[1]: *** [/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox-134.0/config/rules.mk:359: default] Error 2
134:09.44 gmake: *** [client.mk:60: build] Error 2

Expected results:

I expect the compile to pass smoothly

the full and compressed build log is attached

this is a non-unified build, unified build is working fine

Keywords: regression
Regressed by: 1914372

TrustedTypeUtils.cpp is a rather new file, can the author of the introducing bug #1914372 please be so kind to have a look at what happens here?

:mbrodesser-Igalia, since you are the author of the regressor, bug 1914372, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(mbrodesser)

(In reply to tt_1 from comment #0)

Created attachment 9437213 [details]
build.log.xz

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0

Steps to reproduce:

I downloaded latest firefox-134.0 git sources and compiled them

Actual results:

I get this error when linking the final libxul:

134:09.43 /usr/bin/armv7a-unknown-linux-gnueabihf-g++ --sysroot /usr/armv7a-unknown-linux-gnueabihf -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mfloat-abi=hard -fno-rtti -pthread -fno-sized-deallocation -fno-aligned-new -ffunction-sections -fdata-sections -fno-math-errno -fno-exceptions -pipe -fPIC -pipe -fomit-frame-pointer -O2 -fno-omit-frame-pointer -funwind-tables -shared -Wl,-z,defs -Wl,--gc-sections -Wl,-h,libxul.so -o ../../../dist/bin/libxul.so -Wl,@/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox_build/toolkit/library/build/libxul_so.list -Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--reduce-memory-overheads -Wl,--compress-debug-sections=zlib -Wl,-rpath=/usr/lib/firefox,--enable-new-dtags -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,now -Wl,-z,nocopyreloc -fuse-ld=bfd -fstack-protector-strong -Wl,-rpath-link,/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox_build/dist/bin ../../../js/src/build/libjs_static.a ../../../build/pure_virtual/libpure_virtual.a ../../../armv7-unknown-linux-gnueabihf/release/libgkrust.a ../../../dist/bin/libmozsandbox.so ../../../dist/bin/libgkcodecs.so ../../../dist/bin/liblgpllibs.so ../../../dist/bin/libmozsqlite3.so ../../../dist/bin/libmozgtk.so -Wl,--version-script,libxul.so.symbols -licui18n -licuuc -licudata -lresolv -ldl -lrt -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrandr -lXrender -lasound -lpthread -lc -lffi -lplds4 -lplc4 -lnspr4 -lz -lm -lssl3 -lsmime3 -lnss3 -lnssutil3 -lfreetype -lfontconfig -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgraphite2 -ljpeg -lpng16 -lwebp -lwebpdemux -levent -lvpx -lpixman-1 -lxcb-shm -lX11-xcb -lxcb -lXcursor -lXi
134:09.43 /usr/libexec/gcc/armv7a-unknown-linux-gnueabihf/ld.bfd: ../../../dom/security/trusted-types/TrustedTypeUtils.o: in function mozilla::dom::TrustedTypeUtils::ProcessValueWithADefaultPolicy(mozilla::dom::Document const&, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, mozilla::dom::TrustedHTML**, mozilla::ErrorResult&)': 134:09.44 TrustedTypeUtils.cpp:(.text._ZN7mozilla3dom16TrustedTypeUtils30ProcessValueWithADefaultPolicyERKNS0_8DocumentERK12nsTSubstringIDsES8_PPNS0_11TrustedHTMLERNS_11ErrorResultE+0x210): undefined reference tovoid mozilla::dom::TrustedTypePolicy::DetermineTrustedPolicyValue<mozilla::dom::CreateHTMLCallback>(RefPtr<mozilla::dom::CreateHTMLCallback> const&, nsTSubstring<char16_t> const&, nsTArray<JS::Value> const&, bool, mozilla::ErrorResult&, nsTSubstring<char16_t>&) const'
134:09.44 /usr/libexec/gcc/armv7a-unknown-linux-gnueabihf/ld.bfd: ../../../dist/bin/libxul.so: hidden symbol `ZNK7mozilla3dom17TrustedTypePolicy27DetermineTrustedPolicyValueINS0_18CreateHTMLCallbackEEEvRK6RefPtrIT_ERK12nsTSubstringIDsERK8nsTArrayIN2JS5ValueEEbRNS_11ErrorResultERSA' isn't defined

I don't see anything in the code which could explain that error. Checked also [0].

134:09.44 /usr/libexec/gcc/armv7a-unknown-linux-gnueabihf/ld.bfd: final link failed: bad value
134:09.44 collect2: error: ld returned 1 exit status
134:09.44 gmake[4]: *** [/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox-134.0/config/rules.mk:539: ../../../dist/bin/libxul.so] Error 1
134:09.44 gmake[4]: Leaving directory '/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox_build/toolkit/library/build'
134:09.44 gmake[3]: *** [/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox-134.0/config/recurse.mk:72: toolkit/library/build/target] Error 2
134:09.44 gmake[2]: *** [/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox-134.0/config/recurse.mk:34: compile] Error 2
134:09.44 gmake[1]: *** [/var/tmp/portage/portage/www-client/firefox-134.0/work/firefox-134.0/config/rules.mk:359: default] Error 2
134:09.44 gmake: *** [client.mk:60: build] Error 2

Expected results:

I expect the compile to pass smothly

the full and compressed build log is attached

this is a non-unified build, unified build is working fine

There are Linux64 non-unified builds which build successfully, e.g. [1]. This issue occurred with ARM, so perhaps there includes are changed somehow.

tt_1: The log doesn't show that ./mach build is invoked. How is the build started? Could you try a clean build?

[0] https://firefox-source-docs.mozilla.org/build/buildsystem/unified-builds.html#why-are-there-unrelated-compilation-failures-when-i-change-files
[1] https://treeherder.mozilla.org/jobs?repo=autoland&selectedTaskRun=KJfG_rRjSyOChx4jYrsP6w.0

Flags: needinfo?(mbrodesser) → needinfo?(herrtimson)

I don't think this should block TT.

No longer blocks: trusted-types
Component: Untriaged → General
Product: Firefox → Firefox Build System
Summary: libxul fails to link in nightly with: undefined reference to `void mozilla::dom::TrustedTypePolicy::DetermineTrustedPolicyValue<mozilla::dom::CreateHTMLCallback> → armv7a-unknown-linux-gnueabihf: libxul fails to link in nightly with: undefined reference to `void mozilla::dom::TrustedTypePolicy::DetermineTrustedPolicyValue<mozilla::dom::CreateHTMLCallback>

It's worth noting the failing build is with --disable-unified-build.
This most likely comes from lack of template instantiation for DetermineTrustedPolicyValue. I'm somewhat surprised non-unified builds on CI are not busted, but then, it could just be that in some cases/platforms the compiler chooses to inline the function call and in other cases it doesn't. When it's inlined, you end up with the build error. The function would need a manual instantiation.

Component: General → DOM: Security
Product: Firefox Build System → Core

Here's a way to reproduce the issue that doesn't involve building for armhf linux:

  • Add MOZ_ALWAYS_INLINE to the definition of TrustedTypePolicy::DetermineTrustedPolicyValue in dom/security/trusted-types/TrustedTypePolicy.cpp.
  • Build with this mozconfig:
ac_add_options --disable-unified-build

Adding template instantiation for all three variants of DetermineTrustedPolicyValue would fix it, and so would moving the function declaration from the .cpp to the .h.

@Mike Hommey: Thanks for checking that. Do you plan to upload a patch?

Flags: needinfo?(mh+mozilla)

I was hoping Mirko would look into it as being the author of the regressor.

Flags: needinfo?(mh+mozilla) → needinfo?(mbrodesser)
Status: UNCONFIRMED → NEW
Ever confirmed: true

Mirko is not working on Trusted Type anymore. I'm basically taking over his work. Was just curious if you plan to upload a patch, since you already has a solution. Otherwise, I'll do it when I have time.

Flags: needinfo?(mbrodesser)

I gave two ideas for a solution, I don't know which one would be preferred. There are other possible options too.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: