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.
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).
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(+)
"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.
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(+)
(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…
(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.