From nobody Tue Nov 23 21:02:24 2021 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1195718AD7CF for ; Tue, 23 Nov 2021 21:02:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzGmc5ccLz4kJc for ; Tue, 23 Nov 2021 21:02:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A16F01DA15 for ; Tue, 23 Nov 2021 21:02:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 1ANL2OA1040450 for ; Tue, 23 Nov 2021 21:02:24 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1ANL2OAS040449 for ports-bugs@FreeBSD.org; Tue, 23 Nov 2021 21:02:24 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 260005] devel/wasi-libcxx: not built to spec and not really useable Date: Tue, 23 Nov 2021 21:02:24 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: cmt@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter cc flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637701344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lfuEQXEe5ZKY+eUVnHI1JocKWC5/vg/sF5H//7rbY2c=; b=fMRBXB3PBq7I1eMWMTGeW3AT4tkH++XSF9K+jejpXUhoExmq/MVuc8V5LxR9rr7yLJKv4E NU/Oogsmu5QUoUTGRguYo7zhaxRDztX4etEQ/uIsxAMo/lygBiHlX1wIJngn9ZSqEt+DZY OZPHQNfroFuuQA+gueqAJ9CiEq2AhtQaZquQGttujBfsj/7Ivh18DwNW6jKpBrkgUVYN4R 45zJ3p+gSSqDvbTklkDB3TL9UO3/4h/pkLG+LnkRr2ZInIKXWUIER3MWC2KeFUQH4JDJ2n fao/dnSsaNYpxozD6pYcdXhNsga4LJiZE6IuuYvEH1HdN/nCADhNGRio5uZOfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637701344; a=rsa-sha256; cv=none; b=ucfD8EbhSi1zH2l2aEE8wjtLNRL7KJhOz08kSVDI41ETBFjHZwPSICavj4VE4MxkOv4REB B2N27KNHS0/sFeP/zE083ZzbpOg3K2JbzYglDmiPcZlEDC+x2Ort/Ai2218gryW482d42L hiK39q7szKQIeu+ndpcjEqpfBRqFmE69uT3OxZugpH/8QHfHN/lbRxmTM09RromcziZl6M ppAChGmT2bvtEHsFf3C4rpRLCzEORXK07hkWUWtzKgPnruH4q1YxcqTiE/XAMSQueNJ3PI VO1uuSurhRdh26w8xGY+lej9wHv+9qEyGP3PdAVMxCLoflGhRY+giybmtmpP1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260005 Bug ID: 260005 Summary: devel/wasi-libcxx: not built to spec and not really useable Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Keywords: patch Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: cmt@freebsd.org CC: greg@unrelenting.technology CC: greg@unrelenting.technology Flags: maintainer-feedback?(greg@unrelenting.technology) Created attachment 229684 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D229684&action= =3Dedit disable exceptions and fix more feature flags in wasi-libcxx platform is FreeBSD 13.0-RELEASE-p5, amd64, poudriere. Trying to use wasi-libcxx (e.g. when building firefox beta with web assembly sandbox) does not work: wasm-ld: error: /usr/local/share/wasi-sysroot/lib/wasm32-wasi/libc++.a(string.cpp.o): undef= ined symbol: __cxa_allocate_exception wasm-ld: error: /usr/local/share/wasi-sysroot/lib/wasm32-wasi/libc++.a(string.cpp.o): undef= ined symbol: __cxa_throw wasi-sdk doesn't support exception, so more diagnosis: wasi-libcxx was built with exceptions, there is no "-fno-exceptions" in the build log, even as the port's Makefile specifies "-DLIBCXX_ENABLE_EXCEPTIONS:BOOL=3DOFF -DLIBCXXABI_ENABLE_EXCEPTIONS:BOOL= =3DOFF". Digging further, I find that wasi-libcxx's CMakeFiles report -- Performing Test LIBCXX_SUPPORTS_FNO_EXCEPTIONS_FLAG -- Performing Test LIBCXX_SUPPORTS_FNO_EXCEPTIONS_FLAG - Failed among others like that (e.g. "LIBCXX_SUPPORTS_WALL_FLAG - Failed"). More digging ensues. =3D> First: CMakeFiles/CMakeErrors.log for libcxxabi reports Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /usr/bin/c++ That's the wrong compiler - base clang (11.0 in 13) does not know about "--target=3Dwasm32-wasi". The reason is that this cmake was run in post-configure under CONFIGURE_ENV, which does not contain CC/CXX/etc., that's only in MAKE_ENV by default (see= any poudrier log, all the environments are listed right at the top). Anyways, that results in many of the compilier feature Tests failing, as the compiler does not know about the target. =3D> Second: Even when using the correct compiler, many feature Tests still fail: wasm-ld: error: cannot open crt1.o: No such file or directory wasm-ld: error: unable to find library -lc++ wasm-ld: error: unable to find library -lc++abi wasm-ld: error: unable to find library -lc Well duh, we're getting into chicken-and-egg territory here. The very ugly workaround is to just pass the Test results as flags to cmake, which will then do the right thing (for at least some cases). Attached patch will: - bump PORTREVISION - put CC/CFLAGS/CXX/CXXFLAGS into CONFIGURE_ENV - pass the Test results into cmake (I'm being generous with the flags here,= and I hope I got it all correct - but then "it works for me"). Another nitpick: poudriere complains about pkg-static: DEVELOPER_MODE: Error: arch "FreeBSD:13:*" -- package installs architecture specific files but I'm not touching that right now, between this and firefox beta (it buil= ds!) I've enough for today. --=20 You are receiving this mail because: You are the assignee for the bug.=