From nobody Mon Nov 29 20:33:08 2021 X-Original-To: dev-commits-ports-all@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 01F5518BB812; Mon, 29 Nov 2021 20:33:10 +0000 (UTC) (envelope-from git@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 4J2xr51yS5z4V3b; Mon, 29 Nov 2021 20:33:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 1751112E7; Mon, 29 Nov 2021 20:33:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATKX9eX054362; Mon, 29 Nov 2021 20:33:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATKX8a6054361; Mon, 29 Nov 2021 20:33:08 GMT (envelope-from git) Date: Mon, 29 Nov 2021 20:33:08 GMT Message-Id: <202111292033.1ATKX8a6054361@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Christoph Moench-Tegeder Subject: git: 44c66a772c98 - 2021Q4 - devel/wasi-libcxx: actually disable exceptions List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cmt X-Git-Repository: ports X-Git-Refname: refs/heads/2021Q4 X-Git-Reftype: branch X-Git-Commit: 44c66a772c9895ec8d988c07e1dec1c28bae9130 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638217989; 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=P167WUjvM5cDXXwppBy/gKUBi9J6V5p9JWpIvA7qF/I=; b=CJ3gKFVyeBwirCklP7sUo6P1ZbYcr1qyeiE0KMUUwnYoJ84JhmSPvGeJIOkCnWGjYCzx6r O/qITbSERxL/Ns64LPhUgvKJP1GB5S++gB+ger0QnvYlRp7ju6Ox2cJMvrKJFP/XBzRNPy bQkb8bOg/aB13UmXrAyGZ7PoxqyXQOHm8Ql1+TLNIGRdFNfI8Xe0ysPXU7u9reXfTSPouu QYLralSa9BHWe6o6Y//r3XSmvuKEG+wz2A2C28FUHqrf7oIl8YOddZBzve4XbBuN4oexc9 IYxoknpIIFFOPbyE9eZmkfHkTGDCChn72ALl4GufJbrzWtuiD439spYXqQ3PXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638217989; a=rsa-sha256; cv=none; b=DZbOk4GpZY4fyiOzzZ1+D1yt0EDFUdpyf6ShqJfpNBmXuJuACxkzeLENzX6wh5AlrItL6g FRxIgmKjnMWrzdeBNlFwlBNd83TLRQvFPIx+WKWpu1GxBVe+dzG8/zI6pzBPGHvurEJZ35 w3JeI+G8BKdlzlsgUUOwPOAT3/WYpvPTllJDq/yhpTaSyLk2ppHxoDxAmzhFuirNpbnN2G weOXe6KVHUgmO/kyumxQtXww/KgXrDozhxIGhswiCNvTxy9ylwU8c6TI4ZT/gMKYQLHPJx SurH/rvwRpLLw/g80ubldp0zyIibOMCmxzOhZeVhxS3XeQGL7FXvOpELZWvDdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch 2021Q4 has been updated by cmt: URL: https://cgit.FreeBSD.org/ports/commit/?id=44c66a772c9895ec8d988c07e1dec1c28bae9130 commit 44c66a772c9895ec8d988c07e1dec1c28bae9130 Author: Christoph Moench-Tegeder AuthorDate: 2021-11-24 20:58:57 +0000 Commit: Christoph Moench-Tegeder CommitDate: 2021-11-29 20:32:31 +0000 devel/wasi-libcxx: actually disable exceptions This port was accidentially using the base system compiler for some parts of the configure stages - which gives wrong results in the compiler feature tests, as base clang on FreeBSD 13.0 (llvm 11) does not know about the wasm32 target. Worse, even with the correct compiler some of the feature tests depend on a present and usable libc++ for the wasi target, which we don't have yet (this port will build one, but before...). The end result was that the build system failed to figure out the compiler flags for disabling exceptions (-fno-exceptions in clang's case) and built the wasm libc++ with exceptions enabled. But exceptions are not (yet) supported in wasi-sdk, so trying to build any code against this wasm libc++ failed with linker errors like wasm-ld: error: /usr/local/share/wasi-sysroot/lib/wasm32-wasi/libc++.a(string.cpp.o): undefined symbol: __cxa_allocate_exception wasm-ld: error: /usr/local/share/wasi-sysroot/lib/wasm32-wasi/libc++.a(string.cpp.o): undefined symbol: __cxa_throw To solve that, we have to force the configure stages to use the correct compiler by pushing CC/CXX and related variables into CONFIGURE_ENV and specify the results of the compiler feature tests via cmake arguments. That is a horrible workaround, but short of a full bootstrap build, I can't see any other solution to the chicken-and-egg problem with wasi-libcxx requiring a functional wasi-libc++ to build. PR: 260005 Approved by: greg at unrelenting dot technology (maintainer) (cherry picked from commit bf143897d312fc861061eeca33d4cf3e777b6728) --- devel/wasi-libcxx/Makefile | 75 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/devel/wasi-libcxx/Makefile b/devel/wasi-libcxx/Makefile index 5bd273616f9b..eb5fe7308a65 100644 --- a/devel/wasi-libcxx/Makefile +++ b/devel/wasi-libcxx/Makefile @@ -1,5 +1,6 @@ PORTNAME= libcxx DISTVERSION= 13.0.0 +PORTREVISION= 1 CATEGORIES= devel lang MASTER_SITES= https://github.com/llvm/llvm-project/releases/download/llvmorg-${DISTVERSION:S/rc/-rc/}/ \ https://${PRE_}releases.llvm.org/${LLVM_RELEASE}/${RCDIR} @@ -30,6 +31,9 @@ LLVM_PREFIX= ${PREFIX}/llvm${LLVM_SUFFIX} WASI_SYSROOT= ${LOCALBASE}/share/wasi-sysroot WRKSRC= ${WRKDIR}/${DISTNAME}/libcxx +CONFIGURE_ENV+= CC="${CC}" CFLAGS="${CFLAGS}" +CONFIGURE_ENV+= CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" + CMAKE_INSTALL_PREFIX= ${PREFIX}/share/wasi-sysroot CMAKE_ARGS= -DCMAKE_C_COMPILER_WORKS=1 \ -DCMAKE_CXX_COMPILER_WORKS=1 \ @@ -63,7 +67,76 @@ CMAKE_ARGS= -DCMAKE_C_COMPILER_WORKS=1 \ -DLIBCXXABI_HAS_EXTERNAL_THREAD_API:BOOL=OFF \ -DLIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF \ -DLIBCXXABI_HAS_WIN32_THREAD_API:BOOL=OFF \ - -DLIBCXXABI_LIBCXX_INCLUDES=${CONFIGURE_WRKSRC}/include/c++/v1 + -DLIBCXXABI_LIBCXX_INCLUDES=${CONFIGURE_WRKSRC}/include/c++/v1 \ + -DLIBCXX_SUPPORTS_FNO_EXCEPTIONS_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_NOSTDLIBXX_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG:BOOL=ON \ + -DLIBCXX_HAS_COMMENT_LIB_PRAGMA:BOOL=ON \ + -DLIBCXX_SUPPORTS_FALIGNED_ALLOCATION_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_NOSTDINCXX_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_FVISIBILITY_EQ_HIDDEN_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WALL_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WEXTRA_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_W_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WWRITE_STRINGS_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WNO_UNUSED_PARAMETER_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WNO_LONG_LONG_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WEXTRA_SEMI_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WUNDEF_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WNO_USER_DEFINED_LITERALS_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WNO_COVERED_SWITCH_DEFAULT_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WNO_SUGGEST_OVERRIDE_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WNO_IGNORED_ATTRIBUTES_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_WNO_ERROR_FLAG:BOOL=ON \ + -DLIBCXX_SUPPORTS_EHS_FLAG:BOOL=OFF \ + -DLIBCXX_SUPPORTS_EHA_FLAG:BOOL=OFF \ + -DLIBCXX_SUPPORTS_ZL_FLAG:BOOL=OFF \ + -DLIBCXX_SUPPORTS_NODEFAULTLIB_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_FNO_EXCEPTIONS_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_NOSTDLIBXX_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_NODEFAULTLIBS_FLAG:BOOL=ON \ + -DLIBCXXABI_HAS_COMMENT_LIB_PRAGMA:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_FALIGNED_ALLOCATION_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_NOSTDINCXX_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_FVISIBILITY_EQ_HIDDEN_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WALL_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WEXTRA_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_W_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WWRITE_STRINGS_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WNO_UNUSED_PARAMETER_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WNO_LONG_LONG_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WEXTRA_SEMI_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WUNDEF_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WNO_USER_DEFINED_LITERALS_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WNO_COVERED_SWITCH_DEFAULT_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WNO_SUGGEST_OVERRIDE_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WNO_IGNORED_ATTRIBUTES_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WNO_ERROR_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_EHS_FLAG:BOOL=OFF \ + -DLIBCXXABI_SUPPORTS_EHA_FLAG:BOOL=OFF \ + -DLIBCXXABI_SUPPORTS_ZL_FLAG:BOOL=OFF \ + -DLIBCXXABI_SUPPORTS_NODEFAULTLIB_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WCONVERSION_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WMISMATCHED_TAGS_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WMISSING_BRACES_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WNEWLINE_EOF_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WUNUSED_FUNCTION_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WSHADOW_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WSHORTEN_64_TO_32_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WSIGN_COMPARE_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WSIGN_CONVERSION_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WUNUSED_PARAMETER_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WUNUSED_VARIABLE_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_WX_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_PEDANTIC_FLAG:BOOL=ON \ + -DLIBCXXABI_SUPPORTS_FSTRICT_ALIASING_FLAG:BOOL=ON post-extract: @${MKDIR} ${WRKDIR}/.build_cxxabi