Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Aug 2023 00:00:13 +0000
From:      bugzilla-noreply@freebsd.org
To:        haskell@FreeBSD.org
Subject:   [Bug 273091] lang/ghc 9.4.6 fails to build without the addition of iconv configure flags
Message-ID:  <bug-273091-16154@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273091

            Bug ID: 273091
           Summary: lang/ghc 9.4.6 fails to build without the addition of
                    iconv configure flags
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: haskell@FreeBSD.org
          Reporter: kreinholz@gmail.com
             Flags: maintainer-feedback?(haskell@FreeBSD.org)
          Assignee: haskell@FreeBSD.org

OS: FreeBSD 13.2-STABLE stable/13-bc50720b32 GENERIC amd64

What: attempted to build lang/ghc-9.4.6 from Ports with default `make confi=
g`
options

Expected result: successful build of ghc

Actual result: build fails at the stage1 bootstrap phase with the following
error message:

# cabal-configure (for _build/stage1/libraries/base/setup-config)
configure: error: iconv is required on non-Windows platforms
ExitFailure 1
Build failed.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/ghc
*** Error code 1

/usr/ports/lang/ghc/work/ghc-9.4.6/_build/stage1/libraries/base/build/confi=
g.log
reveals:

configure:32566: checking for library containing iconv
configure:32597: /usr/local/bin/gcc -o conftest -iquote
/usr/ports/lang/ghc/work
/ghc-9.4.6/libraries/base  -fuse-ld=3Dgold conftest.c -lrt  >&5
/tmp//cccRZgTs.o:conftest.c:function main: error: undefined reference to
'libico
nv_open'
/tmp//cccRZgTs.o:conftest.c:function main: error: undefined reference to
'libico
nv'
/tmp//cccRZgTs.o:conftest.c:function main: error: undefined reference to
'libico
nv_close'
collect2: error: ld returned 1 exit status
configure:32597: $? =3D 1
configure: failed program was:
| /* confdefs.h */

And:

configure:32597: /usr/local/bin/gcc -o conftest -iquote
/usr/ports/lang/ghc/work
/ghc-9.4.6/libraries/base  -fuse-ld=3Dgold conftest.c -liconv  -lrt  >&5
/usr/local/bin/ld.gold: error: cannot find -liconv
/tmp//ccp8G3Is.o:conftest.c:function main: error: undefined reference to
'libico
nv_open'
/tmp//ccp8G3Is.o:conftest.c:function main: error: undefined reference to
'libico
nv'
/tmp//ccp8G3Is.o:conftest.c:function main: error: undefined reference to
'libico
nv_close'
collect2: error: ld returned 1 exit status

On my system, iconv headers and libs are installed to the standard location,
/usr/local. However, for some reason ghc's configure script fails to look f=
or
them there. This may be similar to a problem noted by Mac OS X users attemp=
ting
to build ghc when two different versions of iconv exist on their systems,
installed in different locations.

The fix/workaround is easy: edit the Makefile and add appropriate iconv-rel=
ated
configure flags:

GNU_CONFIGURE=3D          yes
CONFIGURE_ARGS+=3D        --docdir=3D${DOCSDIR}
--with-iconv-libraries=3D${LOCALBASE}/lib
--with-iconv-includes=3D${LOCALBASE}/include
CONFIGURE_ENV=3D          ALEX=3D/usr/bin/true HAPPY=3D/usr/bin/true
INSTALL_TARGET=3D         install-strip

After this, ghc has no problem finding iconv and the build progresses past =
this
error.

I thought I'd share this information in case anyone else is having difficul=
ty
building ghc-9.4.6 or to suggest a tweak to the Makefile.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-273091-16154>