All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Eric Sandeen <sandeen@sandeen.net>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfsprogs: fix static build problems caused by liburcu
Date: Sat, 8 Jan 2022 15:23:38 -0800	[thread overview]
Message-ID: <20220108232338.GV656707@magnolia> (raw)
In-Reply-To: <20220108195739.1212901-1-tytso@mit.edu>

On Sat, Jan 08, 2022 at 02:57:39PM -0500, Theodore Ts'o wrote:
> The liburcu library has a dependency on pthreads.  Hence, in order for
> static builds of xfsprogs to work, $(LIBPTHREAD) needs to appear
> *after* $(LUBURCU) in LLDLIBS.  Otherwise, static links of xfs_* will
> fail due to undefined references of pthread_create, pthread_exit,
> et. al.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>

Ugh, I keep forgetting that ld wants library dependencies in reverse
order nowadays...

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  copy/Makefile      | 4 ++--
>  db/Makefile        | 4 ++--
>  growfs/Makefile    | 4 ++--
>  logprint/Makefile  | 4 ++--
>  mdrestore/Makefile | 3 +--
>  mkfs/Makefile      | 4 ++--
>  repair/Makefile    | 2 +-
>  scrub/Makefile     | 4 ++--
>  8 files changed, 14 insertions(+), 15 deletions(-)
> 
> diff --git a/copy/Makefile b/copy/Makefile
> index 1b00cd0d..55160f84 100644
> --- a/copy/Makefile
> +++ b/copy/Makefile
> @@ -9,8 +9,8 @@ LTCOMMAND = xfs_copy
>  CFILES = xfs_copy.c
>  HFILES = xfs_copy.h
>  
> -LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBFROG) $(LIBUUID) $(LIBPTHREAD) $(LIBRT) \
> -	  $(LIBURCU)
> +LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBFROG) $(LIBUUID) $(LIBRT) $(LIBURCU) \
> +	  $(LIBPTHREAD)
>  LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBFROG)
>  LLDFLAGS = -static-libtool-libs
>  
> diff --git a/db/Makefile b/db/Makefile
> index 5c017898..b2e01174 100644
> --- a/db/Makefile
> +++ b/db/Makefile
> @@ -18,8 +18,8 @@ CFILES = $(HFILES:.h=.c) btdump.c btheight.c convert.c info.c namei.c \
>  	timelimit.c
>  LSRCFILES = xfs_admin.sh xfs_ncheck.sh xfs_metadump.sh
>  
> -LLDLIBS	= $(LIBXFS) $(LIBXLOG) $(LIBFROG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) \
> -	  $(LIBURCU)
> +LLDLIBS	= $(LIBXFS) $(LIBXLOG) $(LIBFROG) $(LIBUUID) $(LIBRT) $(LIBURCU) \
> +	  $(LIBPTHREAD)
>  LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBFROG)
>  LLDFLAGS += -static-libtool-libs
>  
> diff --git a/growfs/Makefile b/growfs/Makefile
> index 08601de7..2f4cc66a 100644
> --- a/growfs/Makefile
> +++ b/growfs/Makefile
> @@ -9,8 +9,8 @@ LTCOMMAND = xfs_growfs
>  
>  CFILES = xfs_growfs.c
>  
> -LLDLIBS = $(LIBXFS) $(LIBXCMD) $(LIBFROG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) \
> -	  $(LIBURCU)
> +LLDLIBS = $(LIBXFS) $(LIBXCMD) $(LIBFROG) $(LIBUUID) $(LIBRT) $(LIBURCU) \
> +	  $(LIBPTHREAD)
>  
>  ifeq ($(ENABLE_EDITLINE),yes)
>  LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP)
> diff --git a/logprint/Makefile b/logprint/Makefile
> index cdedbd0d..bbbed5d2 100644
> --- a/logprint/Makefile
> +++ b/logprint/Makefile
> @@ -12,8 +12,8 @@ CFILES = logprint.c \
>  	 log_copy.c log_dump.c log_misc.c \
>  	 log_print_all.c log_print_trans.c log_redo.c
>  
> -LLDLIBS	= $(LIBXFS) $(LIBXLOG) $(LIBFROG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) \
> -	  $(LIBURCU)
> +LLDLIBS	= $(LIBXFS) $(LIBXLOG) $(LIBFROG) $(LIBUUID) $(LIBRT) $(LIBURCU) \
> +	  $(LIBPTHREAD)
>  LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBFROG)
>  LLDFLAGS = -static-libtool-libs
>  
> diff --git a/mdrestore/Makefile b/mdrestore/Makefile
> index 8f28ddab..4a932efb 100644
> --- a/mdrestore/Makefile
> +++ b/mdrestore/Makefile
> @@ -8,8 +8,7 @@ include $(TOPDIR)/include/builddefs
>  LTCOMMAND = xfs_mdrestore
>  CFILES = xfs_mdrestore.c
>  
> -LLDLIBS = $(LIBXFS) $(LIBFROG) $(LIBRT) $(LIBPTHREAD) $(LIBUUID) \
> -	  $(LIBURCU)
> +LLDLIBS = $(LIBXFS) $(LIBFROG) $(LIBRT) $(LIBUUID) $(LIBURCU) $(LIBPTHREAD)
>  LTDEPENDENCIES = $(LIBXFS) $(LIBFROG)
>  LLDFLAGS = -static
>  
> diff --git a/mkfs/Makefile b/mkfs/Makefile
> index 811ba9db..9f6a4fad 100644
> --- a/mkfs/Makefile
> +++ b/mkfs/Makefile
> @@ -10,8 +10,8 @@ LTCOMMAND = mkfs.xfs
>  HFILES =
>  CFILES = proto.c xfs_mkfs.c
>  
> -LLDLIBS += $(LIBXFS) $(LIBXCMD) $(LIBFROG) $(LIBRT) $(LIBPTHREAD) $(LIBBLKID) \
> -	$(LIBUUID) $(LIBINIH) $(LIBURCU)
> +LLDLIBS += $(LIBXFS) $(LIBXCMD) $(LIBFROG) $(LIBRT) $(LIBBLKID) \
> +	$(LIBUUID) $(LIBINIH) $(LIBURCU) $(LIBPTHREAD)
>  LTDEPENDENCIES += $(LIBXFS) $(LIBXCMD) $(LIBFROG)
>  LLDFLAGS = -static-libtool-libs
>  
> diff --git a/repair/Makefile b/repair/Makefile
> index 47536ca1..2c40e59a 100644
> --- a/repair/Makefile
> +++ b/repair/Makefile
> @@ -72,7 +72,7 @@ CFILES = \
>  	xfs_repair.c
>  
>  LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) $(LIBFROG) $(LIBUUID) $(LIBRT) \
> -	$(LIBPTHREAD) $(LIBBLKID) $(LIBURCU)
> +	$(LIBBLKID) $(LIBURCU) $(LIBPTHREAD)
>  LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) $(LIBFROG)
>  LLDFLAGS = -static-libtool-libs
>  
> diff --git a/scrub/Makefile b/scrub/Makefile
> index 849e3afd..fd6bb679 100644
> --- a/scrub/Makefile
> +++ b/scrub/Makefile
> @@ -71,8 +71,8 @@ spacemap.c \
>  vfs.c \
>  xfs_scrub.c
>  
> -LLDLIBS += $(LIBHANDLE) $(LIBFROG) $(LIBPTHREAD) $(LIBICU_LIBS) $(LIBRT) \
> -	$(LIBURCU)
> +LLDLIBS += $(LIBHANDLE) $(LIBFROG) $(LIBICU_LIBS) $(LIBRT) $(LIBURCU) \
> +	$(LIBPTHREAD)
>  LTDEPENDENCIES += $(LIBHANDLE) $(LIBFROG)
>  LLDFLAGS = -static
>  
> -- 
> 2.31.0
> 

  reply	other threads:[~2022-01-08 23:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-08 19:57 [PATCH] xfsprogs: fix static build problems caused by liburcu Theodore Ts'o
2022-01-08 23:23 ` Darrick J. Wong [this message]
2022-01-09  4:13   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220108232338.GV656707@magnolia \
    --to=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.