Skip to contentSkip to conversation

package/f2fs-tools: fix musl compile error

PATCH Superseded Waldemar Brodkorb 2 participants 2 messages Aug 13, 2023 – Aug 22, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/f2fs-tools: fix musl compile error

musl 1.2.4 removed the lseek64 function, but kept a definition of lseek64 when _LARGEFILE64_SOURCE is defined.

Overwrite configure logic to always use lseek64 for musl toolchains.

There is no need to backport it to older Buildroot releases, because musl 1.2.4 is not part of any release.

Fixes:
- http://autobuild.buildroot.net/results/17f/17f4ea7d62581cf8c574deeb98e1785220d5bd3f

---
 package/f2fs-tools/f2fs-tools.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/f2fs-tools/f2fs-tools.mk +4 -0
index a92ab4fe3e..f9be789940 100644
@@ -16,6 +16,10 @@ F2FS_TOOLS_LICENSE = GPL-2.0
 F2FS_TOOLS_LICENSE_FILES = COPYING
 F2FS_TOOLS_CPE_ID_VENDOR = f2fs-tools_project
 
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+F2FS_TOOLS_CONF_ENV += ac_cv_func_lseek64=yes
+endif
+
 ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
 F2FS_TOOLS_CONF_OPTS += --with-selinux
 F2FS_TOOLS_DEPENDENCIES += libselinux
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

package/f2fs-tools/f2fs-tools.mk F2FS_TOOLS_LICENSE = GPL-2.0 · line 21

Quoted 3 lines · On Sun, 13 Aug 2023 19:17:38 +0200 Waldemar Brodkorb <[email protected]> wrote:
package/f2fs-tools/f2fs-tools.mk +3 -0
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+F2FS_TOOLS_CONF_ENV += ac_cv_func_lseek64=yes
+endif

I am not really happy with this, because it's really a workaround. I am not sure to fully grasp what the issue is. Apparently, in commit
https://git.musl-libc.org/cgit/musl/commit/?id=246f1c811448f37a44b41cd8df8d0ef9736d95f4
in musl, the lseek64 -> lseek alias was removed, and now there is some dynamic linker trickery instead.

I think the issue is that what f2fs-tools does is wrong, and this is what needs to be fixed. I would suggest to reach out to the musl community, as they are usually very good at suggesting how to do things right.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot