Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Vitaly Chikunov <vt@altlinux.org>
Cc: linux-trace-devel@vger.kernel.org, "Dmitry V . Levin" <ldv@altlinux.org>
Subject: Re: [PATCH 2/2] Makefile: Fix build of utest on systems with --as-needed enabled
Date: Wed, 22 Jul 2020 17:58:50 -0400
Message-ID: <20200722175850.2ff17897@oasis.local.home> (raw)
In-Reply-To: <20200720164453.5161-2-vt@altlinux.org>

On Mon, 20 Jul 2020 19:44:53 +0300
Vitaly Chikunov <vt@altlinux.org> wrote:

> On systems (such as ALT Linux) where `--as-needed' is passed to ld by
> default, building tests fail due to CUNIT_INSTALLED test failure to link
> with libcunit, becasue `-lcunit' is passed before input file (which is
> `-'). Move `-lcunit' after '-' to link it properly.
> 
> To reproduce `make CC='gcc -Wl,--as-needed' test`. Error message:
> 
>   Makefile:344: *** CUnit framework not installed, cannot build unit tests.  Stop.
> 
> Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
> Cc: Dmitry V. Levin <ldv@altlinux.org>

I applied both these patches and released 2.9.1.

Thanks Vitaly!

-- Steve

> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 6b606da..83e5646 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -242,7 +242,7 @@ ifeq ($(VSOCK_DEFINED), 1)
>  CFLAGS += -DVSOCK
>  endif
>  
> -CUNIT_INSTALLED := $(shell if (printf "$(pound)include <CUnit/Basic.h>\n void main(){CU_initialize_registry();}" | $(CC) -x c -lcunit - >/dev/null 2>&1) ; then echo 1; else echo 0 ; fi)
> +CUNIT_INSTALLED := $(shell if (printf "$(pound)include <CUnit/Basic.h>\n void main(){CU_initialize_registry();}" | $(CC) -x c - -lcunit >/dev/null 2>&1) ; then echo 1; else echo 0 ; fi)
>  export CUNIT_INSTALLED
>  
>  export CFLAGS


      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 16:44 [PATCH 1/2] Makefile: Fix CUNIT_INSTALLED test to work with make 4.3 and dash Vitaly Chikunov
2020-07-20 16:44 ` [PATCH 2/2] Makefile: Fix build of utest on systems with --as-needed enabled Vitaly Chikunov
2020-07-22 21:58   ` Steven Rostedt [this message]

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=20200722175850.2ff17897@oasis.local.home \
    --to=rostedt@goodmis.org \
    --cc=ldv@altlinux.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=vt@altlinux.org \
    /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

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git