Bug 260186

Summary: devel/wasi-compiler-rt*: predefine test results (should fix build on aarch64)
Product: Ports & Packages Reporter: Val Packett <val>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: manu, mikael
Priority: --- Keywords: patch
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
0001-devel-wasi-compiler-rt-predefine-test-results-should.patch val: maintainer-approval+

Description Val Packett 2021-12-03 08:46:57 UTC
Created attachment 229856 [details]
0001-devel-wasi-compiler-rt-predefine-test-results-should.patch

Silly LLVM, no one bothered to exclude the float16 flag when building for wasm >_<

Haven't had the time to test but this should fix the build.
Comment 1 Emmanuel Vadot freebsd_committer freebsd_triage 2021-12-03 08:56:27 UTC
Yup that did it.
Will commit today.
Thanks Greg.
Comment 2 Mikael Urankar freebsd_committer freebsd_triage 2021-12-03 09:06:51 UTC
Why not passing the correct CFLAGS instead?
CFLAGS+=       --target=wasm32-unknown-unknown
Comment 3 Val Packett 2021-12-03 10:29:34 UTC
(In reply to Mikael Urankar from comment #2)
Hmm. The target is set by -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=wasm32-wasi.
I don't think using raw CFLAGS for the target to force llvm to use the same target for tests is "clean", but this isn't "clean" either.
I guess it doesn't matter which hack we use, whatever works is fine.
Comment 4 Emmanuel Vadot freebsd_committer freebsd_triage 2021-12-03 16:19:52 UTC
So with Greg's current patch I can build firefox fine.
But it doesn't work, direct segfault on wayland and tab crash all the time on Xorg. That's probably not related to this so Mikael which version you seems is best ?
I honestly don't care.
Comment 5 Mikael Urankar freebsd_committer freebsd_triage 2021-12-04 18:34:22 UTC
(In reply to Emmanuel Vadot from comment #4)
Use greg's version
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-12-05 08:42:46 UTC
A commit in branch main references this bug:

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

commit d2374818d84832752be57cb4469c5ecd0004bad8
Author:     Greg V <greg@unrelenting.technology>
AuthorDate: 2021-12-03 08:43:44 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2021-12-05 08:41:13 +0000

    devel/wasi-compiler-rt*: predefine test results

    PR:     260186

 devel/wasi-compiler-rt11/Makefile | 12 +++++++++++-
 devel/wasi-compiler-rt12/Makefile | 12 +++++++++++-
 devel/wasi-compiler-rt13/Makefile | 12 +++++++++++-
 3 files changed, 33 insertions(+), 3 deletions(-)
Comment 7 Val Packett 2021-12-07 00:00:42 UTC
(In reply to Emmanuel Vadot from comment #4)
> it doesn't work, direct segfault on wayland and tab crash all the time on Xorg

hm. Just built a nightly on an EC2 c6g instance using llvm13 with about the same mozconfig I use on amd64, running remotely with waypipe "just worked".

ports r95.0 did segfault in libX11.so.6`XInternAtoms via nsXRemoteServer — idk why is it trying to touch libX11 without $DISPLAY, but adding a --no-remote argument bypasses this and it works.