SELinux Security Module development
 help / color / mirror / Atom feed
From: Petr Lautrbach <lautrbach@redhat.com>
To: Cathy Hu <cahu@suse.de>, selinux@vger.kernel.org
Subject: Re: [PATCH] libsemanage: Require LIBSO before SWIGSO and SWIGRUBYSO (bsc#1266385)
Date: Fri, 29 May 2026 15:36:01 +0200	[thread overview]
Message-ID: <871peunxry.fsf@redhat.com> (raw)
In-Reply-To: <20260529125126.159687-4-cahu@suse.de>

Cathy Hu <cahu@suse.de> writes:

> We encountered race conditions where the built order was:
> 1. libsemanage.a
> 2. python-3.13_semanage.so
> 3. libsemanage.so.*
>
> That happened when make was called with `-j2`.
>
> In this case, python-3.13_semanage.so tries to use libsemanage.a and
> - on s390x: succeeds and builds an incorrect python-3.13_semanage.so
>   (that one was found during product testing)
> - on x86: fails (manually reproduced, never encountered IRL)
>   Reproducer:
>   ```
>   cd selinux/libsemanage/src
>   make clean
>   make pywrap
>   find . -wholename "*libsemanage.so*" -delete
>   find . -wholename "*python*.so" -delete
>   make python-3.13_semanage.so
>   -> fails
>   ```
>
> Therefor hard-require LIBSO to be present before SWIGSO and
> probably also SWIGRUBYSO.


Please add Signed-off-by: tag

https://github.com/SELinuxProject/selinux/blob/main/CONTRIBUTING.md#contributing-code

> ---
>  libsemanage/src/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libsemanage/src/Makefile b/libsemanage/src/Makefile
> index f870dc68..782e4045 100644
> --- a/libsemanage/src/Makefile
> +++ b/libsemanage/src/Makefile
> @@ -82,10 +82,10 @@ $(SWIGLOBJ): $(SWIGCOUT)
>  $(SWIGRUBYLOBJ): $(SWIGRUBYCOUT)
>  	$(CC) $(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
>  
> -$(SWIGSO): $(SWIGLOBJ)
> +$(SWIGSO): $(SWIGLOBJ) $(LIBSO)
>  	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -L. -fPIC -shared -o $@ $< -lsemanage $(PYLIBS)
>  
> -$(SWIGRUBYSO): $(SWIGRUBYLOBJ)
> +$(SWIGRUBYSO): $(SWIGRUBYLOBJ) $(LIBSO)
>  	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -L. -fPIC -shared -o $@ $^ -lsemanage $(RUBYLIBS)
>  
>  $(LIBA): $(OBJS)
> -- 
> 2.54.0


      reply	other threads:[~2026-05-29 13:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29 12:50 [PATCH] libsemanage: Require LIBSO before SWIGSO and SWIGRUBYSO (bsc#1266385) Cathy Hu
2026-05-29 13:36 ` Petr Lautrbach [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871peunxry.fsf@redhat.com \
    --to=lautrbach@redhat.com \
    --cc=cahu@suse.de \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox