diff mbox series

restorecond: Do not link against libpcre

Message ID 20190321100439.7130-1-bigon@debian.org (mailing list archive)
State Accepted
Headers show
Series restorecond: Do not link against libpcre | expand

Commit Message

Laurent Bigonville March 21, 2019, 10:04 a.m. UTC
From: Laurent Bigonville <bigon@bigon.be>

For some reasons, restorecond was explicitly linking against libpcre but
the code is not using any of its symbols

Closes: https://github.com/SELinuxProject/selinux/issues/137

Signed-off-by: Laurent Bigonville <bigon@bigon.be>
---
 restorecond/Makefile | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

Comments

Petr Lautrbach March 21, 2019, 12:06 p.m. UTC | #1
Laurent Bigonville <bigon@debian.org> writes:

> From: Laurent Bigonville <bigon@bigon.be>
>
> For some reasons, restorecond was explicitly linking against 
> libpcre but
> the code is not using any of its symbols
>
> Closes: https://github.com/SELinuxProject/selinux/issues/137
>
> Signed-off-by: Laurent Bigonville <bigon@bigon.be>

It looks likes it was accidentally added by commit
50f0910cf05bdc1d10710c7c3fb748a178473387 ("libselinux: add support 
for pcre2")


Acked-by: Petr Lautrbach <plautrba@redhat.com>


> ---
>  restorecond/Makefile | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/restorecond/Makefile b/restorecond/Makefile
> index b81f8c82..12452cd2 100644
> --- a/restorecond/Makefile
> +++ b/restorecond/Makefile
> @@ -19,17 +19,7 @@ DBUSLIB = $(shell $(PKG_CONFIG) --libs 
> dbus-glib-1)
>  CFLAGS ?= -g -Werror -Wall -W
>  override CFLAGS += $(DBUSFLAGS)
>  
> -USE_PCRE2 ?= n
> -ifeq ($(USE_PCRE2),y)
> -	PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 
> $(shell $(PKG_CONFIG) --cflags libpcre2-8)
> -	PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
> -else
> -	PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
> -	PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre)
> -endif
> -export PCRE_CFLAGS PCRE_LDLIBS
> -
> -override LDLIBS += -lselinux $(PCRE_LDLIBS) $(DBUSLIB)
> +override LDLIBS += -lselinux $(DBUSLIB)
>  
>  all: restorecond
Nicolas Iooss March 26, 2019, 10:23 p.m. UTC | #2
On Thu, Mar 21, 2019 at 1:06 PM Petr Lautrbach <plautrba@redhat.com> wrote:
>
>
> Laurent Bigonville <bigon@debian.org> writes:
>
> > From: Laurent Bigonville <bigon@bigon.be>
> >
> > For some reasons, restorecond was explicitly linking against
> > libpcre but
> > the code is not using any of its symbols
> >
> > Closes: https://github.com/SELinuxProject/selinux/issues/137
> >
> > Signed-off-by: Laurent Bigonville <bigon@bigon.be>
>
> It looks likes it was accidentally added by commit
> 50f0910cf05bdc1d10710c7c3fb748a178473387 ("libselinux: add support
> for pcre2")
>
>
> Acked-by: Petr Lautrbach <plautrba@redhat.com>

Merged, Thanks.
Nicolas

> > ---
> >  restorecond/Makefile | 12 +-----------
> >  1 file changed, 1 insertion(+), 11 deletions(-)
> >
> > diff --git a/restorecond/Makefile b/restorecond/Makefile
> > index b81f8c82..12452cd2 100644
> > --- a/restorecond/Makefile
> > +++ b/restorecond/Makefile
> > @@ -19,17 +19,7 @@ DBUSLIB = $(shell $(PKG_CONFIG) --libs
> > dbus-glib-1)
> >  CFLAGS ?= -g -Werror -Wall -W
> >  override CFLAGS += $(DBUSFLAGS)
> >
> > -USE_PCRE2 ?= n
> > -ifeq ($(USE_PCRE2),y)
> > -     PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8
> > $(shell $(PKG_CONFIG) --cflags libpcre2-8)
> > -     PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
> > -else
> > -     PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
> > -     PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre)
> > -endif
> > -export PCRE_CFLAGS PCRE_LDLIBS
> > -
> > -override LDLIBS += -lselinux $(PCRE_LDLIBS) $(DBUSLIB)
> > +override LDLIBS += -lselinux $(DBUSLIB)
> >
> >  all: restorecond
>
diff mbox series

Patch

diff --git a/restorecond/Makefile b/restorecond/Makefile
index b81f8c82..12452cd2 100644
--- a/restorecond/Makefile
+++ b/restorecond/Makefile
@@ -19,17 +19,7 @@  DBUSLIB = $(shell $(PKG_CONFIG) --libs dbus-glib-1)
 CFLAGS ?= -g -Werror -Wall -W
 override CFLAGS += $(DBUSFLAGS)
 
-USE_PCRE2 ?= n
-ifeq ($(USE_PCRE2),y)
-	PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 $(shell $(PKG_CONFIG) --cflags libpcre2-8)
-	PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
-else
-	PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
-	PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre)
-endif
-export PCRE_CFLAGS PCRE_LDLIBS
-
-override LDLIBS += -lselinux $(PCRE_LDLIBS) $(DBUSLIB)
+override LDLIBS += -lselinux $(DBUSLIB)
 
 all: restorecond