libsemanage: Require LIBSO before SWIGSO and SWIGRUBYSO (bsc#1266385)
PATCH v2 1/1 libsemanage: Require LIBSO before SWIGSO and SWIGRUBYSO (bsc#1266385)
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.
--- libsemanage/src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
libsemanage/src/Makefile +2 -2
@@ -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)
Signature · 1 line
2.54.0
Please ignore v1 and v2, likely won't work with DISABLE_SHARED=y.
I sent a v3, sorry for the inconvenience
Quoted 47 lines · Cathy Hu
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.
Signed-off-by Cathy Hu <[email protected]>--- libsemanage/src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)libsemanage/src/Makefile +2
-2@@ -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)