diff mbox series

[1/1] fix building against musl and uClibc libc libraries.

Message ID 20200407184239.2700998-1-aduskett@gmail.com (mailing list archive)
State Accepted
Headers show
Series [1/1] fix building against musl and uClibc libc libraries. | expand

Commit Message

Adam Duskett April 7, 2020, 6:42 p.m. UTC
From: Adam Duskett <Aduskett@gmail.com>

Currently, the src/Makefile provides the FTS_LDLIBS when building against musl
or uClibc. However, this is missing from utils/Makefile, which causes linking
to fail.

Add the FTS_LDLIBS variable to the LDLIBS variable in utils/Makefile to fix
compiling against uClibc and musl.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 libselinux/utils/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Roberts, William C April 7, 2020, 8:27 p.m. UTC | #1
> -----Original Message-----
> From: selinux-owner@vger.kernel.org [mailto:selinux-owner@vger.kernel.org]
> On Behalf Of aduskett@gmail.com
> Sent: Tuesday, April 7, 2020 1:43 PM
> To: selinux@vger.kernel.org
> Cc: Adam Duskett <Aduskett@gmail.com>
> Subject: [PATCH 1/1] fix building against musl and uClibc libc libraries.
> 
> From: Adam Duskett <Aduskett@gmail.com>
> 
> Currently, the src/Makefile provides the FTS_LDLIBS when building against musl
> or uClibc. However, this is missing from utils/Makefile, which causes linking to fail.
> 
> Add the FTS_LDLIBS variable to the LDLIBS variable in utils/Makefile to fix
> compiling against uClibc and musl.
> 
> Signed-off-by: Adam Duskett <Aduskett@gmail.com>
> ---
>  libselinux/utils/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile index
> 36150638..a5632b7c 100644
> --- a/libselinux/utils/Makefile
> +++ b/libselinux/utils/Makefile
> @@ -45,7 +45,7 @@ endif
> 
>  override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS)
> $(PCRE_CFLAGS)  override LDFLAGS += -L../src -override LDLIBS += -lselinux
> +override LDLIBS += -lselinux $(FTS_LDLIBS)
>  PCRE_LDLIBS ?= -lpcre
> 
>  ifeq ($(ANDROID_HOST),y)
> --
> 2.25.1

If you want me to use the PR you have open, force push your branch to update the commit
message. Else I'll have to create a new-pr and close your old one.

Your open PR is here:
https://github.com/SELinuxProject/selinux/pull/193

Something like:
git pull --rebase origin master
git push aduskett HEAD:fix-musl-and-uclibc-builds

would be ideal.

Acked-by: William Roberts <william.c.roberts@intel.com>
Adam Duskett April 7, 2020, 8:47 p.m. UTC | #2
I did that just now!

On Tue, Apr 7, 2020 at 1:27 PM Roberts, William C
<william.c.roberts@intel.com> wrote:
>
> > -----Original Message-----
> > From: selinux-owner@vger.kernel.org [mailto:selinux-owner@vger.kernel.org]
> > On Behalf Of aduskett@gmail.com
> > Sent: Tuesday, April 7, 2020 1:43 PM
> > To: selinux@vger.kernel.org
> > Cc: Adam Duskett <Aduskett@gmail.com>
> > Subject: [PATCH 1/1] fix building against musl and uClibc libc libraries.
> >
> > From: Adam Duskett <Aduskett@gmail.com>
> >
> > Currently, the src/Makefile provides the FTS_LDLIBS when building against musl
> > or uClibc. However, this is missing from utils/Makefile, which causes linking to fail.
> >
> > Add the FTS_LDLIBS variable to the LDLIBS variable in utils/Makefile to fix
> > compiling against uClibc and musl.
> >
> > Signed-off-by: Adam Duskett <Aduskett@gmail.com>
> > ---
> >  libselinux/utils/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile index
> > 36150638..a5632b7c 100644
> > --- a/libselinux/utils/Makefile
> > +++ b/libselinux/utils/Makefile
> > @@ -45,7 +45,7 @@ endif
> >
> >  override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS)
> > $(PCRE_CFLAGS)  override LDFLAGS += -L../src -override LDLIBS += -lselinux
> > +override LDLIBS += -lselinux $(FTS_LDLIBS)
> >  PCRE_LDLIBS ?= -lpcre
> >
> >  ifeq ($(ANDROID_HOST),y)
> > --
> > 2.25.1
>
> If you want me to use the PR you have open, force push your branch to update the commit
> message. Else I'll have to create a new-pr and close your old one.
>
> Your open PR is here:
> https://github.com/SELinuxProject/selinux/pull/193
>
> Something like:
> git pull --rebase origin master
> git push aduskett HEAD:fix-musl-and-uclibc-builds
>
> would be ideal.
>
> Acked-by: William Roberts <william.c.roberts@intel.com>
Adam Duskett April 7, 2020, 8:54 p.m. UTC | #3
I just ended up making a new branch that has the latest updated
commits and a new PR with an SOB line.

https://github.com/SELinuxProject/selinux/pull/218

On Tue, Apr 7, 2020 at 1:47 PM Adam Duskett <aduskett@gmail.com> wrote:
>
> I did that just now!
>
> On Tue, Apr 7, 2020 at 1:27 PM Roberts, William C
> <william.c.roberts@intel.com> wrote:
> >
> > > -----Original Message-----
> > > From: selinux-owner@vger.kernel.org [mailto:selinux-owner@vger.kernel.org]
> > > On Behalf Of aduskett@gmail.com
> > > Sent: Tuesday, April 7, 2020 1:43 PM
> > > To: selinux@vger.kernel.org
> > > Cc: Adam Duskett <Aduskett@gmail.com>
> > > Subject: [PATCH 1/1] fix building against musl and uClibc libc libraries.
> > >
> > > From: Adam Duskett <Aduskett@gmail.com>
> > >
> > > Currently, the src/Makefile provides the FTS_LDLIBS when building against musl
> > > or uClibc. However, this is missing from utils/Makefile, which causes linking to fail.
> > >
> > > Add the FTS_LDLIBS variable to the LDLIBS variable in utils/Makefile to fix
> > > compiling against uClibc and musl.
> > >
> > > Signed-off-by: Adam Duskett <Aduskett@gmail.com>
> > > ---
> > >  libselinux/utils/Makefile | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile index
> > > 36150638..a5632b7c 100644
> > > --- a/libselinux/utils/Makefile
> > > +++ b/libselinux/utils/Makefile
> > > @@ -45,7 +45,7 @@ endif
> > >
> > >  override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS)
> > > $(PCRE_CFLAGS)  override LDFLAGS += -L../src -override LDLIBS += -lselinux
> > > +override LDLIBS += -lselinux $(FTS_LDLIBS)
> > >  PCRE_LDLIBS ?= -lpcre
> > >
> > >  ifeq ($(ANDROID_HOST),y)
> > > --
> > > 2.25.1
> >
> > If you want me to use the PR you have open, force push your branch to update the commit
> > message. Else I'll have to create a new-pr and close your old one.
> >
> > Your open PR is here:
> > https://github.com/SELinuxProject/selinux/pull/193
> >
> > Something like:
> > git pull --rebase origin master
> > git push aduskett HEAD:fix-musl-and-uclibc-builds
> >
> > would be ideal.
> >
> > Acked-by: William Roberts <william.c.roberts@intel.com>
William Roberts April 7, 2020, 9:02 p.m. UTC | #4
On Tue, Apr 7, 2020 at 3:54 PM Adam Duskett <aduskett@gmail.com> wrote:
>
> I just ended up making a new branch that has the latest updated
> commits and a new PR with an SOB line.
>
> https://github.com/SELinuxProject/selinux/pull/218

Top posting on this list is frowned upon, I will merge this after the
obligatory waiting period to allow others to comment.
I think its 48 hours... I could be wrong. If we documented that, I
didn't find it.

Thanks for playing along and resubmitting. Now you get all the
accolades and glory that come along with
contributing to SE Linux.

Don't be surprised if people come up to you while you're eating dinner
asking for autographs :-P.

>
> On Tue, Apr 7, 2020 at 1:47 PM Adam Duskett <aduskett@gmail.com> wrote:
> >
> > I did that just now!
> >
> > On Tue, Apr 7, 2020 at 1:27 PM Roberts, William C
> > <william.c.roberts@intel.com> wrote:
> > >
> > > > -----Original Message-----
> > > > From: selinux-owner@vger.kernel.org [mailto:selinux-owner@vger.kernel.org]
> > > > On Behalf Of aduskett@gmail.com
> > > > Sent: Tuesday, April 7, 2020 1:43 PM
> > > > To: selinux@vger.kernel.org
> > > > Cc: Adam Duskett <Aduskett@gmail.com>
> > > > Subject: [PATCH 1/1] fix building against musl and uClibc libc libraries.
> > > >
> > > > From: Adam Duskett <Aduskett@gmail.com>
> > > >
> > > > Currently, the src/Makefile provides the FTS_LDLIBS when building against musl
> > > > or uClibc. However, this is missing from utils/Makefile, which causes linking to fail.
> > > >
> > > > Add the FTS_LDLIBS variable to the LDLIBS variable in utils/Makefile to fix
> > > > compiling against uClibc and musl.
> > > >
> > > > Signed-off-by: Adam Duskett <Aduskett@gmail.com>
> > > > ---
> > > >  libselinux/utils/Makefile | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile index
> > > > 36150638..a5632b7c 100644
> > > > --- a/libselinux/utils/Makefile
> > > > +++ b/libselinux/utils/Makefile
> > > > @@ -45,7 +45,7 @@ endif
> > > >
> > > >  override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS)
> > > > $(PCRE_CFLAGS)  override LDFLAGS += -L../src -override LDLIBS += -lselinux
> > > > +override LDLIBS += -lselinux $(FTS_LDLIBS)
> > > >  PCRE_LDLIBS ?= -lpcre
> > > >
> > > >  ifeq ($(ANDROID_HOST),y)
> > > > --
> > > > 2.25.1
> > >
> > > If you want me to use the PR you have open, force push your branch to update the commit
> > > message. Else I'll have to create a new-pr and close your old one.
> > >
> > > Your open PR is here:
> > > https://github.com/SELinuxProject/selinux/pull/193
> > >
> > > Something like:
> > > git pull --rebase origin master
> > > git push aduskett HEAD:fix-musl-and-uclibc-builds
> > >
> > > would be ideal.
> > >
> > > Acked-by: William Roberts <william.c.roberts@intel.com>
William Roberts April 10, 2020, 9:45 p.m. UTC | #5
On Tue, Apr 7, 2020 at 4:02 PM William Roberts <bill.c.roberts@gmail.com> wrote:
>
> On Tue, Apr 7, 2020 at 3:54 PM Adam Duskett <aduskett@gmail.com> wrote:
> >
> > I just ended up making a new branch that has the latest updated
> > commits and a new PR with an SOB line.
> >
> > https://github.com/SELinuxProject/selinux/pull/218

merged:
https://github.com/SELinuxProject/selinux/pull/218
diff mbox series

Patch

diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile
index 36150638..a5632b7c 100644
--- a/libselinux/utils/Makefile
+++ b/libselinux/utils/Makefile
@@ -45,7 +45,7 @@  endif
 
 override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS)
 override LDFLAGS += -L../src
-override LDLIBS += -lselinux
+override LDLIBS += -lselinux $(FTS_LDLIBS)
 PCRE_LDLIBS ?= -lpcre
 
 ifeq ($(ANDROID_HOST),y)