git: 02542ea91df1 - main - cad/nvc: Disable LTO on i386

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Sun, 11 Dec 2022 19:16:28 UTC
The branch main has been updated by yuri:

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

commit 02542ea91df19ec0d3637301c3c5cbc997f6d606
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-12-11 19:15:21 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-12-11 19:16:26 +0000

    cad/nvc: Disable LTO on i386
    
    Otherwise LTO fails, see bug#268319
---
 cad/nvc/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cad/nvc/Makefile b/cad/nvc/Makefile
index 34dd21b2b938..4b8e9d10d601 100644
--- a/cad/nvc/Makefile
+++ b/cad/nvc/Makefile
@@ -12,7 +12,6 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 
 BROKEN_armv6=	compilation fails: no member named '_gregs' in 'mcontext_t'; did you mean '__gregs', see https://github.com/nickg/nvc/issues/534
 BROKEN_armv7=	compilation fails: no member named '_gregs' in 'mcontext_t'; did you mean '__gregs', see https://github.com/nickg/nvc/issues/534
-BROKEN_i386=	link fails: error: undefined symbol: _GLOBAL_OFFSET_TABLE_, see error: undefined symbol: _GLOBAL_OFFSET_TABLE_
 BROKEN_FreeBSD_14_i386=	clang creashes, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265826
 
 BUILD_DEPENDS=	llvm-config${LLVM_VERSION}:devel/llvm${LLVM_VERSION}
@@ -35,6 +34,9 @@ GNU_CONFIGURE=	yes
 LDFLAGS+=	-lexecinfo
 
 CONFIGURE_ARGS=	--with-llvm=${LOCALBASE}/bin/llvm-config${LLVM_VERSION}
+.if ${ARCH} == "i386" # see the bug#268319 for the LTO failure on i386
+CONFIGURE_ARGS+=	--disable-lto # workaround for https://github.com/nickg/nvc/issues/579 (undefined symbol: _GLOBAL_OFFSET_TABLE_, see error: undefined symbol: _GLOBAL_OFFSET_TABLE_)
+.endif
 
 TEST_TARGET=	check # several tests fail, see https://github.com/nickg/nvc/issues/530
 TEST_WRKSRC=	${WRKSRC}/.build