Bug 258804 - www/firefox: 93.0 fails to build on i386
Summary: www/firefox: 93.0 fails to build on i386
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gecko (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-30 11:23 UTC by Felix Palmen
Modified: 2022-11-23 23:13 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (gecko)


Attachments
0001-www-firefox-fix-build-on-i386 (1.83 KB, patch)
2021-09-30 18:31 UTC, Felix Palmen
zirias: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Palmen freebsd_committer freebsd_triage 2021-09-30 11:23:26 UTC
Compiler error:

---
/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/modules/fdlibm/src/math_private
.h:33:21: error: typedef redefinition with different types ('double' vs 'long do
uble')
typedef double      __double_t;
                    ^
/usr/include/x86/_types.h:87:21: note: previous definition is here
typedef long double     __double_t;
                        ^
1 error generated.
---

Testing a possible fix right now, will add a patch if successful.
Comment 1 Felix Palmen freebsd_committer freebsd_triage 2021-09-30 18:31:15 UTC
Created attachment 228295 [details]
0001-www-firefox-fix-build-on-i386

So, this took a while. Turns out the "fdlibm" module that causes the error is actually taken from FreeBSD, but patched heavily.

The obvious fix is to remove the typedef for __double_t there, so it doesn't conflict with the one introduced via <sys/types.h>. But then, an inline function for converting a __double_t value to an integer is missing. Therefore, revert the patch applied upstream that removes that function (see changes to Makefile).

Build tested for both i386 and amd64, also did a quick smoke test of both builds (browser runs fine, loads and displays websites).
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-10-02 21:11:23 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=edae8a1c040482b1cc559eee4f6d626288d54965

commit edae8a1c040482b1cc559eee4f6d626288d54965
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2021-10-02 21:08:43 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2021-10-02 21:08:43 +0000

    www/firefox: fix build on 32bit

    this brings the double_t-related typedefs in line with our definitions
    and brings back the rounding helpers for those.

    PR:             258804
    Reported by:    Felix Palmen

 www/firefox/files/patch-bug1729459_comment12 (new) | 93 ++++++++++++++++++++++
 1 file changed, 93 insertions(+)
Comment 3 Christoph Moench-Tegeder freebsd_committer freebsd_triage 2021-10-02 21:14:55 UTC
"wontfix" upstream, perhaps it's time to get rid of 32bit?
I had about the same idea of fixing this, but without relying on the patch file to be revertable.
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-10-02 21:16:25 UTC
A commit in branch 2021Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=24c6d07433667651624433132588a3a41dec7be1

commit 24c6d07433667651624433132588a3a41dec7be1
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2021-10-02 21:08:43 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2021-10-02 21:16:09 +0000

    www/firefox: fix build on 32bit

    this brings the double_t-related typedefs in line with our definitions
    and brings back the rounding helpers for those.

    PR:             258804
    Reported by:    Felix Palmen

    (cherry picked from commit edae8a1c040482b1cc559eee4f6d626288d54965)

 www/firefox/files/patch-bug1729459_comment12 (new) | 93 ++++++++++++++++++++++
 1 file changed, 93 insertions(+)
Comment 5 Felix Palmen freebsd_committer freebsd_triage 2021-10-03 08:28:38 UTC
(In reply to Christoph Moench-Tegeder from comment #3)
> "wontfix" upstream, perhaps it's time to get rid of 32bit?
If I get that upstream issue correct, it's "wontfix" because they can't seem to get it correct for all platforms (especially windows) and decided i386 is irrelevant?

> I had about the same idea of fixing this, but without relying on the patch
> file to be revertable.
Well, then it's duplicating code, which could theoretically change when they pull newer versions from FreeBSD. But indeed, a clean revert of a patch in the middle of a serious isn't guaranteed either. So, both approaches have their cons…
Comment 6 John Hein 2022-11-23 23:13:06 UTC
(In reply to Felix Palmen from comment #5)
It seems to me this bug is still open upstream.  It was marked wontfix for [now] older versions of firefox, but a patch that works for "all platforms, all compilers" might well be accepted for the latest version of firefox.

I'm only bringing this up here because we're hitting this now again in firefox 105 (bug 266470) and still in 107 - after the patch applied here was removed.

I think it makes sense to keep carrying along the small patch to avoid the bad __double_t and __float_t typedefs in the FreeBSD ports tree until upstream can get something it is happy with.