Building fails with binutils 2.41 (ffvpx)

Discussions about the development and maturation of the platform code (UXP).
Warning: may contain highly-technical topics.

Moderators: trava90, athenian200

User avatar
micwoj92
Fanatic
Fanatic
Posts: 175
Joined: 2020-12-22, 20:57

Building fails with binutils 2.41 (ffvpx)

Unread post by micwoj92 » 2023-08-02, 19:25

Building tag 32.3.1_Release
Error:

Code: Select all

0:13.26 /home/micwoj92/pkg/palemoon-gtk3/src/Pale-Moon/platform/media/ffvpx/libavcodec/x86/mathops.h: Assembler messages:
0:13.26 /home/micwoj92/pkg/palemoon-gtk3/src/Pale-Moon/platform/media/ffvpx/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
This was fixed in ffmpeg upstream:
https://git.ffmpeg.org/gitweb/ffmpeg.gi ... e6f464f0eb

dbsoft
Project Contributor
Project Contributor
Posts: 419
Joined: 2020-02-21, 17:35

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by dbsoft » 2023-08-04, 19:49

Looking at that fix it seems insane, why not just change the variable name to "bitshift" or something instead of checking if "shift" is a built-in and running different code? Unless I am misunderstanding what that built-in is doing... I'm applying that patch in my tree but I am really confused by this fix.

Can you test with this branch: https://repo.palemoon.org/dbsoft/UXP/co ... misc-fixes

I am going to test on all my platforms as well.

User avatar
micwoj92
Fanatic
Fanatic
Posts: 175
Joined: 2020-12-22, 20:57

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by micwoj92 » 2023-08-04, 22:13

I am unable to test until end of the weekend, but it should just work (in my opinion it would be better to update ffvpx to more recent version).

dbsoft
Project Contributor
Project Contributor
Posts: 419
Joined: 2020-02-21, 17:35

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by dbsoft » 2023-08-05, 20:17

micwoj92 wrote:
2023-08-04, 22:13
I am unable to test until end of the weekend, but it should just work (in my opinion it would be better to update ffvpx to more recent version).
It was updated a year ago, not saying that a new version wouldn't be good... but that binutils is brand new, I even installed some new distros in my virtual machine to try and test it and the newest version I was able to get was 2.40. Seems kind of more like a problem with binutils 2.41 than a problem with ffvpx to me.

User avatar
micwoj92
Fanatic
Fanatic
Posts: 175
Joined: 2020-12-22, 20:57

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by micwoj92 » 2023-08-07, 16:07

It works and I've only applied the fix to `media/ffvpx/libavcodec/x86/mathops.h`. I did not touch anything in libav.

dbsoft
Project Contributor
Project Contributor
Posts: 419
Joined: 2020-02-21, 17:35

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by dbsoft » 2023-08-07, 22:09

micwoj92 wrote:
2023-08-07, 16:07
It works and I've only applied the fix to `media/ffvpx/libavcodec/x86/mathops.h`. I did not touch anything in libav.
Did you test with my branch? I do not have any distributions that use 2.41 so I have not tested myself. If it works with my branch will discuss whether or not to merge it.

User avatar
micwoj92
Fanatic
Fanatic
Posts: 175
Joined: 2020-12-22, 20:57

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by micwoj92 » 2023-08-08, 00:16

I did not use your branch, because it also has different changes, I only applied commit aba3f14273037a4b0b2cc0bcef71459a5fbe03f8.
But yes, it also works.

I am just confused as to why have these 2 directories in source, as libav is name of old ffmpeg fork and ffvpx has files from ffmpeg 4.2.7.

If you look at commit history libav contains only tree wide changes, where ffvpx has seen more commits.

dbsoft
Project Contributor
Project Contributor
Posts: 419
Joined: 2020-02-21, 17:35

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by dbsoft » 2023-08-08, 00:39

micwoj92 wrote:
2023-08-08, 00:16
I did not use your branch, because it also has different changes, I only applied commit aba3f14273037a4b0b2cc0bcef71459a5fbe03f8.
But yes, it also works.
Ok, Thanks! I'll talk to Moonchild about it, not really sure why it exists in 2 places either.

User avatar
micwoj92
Fanatic
Fanatic
Posts: 175
Joined: 2020-12-22, 20:57

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by micwoj92 » 2023-08-08, 01:24

Switch from libav to ffvpx is a change from Mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=1476231

dbsoft
Project Contributor
Project Contributor
Posts: 419
Joined: 2020-02-21, 17:35

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by dbsoft » 2023-08-08, 16:59

micwoj92 wrote:
2023-08-08, 01:24
Switch from libav to ffvpx is a change from Mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=1476231
So did we switch to ffvpx but not remove the old libav?

User avatar
micwoj92
Fanatic
Fanatic
Posts: 175
Joined: 2020-12-22, 20:57

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by micwoj92 » 2023-08-09, 04:35

As I understand Firefox also had 2 in source tree at the same time, this is just bug in which the libav (functionality) was removed completely so that everything used ffvpx.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by Moonchild » 2023-08-09, 06:57

This has to do with decoding versus encoding in certain formats. Something something WebRTC something.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

miroR
Fanatic
Fanatic
Posts: 116
Joined: 2016-05-31, 19:22

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by miroR » 2023-08-15, 21:20

I seem to have just hit this bug/mismatch too.

Code: Select all

apt-cache policy binutils
binutils:
  Installed: 2.41-4
And this is from my logs:

Code: Select all

11:47.61 /mnt/src/Pale-Moon/platform/media/ffvpx/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
11:47.62 In the directory  /mnt/src/Pale-Moon/obj-x86_64-pc-linux-gnu/media/ffvpx/libavcodec
11:47.62 The following command failed to execute properly:
11:47.62 /usr/bin/gcc-12 -std=gnu99 -o flac.o -c -DNDEBUG=1 -DTRIMMED=1 -DHAVE_AV_CONFIG_H -I/mnt/src/Pale-Moon/platform/media/ffvpx/libavcodec -I/mnt/src/Pale-Moon/obj-x86_64-pc-linux-gnu/media/ffvpx/libavcodec -I/mnt/src/Pale-Moon/platform/media/ffvpx -I/mnt/src/Pale-Moon/obj-x86_64-pc-linux-gnu/dist/include -I/mnt/src/Pale-Moon/obj-x86_64-pc-linux-gnu/dist/include/nspr -I/mnt/src/Pale-Moon/obj-x86_64-pc-linux-gnu/dist/include/nss -fPIC -include /mnt/src/Pale-Moon/obj-x86_64-pc-linux-gnu/mozilla-config.h -DMOZILLA_CLIENT -MD -MP -MF .deps/flac.o.pp -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=multistatement-macros -flifetime-dse=1 -fno-strict-aliasing -fno-math-errno -pipe -msse2 -mfpmath=sse -pthread -g -O2 -w -fomit-frame-pointer -fcommon -Wno-parentheses -Wno-pointer-sign -Wno-sign-compare -Wno-switch -Wno-type-limits -Wno-unused-function -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-maybe-uninitialized -include libavutil_visibility.h /mnt/src/Pale-Moon/platform/media/ffvpx/libavcodec/flac.c
11:47.62 gmake[5]: *** [/mnt/src/Pale-Moon/platform/config/rules.mk:853: flac.o] Error 1
11:47.62 gmake[4]: *** [/mnt/src/Pale-Moon/platform/config/recurse.mk:71: media/ffvpx/libavcodec/target] Error 2
11:47.62 gmake[4]: *** Waiting for unfinished jobs....
11:54.24 libaccessible_atk.a.desc
11:55.18 libhunspell.so
11:55.60 mpi_amd64_common.o
11:55.90 libfreeblpriv3.so
11:56.02 ../../../../../build/unix/gold/ld: warning: wildcard match appears in both version 'NSSprivate_3.11' and 'NSSprivate_3.16' in script
12:09.16 libgfx_thebes.a.desc
13:30.97 libjs_static.a
13:32.72 gmake[3]: *** [/mnt/src/Pale-Moon/platform/config/recurse.mk:33: compile] Error 2
13:32.72 gmake[2]: *** [/mnt/src/Pale-Moon/platform/config/rules.mk:493: default] Error 2
13:32.72 gmake[1]: *** [/mnt/src/Pale-Moon/client.mk:406: realbuild] Error 2
13:32.72 gmake: *** [client.mk:164: build] Error 2
Is there a solution to this?

miroR
Fanatic
Fanatic
Posts: 116
Joined: 2016-05-31, 19:22

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by miroR » 2023-08-16, 03:12

It looks to me Pale Moon has no influence on that. IUUC this is the XUL Platform submodule code.
So I guess a few days wait is in order.
Anybody knows better, pls. tell!
----
Oh no!
On https://repo.palemoon.org/MoonchildProductions/UXP there read:
This repository holds the code for a unified application platform for XUL-based applications. It is a hard fork from the Mozilla code repository (mozilla-central) with an ESR-52 fork point.

In addition to further development based on the Mozilla upstream code, and selective cherry-picking of directly-applicable patches, this repository has its own development and holds the base for a maintained platform to be used by XUL applications.
And there is no result on binutils-2.41 search:
https://repo.palemoon.org/MoonchildProd ... utils-2.41
at the time of this writing. I get:
Search results for "binutils-2.41" in UXP
Hakuehtoasi vastaavaa lähdekoodia ei löytynyt.
(which is in Finnish IIUC. and my geolocation is in Croatia).
If I were more advanced at coding in C, I'd look into the code, but it's beyond my skills.

User avatar
micwoj92
Fanatic
Fanatic
Posts: 175
Joined: 2020-12-22, 20:57

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by micwoj92 » 2023-08-16, 04:31


miroR
Fanatic
Fanatic
Posts: 116
Joined: 2016-05-31, 19:22

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by miroR » 2023-08-16, 12:00

micwoj92 wrote:
2023-08-16, 04:31
But there is a patch: https://repo.palemoon.org/dbsoft/UXP/co ... misc-fixes
Thanks! Patched it, and I have now:

Code: Select all

 $ ~/palemoon/palemoon-bin -version
Moonchild Productions Pale Moon 32.3.1
$ 
running. Just watching videos on Twitter. Apparently a fine install, so far.

I see it's not included in maste, as yet.
A considerable number of people are running testing branch of Debian, which installs binutils-2.41 in these days.
That's Debian Testing codename trixie which I'm running.
And that's not unstable, but only not fully tested packages. Unstable is always codename sid.

Just saying this for a casual visitor (or for people not familiar with Debian.

Sure, once the packages of these versions as in testing, go to stable, they'll be, some of them, further patched. But not all. Some will simply appear in weeks or so time, in stable as they currently are now in testing.

Thanks again micwoj92 !

dbsoft
Project Contributor
Project Contributor
Posts: 419
Joined: 2020-02-21, 17:35

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by dbsoft » 2023-08-20, 09:42

miroR wrote:
2023-08-16, 12:00
A considerable number of people are running testing branch of Debian, which installs binutils-2.41 in these days.
I installed the latest stable Debian and it had 2.40. To me this seems like a bug in binutils 2.41, but if there is a demand for it I'll put in a pull with those changes.

Just hesitant to do so since it seems like a bug and there are no production systems that seem to be running bintuls 2.41 yet.

https://sourceware.org/bugzilla/show_bug.cgi?id=30578

miroR
Fanatic
Fanatic
Posts: 116
Joined: 2016-05-31, 19:22

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by miroR » 2023-12-28, 20:35

I seem to have hit this issue while building 32.5.2_Release.
It's somewhat different. Here:

Code: Select all

10:29.32 ../../../../../build/unix/gold/ld: warning: wildcard match appears in both version 'NSS_3.4' and 'NSS_3.52' in script
10:30.41 libnetwerk_dns.a.desc
10:30.58 /mnc/src_n2/Pale-Moon/platform/media/ffvpx/libavcodec/x86/mathops.h: Assembler messages:
10:30.58 /mnc/src_n2/Pale-Moon/platform/media/ffvpx/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
[... 18 identical lines cut out here ...]
10:30.58 /mnc/src_n2/Pale-Moon/platform/media/ffvpx/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
10:30.60
10:30.60 In the directory  /mnc/src_n2/Pale-Moon/obj-x86_64-pc-linux-gnu/media/ffvpx/libavcodec
10:30.60 The following command failed to execute properly:
10:30.60 /usr/bin/gcc -std=gnu99 -o flac.o -c -DNDEBUG=1 -DTRIMMED=1 -DHAVE_AV_CONFIG_H -I/mnc/src_n2/Pale-Moon/platform/media/ffvpx/libavcodec -I/mnc/src_n2/Pale-Moon/obj-x86_64-pc-linux-gnu/media/ffvpx/libavcodec -I/mnc/src_n2/Pale-Moon/platform/media/ffvpx -I/mnc/src_n2/Pale-Moon/obj-x86_64-pc-linux-gnu/dist/include -I/mnc/src_n2/Pale-Moon/obj-x86_64-pc-linux-gnu/dist/include/nspr -I/mnc/src_n2/Pale-Moon/obj-x86_64-pc-linux-gnu/dist/include/nss -fPIC -include /mnc/src_n2/Pale-Moon/obj-x86_64-pc-linux-gnu/mozilla-config.h -DMOZILLA_CLIENT -MD -MP -MF .deps/flac.o.pp -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=multistatement-macros -flifetime-dse=1 -fno-strict-aliasing -fno-math-errno -pipe -msse2 -mfpmath=sse -pthread -g -O2 -w -fomit-frame-pointer -fcommon -Wno-parentheses -Wno-pointer-sign -Wno-sign-compare -Wno-switch -Wno-type-limits -Wno-unused-function -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-maybe-uninitialized -include libavutil_visibility.h /mnc/src_n2/Pale-Moon/platform/media/ffvpx/libavcodec/flac.c
10:30.60 gmake[5]: *** [/mnc/src_n2/Pale-Moon/platform/config/rules.mk:857: flac.o] Error 1
10:30.60 gmake[4]: *** [/mnc/src_n2/Pale-Moon/platform/config/recurse.mk:71: media/ffvpx/libavcodec/target] Error 2
10:30.60 gmake[4]: *** Waiting for unfinished jobs....
10:30.71 palemoon
10:34.23 libhunspell.so
10:35.77 mpi_amd64_common.o
10:36.08 libfreeblpriv3.so
10:36.19 ../../../../../build/unix/gold/ld: warning: wildcard match appears in both version 'NSSprivate_3.11' and 'NSSprivate_3.16' in script
10:42.97 libgfx_thebes.a.desc
10:43.03 gmake[3]: *** [/mnc/src_n2/Pale-Moon/platform/config/recurse.mk:33: compile] Error 2
10:43.03 gmake[2]: *** [/mnc/src_n2/Pale-Moon/platform/config/rules.mk:497: default] Error 2
10:43.03 gmake[1]: *** [/mnc/src_n2/Pale-Moon/client.mk:406: realbuild] Error 2
10:43.03 gmake: *** [client.mk:164: build] Error 2
10:43.06 0 compiler warnings present.
10:43.08 Notification center failed: Install the python dbus module to get a notification when the build finishes.

User avatar
micwoj92
Fanatic
Fanatic
Posts: 175
Joined: 2020-12-22, 20:57

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by micwoj92 » 2023-12-28, 20:46

No, it's same error. Just apply patch and it builds fine.

miroR
Fanatic
Fanatic
Posts: 116
Joined: 2016-05-31, 19:22

Re: Building fails with binutils 2.41 (ffvpx)

Unread post by miroR » 2023-12-28, 21:02

dbsoft wrote:
2023-08-20, 09:42
miroR wrote:
2023-08-16, 12:00
A considerable number of people are running testing branch of Debian, which installs binutils-2.41 in these days.
I installed the latest stable Debian and it had 2.40. To me this seems like a bug in binutils 2.41, but if there is a demand for it I'll put in a pull with those changes.

Just hesitant to do so since it seems like a bug and there are no production systems that seem to be running bintuls 2.41 yet.

https://sourceware.org/bugzilla/show_bug.cgi?id=30578

Code: Select all

# apt-cache policy binutils
binutils:
  Installed: 2.41.50.20231214-1
And, true, the stable Debian is bookworm, and it has:
binutils (2.40-2)
as per https://packages.debian.org/bookworm/binutils

The patch is not straightforward to apply, however, since as per:
https://repo.palemoon.org/dbsoft/UXP/co ... 9a5fbe03f8
in the git repo this file exists:

Code: Select all

platform/media/ffvpx/libavcodec/x86/mathops.h
but this file does not:

Code: Select all

platform/media/libav/libavcodec/x86/mathops.h
I am not sure I can solve this. Dunno, maybe I'll have to wait (much) longer...