All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] fcntl37: test posix lock across execve
Date: Tue, 27 Mar 2018 12:19:29 +0200	[thread overview]
Message-ID: <20180327101929.GA11658@rei> (raw)
In-Reply-To: <20180327085043.e7hrrcho5xzkdh34@XZHOUW.usersys.redhat.com>

Hi!
> > > +fcntl37: LDLIBS += -lpthread
> > > +fcntl37_64: LDLIBS += -lpthread
> > 
> > This is wrong, we should use CFLAGS += -pthread instead, also the rest
> 				^ This is not working.
> 
> gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -DTST_USE_NEWER64_SYSCALL=1 -pthread -D_FORTIFY_SOURCE=2 -I/home/xzhou/ltp/testcases/kernel/syscalls/fcntl -I/home/xzhou/ltp/testcases/kernel/syscalls/fcntl/../utils -D_GNU_SOURCE -I../../../../include -I../../../../include -I../../../../include/old/ -D_FILE_OFFSET_BITS=64  -c -o fcntl37_64.o fcntl37.c
> gcc   -L../../../../lib  fcntl37_64.o   -lltp -o fcntl37_64
> ../../../../lib/libltp.a(safe_pthread.o): In function `safe_pthread_create':
> /home/xzhou/ltp/lib/safe_pthread.c:30: undefined reference to `pthread_create'
> ../../../../lib/libltp.a(safe_pthread.o): In function `safe_pthread_join':
> /home/xzhou/ltp/lib/safe_pthread.c:46: undefined reference to `pthread_join'
> collect2: error: ld returned 1 exit status

Hmm, looks like something is wrong with the newer_64.mk. It picks up a
linker rule that does not include CFLAGS. Following patch fixes that,
but I'm not 100% sure that it's correct, I will look further into that.

diff --git a/testcases/kernel/syscalls/utils/newer_64.mk b/testcases/kernel/syscalls/utils/newer_64.mk
index 8cd7e03c8..c70c2af53 100644
--- a/testcases/kernel/syscalls/utils/newer_64.mk
+++ b/testcases/kernel/syscalls/utils/newer_64.mk
@@ -49,7 +49,9 @@ HAS_NEWER_64          := 0
 endif
 
 %_64: CFLAGS += -D$(DEF_64)=1
-# XXX (garrcoop): End section of code in question..
 
 %_64.o: %.c
        $(COMPILE.c) $(OUTPUT_OPTION) $<
+
+%_64: %_64.o
+       $(LINK.c) $(OUTPUT_OPTION) $< $(LDLIBS)


-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2018-03-27 10:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 13:28 [LTP] [PATCH] fcntl37: test posix lock across execve Xiong Zhou
2018-03-26 13:52 ` Daniel P. =?unknown-8bit?q?Berrang=C3=A9?=
2018-03-26 14:33 ` Cyril Hrubis
2018-03-26 14:42   ` Cyril Hrubis
2018-03-27  8:50   ` Xiong Zhou
2018-03-27 10:19     ` Cyril Hrubis [this message]
2018-03-27 12:12       ` Xiong Zhou
2018-03-29 14:09   ` Xiong Zhou
2018-03-30  5:23   ` Xiong Zhou
2018-04-03 14:28     ` Cyril Hrubis
2018-03-27 13:38 ` [LTP] [PATCH v2] " Xiong Zhou
2018-03-27 14:47   ` Cyril Hrubis

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=20180327101929.GA11658@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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.