Bug 266470 - www/firefox: 105.0_1,2 fails to build on i386
Summary: www/firefox: 105.0_1,2 fails to build on i386
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-gecko (Nobody)
URL:
Keywords:
Depends on:
Blocks: 265905
  Show dependency treegraph
 
Reported: 2022-09-17 21:17 UTC by Felix Palmen
Modified: 2023-04-23 09:01 UTC (History)
2 users (show)

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


Attachments
0001-www-firefox-fix-build-on-i386 (1.58 KB, patch)
2022-09-17 21:17 UTC, Felix Palmen
zirias: maintainer-approval? (gecko)
Details | Diff
[patch] fix redef of float typedefs - slightly different version (966 bytes, patch)
2022-11-23 23:44 UTC, John Hein
no flags 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 2022-09-17 21:17:19 UTC
Created attachment 236648 [details]
0001-www-firefox-fix-build-on-i386

Build error:

---
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-105.0/modules/fdlibm/src/e_acos.cpp:44:
/wrkdirs/usr/ports/www/firefox/work/firefox-105.0/modules/fdlibm/src/math_private.h:33:21: error: typedef redefinition with different types ('double' vs 'long double')
typedef double      __double_t;
                    ^
/usr/include/x86/_types.h:87:21: note: previous definition is here
typedef long double     __double_t;
                        ^
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-105.0/modules/fdlibm/src/e_acos.cpp:44:
/wrkdirs/usr/ports/www/firefox/work/firefox-105.0/modules/fdlibm/src/math_private.h:35:21: error: typedef redefinition with different types ('float' vs 'long double')
typedef float       __float_t;
                    ^
/usr/include/x86/_types.h:88:21: note: previous definition is here
typedef long double     __float_t;
                        ^
2 errors generated.
---

Patch attached :)
Comment 1 John Hein 2022-11-23 04:33:40 UTC
This is still a problem with firefox 107.0_2,2
Same error.

Has this been reported upstream?
Comment 2 John Hein 2022-11-23 07:32:46 UTC
This was fixed already for FreeBSD ports - see bug 258804 (reported by the OP in this bug).

This was reverted for the firefox 105.0 update (ports 27b5e1775e9d0732f5d4d5ba802179008992fcce). I did not find anything that described why this patch was removed.  And looking at the differences between fdlibm in 104 vs 105, I don't see anything that looks like it was intended to to address the problem in bug 258804.  Committer CC'd for comment.  Maybe the patch just needs to be rebased to accommodate the changes for math_private.h in 105 and was removed instead?

For those not already aware, see also https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 where this issue was raised upstream.  I'm catching up to what has already been discussed.  I don't like throwing in the towel for i386 (hinted in the other bug discussion) yet when this seems to be easily patched - at least for FreeBSD if not for all platforms.
Comment 3 John Hein 2022-11-23 23:44:22 UTC
Created attachment 238289 [details]
[patch] fix redef of float typedefs - slightly different version

Okay, I have caught up a bit - I read the upstream discussion more closely.

Attached is a slightly different patch that uses the same __LP64__ test that is in x86/_types.h.  And it's similar to the patch trying to make its way through the upstream bug review (https://bugzilla.mozilla.org/show_bug.cgi?id=1729459).

I think a test that is run at 'configure' time (which defines something like HAS__DOUBLE_T & HAS__FLOAT_T) is really what is needed upstream. The dynamics around this for all platforms are hard to pin down perfectly without a configure test.

So either Felix's patch (based on #ifndef __FreeBSD__) or this one is fine until upstream can figure out what it wants.

I built firefox again with this patch on i386 and it got past this problem.  Now it has the problem from bug 264857 again ("requires target feature 'sse'"), but that's a separate bug.  We probably need to 'regenerate libwebrtc build files' again, but I have not figured out how to do that (might need a hint from Christoph for that).