package/libselinux: fix build with BR2_TIME_BITS_64

Do not remove _FILE_OFFSET_BITS=64 from CFLAGS and CPPFLAGS to avoid the
following build failure with BR2_TIME_BITS_64 raised since commit
3c427c6472:

In file included from /home/autobuild/autobuild/instance-9/output-1/per-package/libselinux/host/mipsel-buildroot-linux-gnu/sysroot/usr/include/features.h:394,
                 from /home/autobuild/autobuild/instance-9/output-1/per-package/libselinux/host/mipsel-buildroot-linux-gnu/sysroot/usr/include/bits/libc-header-start.h:33,
                 from /home/autobuild/autobuild/instance-9/output-1/per-package/libselinux/host/mipsel-buildroot-linux-gnu/sysroot/usr/include/stdint.h:26,
                 from /home/autobuild/autobuild/instance-9/output-1/per-package/libselinux/host/lib/gcc/mipsel-buildroot-linux-gnu/12.3.0/include/stdint.h:9,
                 from ../include/selinux/avc.h:9,
                 from avc.c:10:
/home/autobuild/autobuild/instance-9/output-1/per-package/libselinux/host/mipsel-buildroot-linux-gnu/sysroot/usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
   26 | #   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
      |     ^~~~~

This LFS workaround for glibc < 2.23 was added in 2016 by commit
ebcca24c95 and is probably not needed
anymore as glibc 2.23 was released in February 2016:
https://sourceware.org/glibc/wiki/Release/2.23

Fixes:
 - http://autobuild.buildroot.org/results/d85c81f87adf3a5945fa369bcec233e6def2ed12

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
This commit is contained in:
Fabrice Fontaine 2023-11-30 20:13:05 +01:00 committed by Arnout Vandecappelle
parent 8895cae09b
commit c1fa9bc2f7

View File

@ -52,14 +52,6 @@ define LIBSELINUX_BUILD_PYTHON_BINDINGS
endef
endif # python3
# Filter out D_FILE_OFFSET_BITS=64. This fixes errors caused by glibc 2.22. We
# set CFLAGS, CPPFLAGS and LDFLAGS here because we want to win over the
# CFLAGS/CPPFLAGS/LDFLAGS definitions passed by $(PKG_PYTHON_SETUPTOOLS_ENV)
# when the python binding is enabled.
LIBSELINUX_MAKE_OPTS += \
CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \
CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))"
define LIBSELINUX_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
$(LIBSELINUX_MAKE_OPTS) all