NetBSD Problem Report #54752

From triaxx@netbsd.org  Tue Dec 10 12:47:06 2019
Return-Path: <triaxx@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 01CB07A155
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 10 Dec 2019 12:47:05 +0000 (UTC)
Message-Id: <20191210124704.99B347A1D6@mollari.NetBSD.org>
Date: Tue, 10 Dec 2019 12:47:04 +0000 (UTC)
From: triaxx@netbsd.org
Reply-To: triaxx@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: devel/glib2 does not build on FreeBSD
X-Send-Pr-Version: 3.95

>Number:         54752
>Category:       pkg
>Synopsis:       devel/glib2 does not build on FreeBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 10 12:50:00 +0000 2019
>Closed-Date:    Wed Apr 22 06:46:07 +0000 2020
>Last-Modified:  Wed Apr 22 06:50:01 +0000 2020
>Originator:     Frédéric Fauberteau
>Release:        FreeBSD 12.0-RELEASE-p12
>Organization:

>Environment:
System: FreeBSD cocoon.triaxx.org 12.0-RELEASE-p12 FreeBSD 12.0-RELEASE-p12 GENERIC  amd64
Architecture: x86_64
Machine: amd64
>Description:
The linking process fail with the following log:
[...]
[109/1024] Linking target glib/libglib-2.0.so.0.6200.3.
FAILED: glib/libglib-2.0.so.0.6200.3 
clang  -o glib/libglib-2.0.so.0.6200.3 'glib/4430778@@glib-2.0@sha/deprecated_gallocator.c.o' 'glib/4430778@@glib-2.0@sha/deprecated_gcache.c.o' 'glib/4430778@@glib-2.0@sha/deprecated_gcompletion.c.o' 'glib/4430778@@glib-2.0@sha/deprecated_grel.c.o' 'glib/4430778@@glib-2.0@sha/deprecated_gthread-deprecated.c.o' 'glib/4430778@@glib-2.0@sha/garcbox.c.o' 'glib/4430778@@glib-2.0@sha/garray.c.o' 'glib/4430778@@glib-2.0@sha/gasyncqueue.c.o' 'glib/4430778@@glib-2.0@sha/gatomic.c.o' 'glib/4430778@@glib-2.0@sha/gbacktrace.c.o' 'glib/4430778@@glib-2.0@sha/gbase64.c.o' 'glib/4430778@@glib-2.0@sha/gbitlock.c.o' 'glib/4430778@@glib-2.0@sha/gbookmarkfile.c.o' 'glib/4430778@@glib-2.0@sha/gbytes.c.o' 'glib/4430778@@glib-2.0@sha/gcharset.c.o' 'glib/4430778@@glib-2.0@sha/gchecksum.c.o' 'glib/4430778@@glib-2.0@sha/gconvert.c.o' 'glib/4430778@@glib-2.0@sha/gdataset.c.o' 'glib/4430778@@glib-2.0@sha/gdate.c.o' 'glib/4430778@@glib-2.0@sha/gdatetime.c.o' 'glib/4430778@@glib-2.0@sha/gdir.c.o' 'glib/4430778@@
 glib-2.0@sha/genviron.c.o' 'glib/4430778@@glib-2.0@sha/gerror.c.o' 'glib/4430778@@glib-2.0@sha/gfileutils.c.o' 'glib/4430778@@glib-2.0@sha/ggettext.c.o' 'glib/4430778@@glib-2.0@sha/ghash.c.o' 'glib/4430778@@glib-2.0@sha/ghmac.c.o' 'glib/4430778@@glib-2.0@sha/ghook.c.o' 'glib/4430778@@glib-2.0@sha/ghostutils.c.o' 'glib/4430778@@glib-2.0@sha/giochannel.c.o' 'glib/4430778@@glib-2.0@sha/gkeyfile.c.o' 'glib/4430778@@glib-2.0@sha/glib-init.c.o' 'glib/4430778@@glib-2.0@sha/glib-private.c.o' 'glib/4430778@@glib-2.0@sha/glist.c.o' 'glib/4430778@@glib-2.0@sha/gmain.c.o' 'glib/4430778@@glib-2.0@sha/gmappedfile.c.o' 'glib/4430778@@glib-2.0@sha/gmarkup.c.o' 'glib/4430778@@glib-2.0@sha/gmem.c.o' 'glib/4430778@@glib-2.0@sha/gmessages.c.o' 'glib/4430778@@glib-2.0@sha/gnode.c.o' 'glib/4430778@@glib-2.0@sha/goption.c.o' 'glib/4430778@@glib-2.0@sha/gpattern.c.o' 'glib/4430778@@glib-2.0@sha/gpoll.c.o' 'glib/4430778@@glib-2.0@sha/gprimes.c.o' 'glib/4430778@@glib-2.0@sha/gqsort.c.o' 'glib/4430778@@glib-2
 .0@sha/gquark.c.o' 'glib/4430778@@glib-2.0@sha/gqueue.c.o' 'glib/4430778@@glib-2.0@sha/grand.c.o' 'glib/4430778@@glib-2.0@sha/grcbox.c.o' 'glib/4430778@@glib-2.0@sha/grefcount.c.o' 'glib/4430778@@glib-2.0@sha/grefstring.c.o' 'glib/4430778@@glib-2.0@sha/gregex.c.o' 'glib/4430778@@glib-2.0@sha/gscanner.c.o' 'glib/4430778@@glib-2.0@sha/gsequence.c.o' 'glib/4430778@@glib-2.0@sha/gshell.c.o' 'glib/4430778@@glib-2.0@sha/gslice.c.o' 'glib/4430778@@glib-2.0@sha/gslist.c.o' 'glib/4430778@@glib-2.0@sha/gstdio.c.o' 'glib/4430778@@glib-2.0@sha/gstrfuncs.c.o' 'glib/4430778@@glib-2.0@sha/gstring.c.o' 'glib/4430778@@glib-2.0@sha/gstringchunk.c.o' 'glib/4430778@@glib-2.0@sha/gtestutils.c.o' 'glib/4430778@@glib-2.0@sha/gthread.c.o' 'glib/4430778@@glib-2.0@sha/gthreadpool.c.o' 'glib/4430778@@glib-2.0@sha/gtimer.c.o' 'glib/4430778@@glib-2.0@sha/gtimezone.c.o' 'glib/4430778@@glib-2.0@sha/gtranslit.c.o' 'glib/4430778@@glib-2.0@sha/gtrashstack.c.o' 'glib/4430778@@glib-2.0@sha/gtree.c.o' 'glib/4430778@@gl
 ib-2.0@sha/guniprop.c.o' 'glib/4430778@@glib-2.0@sha/gutf8.c.o' 'glib/4430778@@glib-2.0@sha/gunibreak.c.o' 'glib/4430778@@glib-2.0@sha/gunicollate.c.o' 'glib/4430778@@glib-2.0@sha/gunidecomp.c.o' 'glib/4430778@@glib-2.0@sha/gurifuncs.c.o' 'glib/4430778@@glib-2.0@sha/gutils.c.o' 'glib/4430778@@glib-2.0@sha/guuid.c.o' 'glib/4430778@@glib-2.0@sha/gvariant.c.o' 'glib/4430778@@glib-2.0@sha/gvariant-core.c.o' 'glib/4430778@@glib-2.0@sha/gvariant-parser.c.o' 'glib/4430778@@glib-2.0@sha/gvariant-serialiser.c.o' 'glib/4430778@@glib-2.0@sha/gvarianttypeinfo.c.o' 'glib/4430778@@glib-2.0@sha/gvarianttype.c.o' 'glib/4430778@@glib-2.0@sha/gversion.c.o' 'glib/4430778@@glib-2.0@sha/gwakeup.c.o' 'glib/4430778@@glib-2.0@sha/gprintf.c.o' 'glib/4430778@@glib-2.0@sha/glib-unix.c.o' 'glib/4430778@@glib-2.0@sha/gspawn.c.o' 'glib/4430778@@glib-2.0@sha/giounix.c.o' 'glib/4430778@@glib-2.0@sha/gthread-posix.c.o' 'glib/libcharset/6e4c96c@@charset@sta/localcharset.c.o' -I/usr/include -I/usr/pkg/include -I/usr/
 pkg/include/python3.8 -L/usr/lib -L/usr/pkg/lib -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libglib-2.0.so.0 -O2 -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -Wl,-z,nodelete -Wl,-Bsymbolic-functions -Wl,-R/usr/pkg/lib /usr/pkg/lib/libpcre.so -pthread -lintl -Wl,--end-group
/usr/bin/ld: error: undefined symbol: environ
>>> referenced by genviron.c
>>>               glib/4430778@@glib-2.0@sha/genviron.c.o:(g_listenv)

/usr/bin/ld: error: undefined symbol: environ
>>> referenced by genviron.c
>>>               glib/4430778@@glib-2.0@sha/genviron.c.o:(g_listenv)

/usr/bin/ld: error: undefined symbol: environ
>>> referenced by genviron.c
>>>               glib/4430778@@glib-2.0@sha/genviron.c.o:(g_get_environ)

/usr/bin/ld: error: undefined symbol: environ
>>> referenced by gspawn.c
>>>               glib/4430778@@glib-2.0@sha/gspawn.c.o:(fork_exec_with_fds)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
bmake[1]: stopped in /usr/pkgsrc/devel/glib2
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/devel/glib2

The problem comes more from glib and FreeBSD than pkgsrc. But this PR is a reminder for addressing the issue.
>How-To-Repeat:
cd /usr/pkgsrc/devel/glib2 && make build
>Fix:
Not yet investigated.

>Release-Note:

>Audit-Trail:
From: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Fauberteau?= <triaxx@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54752: devel/glib2 does not build on FreeBSD
Date: Sat, 21 Dec 2019 20:34:10 +0100

 When I try to build this package out of pbulk with PREFER_PKGSRC= yes, I 
 also get the following error (amongst others):
 /usr/bin/ld: error: undefined symbol: libiconv_open
 >>> referenced by gconvert.c
 >>>               glib/4430778@@glib-2.0@sha/gconvert.c.o:(g_iconv_open)

 Surprisingly, I see no '-liconv' in build.ninja while the Makefile 
 contains:
 .include "../../converters/libiconv/buildlink3.mk"

From: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Fauberteau?= <triaxx@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54752: devel/glib2 does not build on FreeBSD
Date: Fri, 27 Dec 2019 23:39:52 +0100

 Clang leaves undefined the environ(7) symbol but it seems that it is 
 resolved when a binary is linked to glib2. The error occurs either using 
 the basesystem's Clang-6.0.1 or the pkgsrc's one (Clang-9.0.0). I do not 
 know if the problem comes from Clang of FreeBSD. The following patch fix 
 the build error:
 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/devel/glib2/Makefile,v
 retrieving revision 1.265
 diff -u -r1.265 Makefile
 --- Makefile    28 Nov 2019 09:23:32 -0000      1.265
 +++ Makefile    27 Dec 2019 22:34:35 -0000
 @@ -10,11 +10,15 @@
   MESON_ARGS+=   -Dinstalled_tests=false
   # Avoid linux dependency on libmount-dev
   MESON_ARGS+=   -Dlibmount=false
 +.if ${OPSYS} == "FreeBSD"
 +MESON_ARGS+=   -Db_lundef=false
 +.endif

   MAKE_ENV+=     
 LD_LIBRARY_PATH=${WRKSRC}/output/gio:${WRKSRC}/output/glib:${WRKSRC}/output/gobject:${WRKSRC}/output/gmodule

   CPPFLAGS.SunOS+=       -D_XOPEN_SOURCE=600 -D__EXTENSIONS__
   LDFLAGS.SunOS+=                -liconv -lintl -lnsl -lsocket
 +LDFLAGS.FreeBSD+=      -liconv

   REPLACE_PYTHON+=       gio/gio-querymodules-wrapper.py
   REPLACE_PYTHON+=       gio/tests/gengiotypefuncs.py

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54752: devel/glib2 does not build on FreeBSD
Date: Sat, 28 Dec 2019 00:14:20 +0100

 On Fri, Dec 27, 2019 at 10:40:01PM +0000, Frdric Fauberteau wrote:
 >  Clang leaves undefined the environ(7) symbol but it seems that it is 
 >  resolved when a binary is linked to glib2. The error occurs either using 
 >  the basesystem's Clang-6.0.1 or the pkgsrc's one (Clang-9.0.0). I do not 
 >  know if the problem comes from Clang of FreeBSD. The following patch fix 
 >  the build error:

 Just mark environ locally as weak.

 Joerg

From: =?UTF-8?B?RnLDqWTDqXJpYyBGYXViZXJ0ZWF1?= <triaxx@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54752 CVS commit: pkgsrc/devel/glib2
Date: Sun, 29 Dec 2019 19:40:56 +0000

 Module Name:	pkgsrc
 Committed By:	triaxx
 Date:		Sun Dec 29 19:40:56 UTC 2019

 Modified Files:
 	pkgsrc/devel/glib2: Makefile Makefile.common PLIST distinfo
 	pkgsrc/devel/glib2/patches: patch-glib_gmain.c patch-glib_gtypes.h
 	    patch-glib_meson.build patch-glib_tests_hash.c
 Added Files:
 	pkgsrc/devel/glib2/patches: patch-glib_genviron.c patch-glib_gspawn.c

 Log Message:
 glib2: update to 2.62.4

 pkgsrc changes:
 ---------------
   * Fix build on FreeBSD (PR 54752)

 upstream changes:
 -----------------
   * Apply recursion depth limits to variants in D-Bus messages (!1290)
   * Bugs fixed:
       o #1938 GDateTime doesn't support leap seconds
       o !1240 Backport !1233 “gdatetime: Handle leap seconds in ISO8601 dates” to glib-2-62
       o !1257 Backport !1232 “kqueue: Do not return early from _kqsub_cancel” to glib-2-62
       o !1266 Backport !1265 “build: don't check for protected visibility” to glib-2-62
       o !1276 Backport !1274 “trash portal: Don't follow symlinks” to glib-2-62
       o !1290 Backport !1201 “gdbusmessage: Limit recursion of variants in D-Bus messages” to glib-2-62


 To generate a diff of this commit:
 cvs rdiff -u -r1.265 -r1.266 pkgsrc/devel/glib2/Makefile
 cvs rdiff -u -r1.76 -r1.77 pkgsrc/devel/glib2/Makefile.common
 cvs rdiff -u -r1.110 -r1.111 pkgsrc/devel/glib2/PLIST
 cvs rdiff -u -r1.262 -r1.263 pkgsrc/devel/glib2/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/devel/glib2/patches/patch-glib_genviron.c \
     pkgsrc/devel/glib2/patches/patch-glib_gspawn.c
 cvs rdiff -u -r1.3 -r1.4 pkgsrc/devel/glib2/patches/patch-glib_gmain.c \
     pkgsrc/devel/glib2/patches/patch-glib_gtypes.h
 cvs rdiff -u -r1.6 -r1.7 pkgsrc/devel/glib2/patches/patch-glib_meson.build
 cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/glib2/patches/patch-glib_tests_hash.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Benny Siegert <bsiegert@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: PR/54752 CVS commit: pkgsrc/devel/glib2
Date: Sun, 29 Dec 2019 20:51:16 +0100

 Is the previous commit worth pulling up to the stable branch?

 -- 
 Benny

State-Changed-From-To: open->closed
State-Changed-By: triaxx@NetBSD.org
State-Changed-When: Sun, 29 Dec 2019 20:02:07 +0000
State-Changed-Why:
Patch applied, build issue resolved. Thanks Joerg!


From: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Fauberteau?= <triaxx@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: PR/54752 CVS commit: pkgsrc/devel/glib2
Date: Sun, 29 Dec 2019 21:12:59 +0100

 Le 2019-12-29 20:55, Benny Siegert a écrit :
 > The following reply was made to PR pkg/54752; it has been noted by 
 > GNATS.
 > 
 > From: Benny Siegert <bsiegert@gmail.com>
 > To: gnats-bugs@netbsd.org
 > Cc:
 > Subject: Re: PR/54752 CVS commit: pkgsrc/devel/glib2
 > Date: Sun, 29 Dec 2019 20:51:16 +0100
 > 
 >  Is the previous commit worth pulling up to the stable branch?
 > 
 >  --
 >  Benny

 At the best of my knowledge, there is no steady bulk build for FreeBSD. 
 I am not sure that a pullup request is necessary for this PR.

 Fred

State-Changed-From-To: closed->open
State-Changed-By: triaxx@NetBSD.org
State-Changed-When: Mon, 20 Apr 2020 20:46:36 +0000
State-Changed-Why:
Linking errors reappear in 2.64.2


From: =?UTF-8?B?RnLDqWTDqXJpYyBGYXViZXJ0ZWF1?= <triaxx@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: pkgsrc-users@NetBSD.org
Subject: Re: pkg/54752 (devel/glib2 does not build on FreeBSD)
Date: Mon, 20 Apr 2020 23:13:15 +0200

 Le 20/04/2020 à 22:46, triaxx@NetBSD.org a écrit :
 > Synopsis: devel/glib2 does not build on FreeBSD
 > 
 > State-Changed-From-To: closed->open
 > State-Changed-By: triaxx@NetBSD.org
 > State-Changed-When: Mon, 20 Apr 2020 20:46:36 +0000
 > State-Changed-Why:
 > Linking errors reappear in 2.64.2

 It seems that it was not fixed upstream.

 The upstream FreeBSD CI machine uses:
 > MESON_ARGS+=   -Db_lundef=false
 See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1306#note_677553

 But Joerg proposed that:
 https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1306#note_677553

 Any preference?

From: =?UTF-8?B?RnLDqWTDqXJpYyBGYXViZXJ0ZWF1?= <triaxx@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: pkgsrc-users@NetBSD.org
Subject: Re: pkg/54752 (devel/glib2 does not build on FreeBSD)
Date: Tue, 21 Apr 2020 09:25:07 +0200

 Le 20/04/2020 à 23:13, Frédéric Fauberteau a écrit :
 > But Joerg proposed that:
 > https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1306#note_677553

 No, Joerg proposed that:
 extern __attribute__((__weak__)) char **environ;

State-Changed-From-To: open->closed
State-Changed-By: triaxx@NetBSD.org
State-Changed-When: Wed, 22 Apr 2020 06:46:07 +0000
State-Changed-Why:
Fix committed.


From: =?UTF-8?B?RnLDqWTDqXJpYyBGYXViZXJ0ZWF1?= <triaxx@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54752 CVS commit: pkgsrc/devel/glib2
Date: Wed, 22 Apr 2020 06:45:43 +0000

 Module Name:	pkgsrc
 Committed By:	triaxx
 Date:		Wed Apr 22 06:45:43 UTC 2020

 Modified Files:
 	pkgsrc/devel/glib2: Makefile

 Log Message:
 glib2: fix PR pkg/54752

 pkgsrc changes:
 ---------------
 * Disallow undefined symbols when linking on FreeBSD. This solution was
   chosen because (1) the FreeBSD CI machine of the glib developpers use it
   and (2) it avoids to maintain a patch.
 * Bump revision.


 To generate a diff of this commit:
 cvs rdiff -u -r1.272 -r1.273 pkgsrc/devel/glib2/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.