All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] AArch64 static build link order fix
@ 2020-02-26  0:13 Chris Ruehl
  0 siblings, 0 replies; only message in thread
From: Chris Ruehl @ 2020-02-26  0:13 UTC (permalink / raw)
  To: linux-f2fs-devel

Hi,

Had a recently a cross compile to arm64 for f2fs-tools and run into
a couple of issues and want to share the resolving.

I running on Debian buster, and using the tool-chain from them
COLLECT_GCC=/usr/bin/aarch64-linux-gnu-gcc
gcc version 8.3.0 (Debian 8.3.0-2)

1) if HAVE_LIBSELINUX is enabled in the config.h
fsck will fail to build missing the libraries
* libsepol
* libpcre
* libpthread
I add this temporally in the Makefile, it must be a fix done in the configure 
process
** add the link path which is missing for cross compilation too.
orig:
libselinux_LIBS = -lselinux
fix:
libselinux_LIBS = -L/usr/lib/aarch64-linux-gnu -lselinux -lsepol -lprce -lpthread

Sadly the selinux static library us dynamic function from the glibc throw a 
warning that the glibc shared library version is needed on runtime! So I removed
the SELINUX support in my static build comment out HAVE_LIBSELINUX.


2) mkfs the link order for blkid & uuid is wrong, leads to unresolved objects
below change fix it.

diff --git a/mkfs/Makefile.am b/mkfs/Makefile.am
index 83e2389..d3206e8 100644
--- a/mkfs/Makefile.am
+++ b/mkfs/Makefile.am
@@ -6,7 +6,8 @@ sbin_PROGRAMS = mkfs.f2fs
  noinst_HEADERS = f2fs_format_utils.h
  include_HEADERS = $(top_srcdir)/include/f2fs_fs.h
  mkfs_f2fs_SOURCES = f2fs_format_main.c f2fs_format.c f2fs_format_utils.c
-mkfs_f2fs_LDADD = ${libuuid_LIBS} ${libblkid_LIBS} $(top_builddir)/lib/libf2fs.la
+mkfs_f2fs_LDADD = ${libblkid_LIBS} ${libuuid_LIBS} $(top_builddir)/lib/libf2fs.la
+mkfs_f2fs_LDFLAGS = -all-static

  lib_LTLIBRARIES = libf2fs_format.la
  libf2fs_format_la_SOURCES = f2fs_format_main.c f2fs_format.c f2fs_format_utils.c


The outcome of my cross compilation works fine.

May someone run in the same problem, and benefit from my fix.

Have a nice one!

Chris

-- 
GTSYS Limited RFID Technology
9/F, Unit E, R07, Kwai Shing Industrial Building Phase 2,
42-46 Tai Lin Pai Road, Kwai Chung, N.T., Hong Kong
Tel (852) 9079 9521

Disclaimer: https://www.gtsys.com.hk/email/classified.html


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-26  0:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26  0:13 [f2fs-dev] AArch64 static build link order fix Chris Ruehl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.