Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 254659 - dev-libs/glib:2 should use the system dev-libs/libpcre
Summary: dev-libs/glib:2 should use the system dev-libs/libpcre
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: bundled-libs
  Show dependency tree
 
Reported: 2009-01-12 18:24 UTC by Peter Alfredsen (RETIRED)
Modified: 2016-06-25 09:26 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Alfredsen (RETIRED) gentoo-dev 2009-01-12 18:24:54 UTC
nm --defined-only /usr/lib64/libglib-2.0.a |grep pcre
# nm --defined-only /usr/lib64/libglib-2.0.a |grep pcre
pcre_maketables.o:
0000000000000000 T pcre_maketables
pcre_chartables.o:
0000000000000000 R _pcre_default_tables
[...]

Add --with-pcre=system to enable system pcre. Glib needs utf-8 support, so DEPEND on dev-libs/libpcre[unicode]
Comment 1 Mart Raudsepp gentoo-dev 2009-02-04 16:04:45 UTC
No, it should not use the system pcre.
glib shipped pcre is patched for glib use, making it use glib's own UTF-8 tables, instead of pcre ones, therefore reducing overhead of it or something like that.
Comment 2 Peter Alfredsen (RETIRED) gentoo-dev 2009-02-04 16:52:03 UTC
libpcre is needed for almost everything, so having glib use the same .so as everybody else will hurt not a bit in that regard. And then there's the obvious security benefits - next time libpcre gets a vuln, we'll only need to fix one library. Debian uses system pcre too, FWIW.
Comment 3 Rémi Cardona (RETIRED) gentoo-dev 2009-02-04 22:33:16 UTC
FWIW, we've been switching back and forth between the system pcre and the shipped pcre every 6 months...

Could we try _not_ to change for once?
Comment 4 Nirbheek Chauhan (RETIRED) gentoo-dev 2009-02-08 07:45:26 UTC
(In reply to comment #3)
> FWIW, we've been switching back and forth between the system pcre and the
> shipped pcre every 6 months...
> 
> Could we try _not_ to change for once?
> 

btw, the overlay[1] now forces usage of internal pcre (explicitly the old behaviour) till this bug is resolved


1. http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=3912e9b77f0b31f29335948971dc9a335cbdcc2a
Comment 5 Mart Raudsepp gentoo-dev 2009-02-08 18:11:56 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > FWIW, we've been switching back and forth between the system pcre and the
> > shipped pcre every 6 months...
> > 
> > Could we try _not_ to change for once?
> > 
> 
> btw, the overlay[1] now forces usage of internal pcre (explicitly the old
> behaviour) till this bug is resolved

Please revert that
Comment 6 Mart Raudsepp gentoo-dev 2009-02-08 18:12:58 UTC
AArgh, I can't read. Thanks, for making it use internal pcre again. That's what I wanted, nevermind my comment
Comment 7 Julien Décharne 2009-02-15 16:32:39 UTC
Trying to compile syslog-ng-3.0.1 failed on my system because Glib-2.16.6 (merged from official and stable branch) was compiled with internal pcre :

admin ~/pkg/syslog-ng/work $ ../syslog-ng-3.0.1/configure
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for a BSD-compatible install... /usr/bin/install -c
[...]
syslog-ng Open Source Edition 3.0.1 configured
 Compiler options:
  compiler                    : gcc
  compiler options            : -g -O2 -Wall  -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include   -I/usr/include/eventlog     -D_BSD_SOURCE
-D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H  -D_GNU_SOURCE
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
  linker flags                :
  prefix                      : /usr/local
 Features:
  Sun STREAMS support         : no
  Sun Door support            : no
  Debug symbols               : no
  GCC profiling               : no
  Memtrace                    : no
  IPV6 support                : yes
  spoof-source support        : yes
  tcp-wrapper support         : yes
  SSL support                 : yes
  SQL support                 : no
  Linux capability support    : yes
  PCRE support                : yes
  Env wrapper support         : no
admin ~/pkg/syslog-ng/work $ make
make  all-recursive
make[1]: Entering directory `/home/admin/pkg/syslog-ng/work'
Making all in src
make[2]: Entering directory `/home/admin/pkg/syslog-ng/work/src'
[...]
gcc  -g -O2 -Wall   -o syslog-ng  main.o libsyslog-ng.a   -lrt -lnsl
-Wl,-Bstatic -lfl -lglib-2.0   -levtlog   -lssl -lcrypto  -lz -lnet
-lwrap -lcap -lpcre  -Wl,-Bdynamic  -ldl
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libpcre.a(pcre_globals.o):(.bss+0x0):
multiple definition of `pcre_callout'
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../libglib-2.0.a(pcre_globals.o):(.bss+0x0):
first defined here
collect2: ld returned 1 exit status
make[2]: *** [syslog-ng] Error 1
make[2]: Leaving directory `/home/admin/pkg/syslog-ng/work/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/admin/pkg/syslog-ng/work'
make: *** [all] Error 2

IMHO, this is why USE flags exit. I just add 'external-pcre' to IUSE and a line 'use external-pcre && myconf="--with-pcre=system"' to src_compile() function in Glib's ebuild. No need anymore to switch back and forth, it's up to the user to decide to build Glib whitout internal pcre, or at least to other ebuilds' mainteners to inform the user that their ebuild won't compile if built with. Beside, I don't know if this issue just concerns syslog-ng-3.0.1 due to bad coding or if almost every packages that use both libpcre and Glib would failed to compile.
Comment 8 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-02-15 18:21:20 UTC
for some reason, you appear to be using the static glib library and also building stuff manually in /usr/local which is not of portage's responsability.
Comment 9 Julien Décharne 2009-02-15 19:35:42 UTC
I'm not complaining about 'portage can't build my stuff', I'm just saying 'let the user choose if he want Glib's pcre support to be external or internal', which it's exactly the kind of situation which have made me choose Gentoo.
Comment 10 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-02-15 19:40:26 UTC
hu no, not exactly. Like flameeyes explained in his blog external libs should always be prefered. Keeping internal ones is the exception and glib has currently a good enough reason to stick to this way. That's what this bug is about.
Comment 11 Mart Raudsepp gentoo-dev 2009-02-16 02:26:45 UTC
syslog-ng has to link against static glib. This is the primary reason we actually ship a static library from glib system package as well.
However the pcre symbols from the internal copy in glib should not be visible to glib users, but that's a bit tricky to hide in the static library I think...
Anyway, if the problem is the static library exposing pcre symbols, then that is a somewhat different bug and should be treated in a separate entry imho.
Comment 12 aero1967 2009-04-09 06:09:57 UTC
(In reply to comment #11)
> syslog-ng has to link against static glib. This is the primary reason we
> actually ship a static library from glib system package as well.
> However the pcre symbols from the internal copy in glib should not be visible
> to glib users, but that's a bit tricky to hide in the static library I think...
> Anyway, if the problem is the static library exposing pcre symbols, then that
> is a somewhat different bug and should be treated in a separate entry imho.
 
I'm running into exactly the same problem as Julien.  I'm trying to build a local copy of syslog-ng 3.0.1 (it has some improvements over 2.x that are important to me), and it hits this issue with the PCRE symbols in glib.

So if the solution is to hide those symbols in the static glib, then let me know if you'd like me to file a separate bugreport for it.
Comment 13 Dmitry A. Yanko 2009-05-05 14:00:00 UTC
Adding "--enable-dynamic-linking" to configure args is enough to build rsyslog. No needs to touch glib.
Comment 14 Dmitry A. Yanko 2009-05-05 14:02:19 UTC
Sorry. Typo. syslog-ng
Comment 15 nzqr 2012-05-11 07:07:10 UTC
glib in Debian an even in Archlinux pulls external pcre, you really should look how they fixed this problem.
Comment 16 Pacho Ramos gentoo-dev 2013-02-10 07:46:43 UTC
This should probably done in overlay at first for testing purposes :/
Comment 17 Jan Psota 2016-03-27 00:33:59 UTC
dev-libs/glib-2.48.0 compiles with external libpcre (.so results 10% smaller) and works as I can see.

Maybe adding system-pcre useflag disabled by default - for testing for those, who want?
Comment 18 Pacho Ramos gentoo-dev 2016-04-02 13:29:33 UTC
Upstream is defaulting to system lib:
  --with-pcre=[internal/system]
                          whether to use system PCRE [default=system]


Hence, I would simply do the same for the next bump
Comment 19 Pacho Ramos gentoo-dev 2016-06-25 09:26:31 UTC
done in 2.48.1