[Bug 277021] www/firefox: error on start after updating to 123.0 (rc1, rc2)

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 18 Feb 2024 05:34:24 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277021

--- Comment #70 from Tatsuki Makino <tatsuki_makino@hotmail.com> ---
(In reply to Tomoaki AOKI from comment #69)

> I cannot understand why CPUTYPE causes ceil() and floor() is used or not.

Me too :)
There is no reason for this anywhere in the Firefox source code.


So a new experiment will be made.
#include <math.h>, <stdlib.h> and <stdio.h>
int main(int argc, char * argv[]) { double d; d = ceil(floor(atof(argv[1])));
printf("%f\n", d); return 0; }
~
Compile it with the following options
clang15 -S -O0 -march= /tmp/test_src.c
clang15 -S -O0 -march=haswell /tmp/test_src.c

It would make the file with the suffix changed to s.
If -march= is empty, there is a callq of ceil and floor.
If -march=haswell then it does not exist.
vroundsd is used for floor and ceil.

This seems to be an SSE4 instruction, so CFLAGS+=-mno-sse4 is the minimal
workaround.


Could this time be the basis for a correct patch? :)

-- 
You are receiving this mail because:
You are the assignee for the bug.