Skip to contentSkip to conversation

package/libselinux: fix glibc build with old toolchains

PATCH New Fabrice Fontaine 3 participants 4 messages Apr 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libselinux: fix glibc build with old toolchains

For an unknown reason, since bump to version 3.0.0, we got build failure due to -D_FILE_OFFSET_BITS==64:

/home/naourr/work/instance-2/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/include/fts.h:41:3: error: #error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"

 # error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
   ^

Update our workaround to also filter CPPFLAGS fix the issue and seems right as we're doing it for all the other affected packages (restorecond, elfutils ...)

Fixes:
- http://autobuild.buildroot.org/results/200fd0accf6a1926251243b05e600fbf591bb3a2

---
 package/libselinux/libselinux.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/libselinux/libselinux.mk +4 -3
index b53146e30b..258065b79d 100644
@@ -45,12 +45,13 @@ 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 and LDFLAGS here because we want to win over the
-# CFLAGS/LDFLAGS definitions passed by $(PKG_PYTHON_DISTUTILS_ENV)
+# 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_DISTUTILS_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))" \
 	LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread"
 
 define LIBSELINUX_BUILD_CMDS
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 package/libselinux: fix glibc build with old toolchains

All;

Tested-by Adam Duskett <[email protected]>

Quoted 44 lines · Fabrice Fontaine

For an unknown reason, since bump to version 3.0.0, we got build failure due to -D_FILE_OFFSET_BITS==64:

/home/naourr/work/instance-2/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/include/fts.h:41:3: error: #error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"

 # error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
   ^

Update our workaround to also filter CPPFLAGS fix the issue and seems right as we're doing it for all the other affected packages (restorecond, elfutils ...)

Fixes:
- http://autobuild.buildroot.org/results/200fd0accf6a1926251243b05e600fbf591bb3a2

---
 package/libselinux/libselinux.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/libselinux/libselinux.mk +4 -4
index b53146e30b..258065b79d 100644
@@ -45,12 +45,13 @@ 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 and LDFLAGS here because we want to win over the
-# CFLAGS/LDFLAGS definitions passed by $(PKG_PYTHON_DISTUTILS_ENV)
+# 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_DISTUTILS_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))" \
        LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread"
 
 define LIBSELINUX_BUILD_CMDS
--

2.25.1

#2 lore raw

PATCH 1/1 package/libselinux: fix glibc build with old toolchains

All;

Quoted 51 lines · Adam Duskett

All;

Tested-by Adam Duskett <[email protected]>

Quoted 44 lines · Fabrice Fontaine

For an unknown reason, since bump to version 3.0.0, we got build failure due to -D_FILE_OFFSET_BITS==64:

/home/naourr/work/instance-2/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/include/fts.h:41:3: error: #error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"

 # error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
   ^

Update our workaround to also filter CPPFLAGS fix the issue and seems right as we're doing it for all the other affected packages (restorecond, elfutils ...)

Fixes:
- http://autobuild.buildroot.org/results/200fd0accf6a1926251243b05e600fbf591bb3a2

---
 package/libselinux/libselinux.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/libselinux/libselinux.mk +4 -4
index b53146e30b..258065b79d 100644
@@ -45,12 +45,13 @@ 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 and LDFLAGS here because we want to win over the
-# CFLAGS/LDFLAGS definitions passed by $(PKG_PYTHON_DISTUTILS_ENV)
+# 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_DISTUTILS_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))" \
        LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread"
 
 define LIBSELINUX_BUILD_CMDS
--

2.25.1

#3 lore raw

PATCH 1/1 package/libselinux: fix glibc build with old toolchains

In reply to Fabrice Fontaine

Fabrice, All,

On 2020-04-20 22:00 +0200, Fabrice Fontaine spake thusly:

Quoted 7 lines

For an unknown reason, since bump to version 3.0.0, we got build failure due to -D_FILE_OFFSET_BITS==64:

/home/naourr/work/instance-2/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/include/fts.h:41:3: error: #error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"

 # error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
   ^
Quoted 8 lines

Update our workaround to also filter CPPFLAGS fix the issue and seems right as we're doing it for all the other affected packages (restorecond, elfutils ...)

Fixes:
- http://autobuild.buildroot.org/results/200fd0accf6a1926251243b05e600fbf591bb3a2

Applied to master, thanks!

Regards,
Yann E. MORIN.

Quoted 32 lines
---
 package/libselinux/libselinux.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/libselinux/libselinux.mk +4 -3
index b53146e30b..258065b79d 100644
@@ -45,12 +45,13 @@ 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 and LDFLAGS here because we want to win over the
-# CFLAGS/LDFLAGS definitions passed by $(PKG_PYTHON_DISTUTILS_ENV)
+# 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_DISTUTILS_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))" \
 	LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread"
 
 define LIBSELINUX_BUILD_CMDS
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'