All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10)
@ 2020-04-15 11:26 Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 1/9] Remove use of TCID in new API tests Petr Vorel
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Petr Vorel @ 2020-04-15 11:26 UTC (permalink / raw)
  To: ltp

Hi,

I added 1st commit "Remove use of TCID in new API tests" which allows to
remove extern const char *TCID;

https://travis-ci.org/github/pevik/ltp/builds/675251626

Kind regards,
Petr

Petr Vorel (9):
  Remove use of TCID in new API tests
  lib: Fix linking error multiple TCID definitions with -fno-common
  controllers: Simplify fullpath definition
  controllers: Fix linking with -fno-common
  kernel/mem: Fix linking error with -fno-common
  hugepage: Fix linking error with -fno-common
  hugetlb: Fix linking error with -fno-common
  realtime: Fix linking error with -fno-common
  travis: Build with -fno-common

 build.sh                                      |  2 +-
 include/tst_hugepage.h                        |  4 +--
 include/tst_test.h                            |  4 ---
 lib/tst_hugepage.c                            |  2 ++
 lib/tst_test.c                                |  5 +++
 .../controllers/cpuctl/cpuctl_def_task01.c    |  2 --
 .../controllers/cpuctl/cpuctl_def_task02.c    |  2 --
 .../controllers/cpuctl/cpuctl_def_task03.c    |  2 --
 .../controllers/cpuctl/cpuctl_def_task04.c    |  2 --
 .../kernel/controllers/cpuctl/cpuctl_test01.c |  2 --
 .../kernel/controllers/cpuctl/cpuctl_test02.c |  1 -
 .../kernel/controllers/cpuctl/cpuctl_test03.c |  2 --
 .../kernel/controllers/cpuctl/cpuctl_test04.c |  2 --
 .../libcontrollers/libcontrollers.c           | 11 +++++++
 .../libcontrollers/libcontrollers.h           | 32 ++++++-------------
 testcases/kernel/mem/hugetlb/lib/hugetlb.c    |  2 ++
 testcases/kernel/mem/hugetlb/lib/hugetlb.h    |  2 +-
 testcases/kernel/mem/include/mem.h            |  2 +-
 .../kernel/mem/tunable/overcommit_memory.c    |  4 +--
 .../security/integrity/ima/src/ima_mmap.c     |  3 +-
 .../syscalls/memfd_create/memfd_create01.c    |  3 +-
 testcases/realtime/include/librttest.h        |  1 -
 testcases/realtime/lib/librttest.c            |  1 +
 23 files changed, 42 insertions(+), 51 deletions(-)

-- 
2.26.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 1/9] Remove use of TCID in new API tests
  2020-04-15 11:26 [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Petr Vorel
@ 2020-04-15 11:26 ` Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 2/9] lib: Fix linking error multiple TCID definitions with -fno-common Petr Vorel
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-04-15 11:26 UTC (permalink / raw)
  To: ltp

This is a preparation for build with -fno-common

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
New in v2.
Sorry for quashing it in a single commit.

 testcases/kernel/mem/tunable/overcommit_memory.c        | 4 ++--
 testcases/kernel/security/integrity/ima/src/ima_mmap.c  | 3 ++-
 testcases/kernel/syscalls/memfd_create/memfd_create01.c | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/mem/tunable/overcommit_memory.c b/testcases/kernel/mem/tunable/overcommit_memory.c
index 345764dfe..f77939908 100644
--- a/testcases/kernel/mem/tunable/overcommit_memory.c
+++ b/testcases/kernel/mem/tunable/overcommit_memory.c
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) Linux Test Project, 2012-2020
  * Copyright (C) 2012-2017  Red Hat, Inc.
  *
  * This program is free software;  you can redistribute it and/or modify
@@ -101,8 +102,7 @@ static void setup(void)
 
 	if (access(PATH_SYSVM "overcommit_memory", F_OK) == -1 ||
 	    access(PATH_SYSVM "overcommit_ratio", F_OK) == -1)
-		tst_brk(TCONF, "The system "
-			 "can't support to test %s", TCID);
+		tst_brk(TCONF, "system doesn't support overcommit_memory");
 
 	if (R_opt)
 		overcommit_ratio = SAFE_STRTOL(R_opt, 0, LONG_MAX);
diff --git a/testcases/kernel/security/integrity/ima/src/ima_mmap.c b/testcases/kernel/security/integrity/ima/src/ima_mmap.c
index 0875aaeaf..c831be829 100644
--- a/testcases/kernel/security/integrity/ima/src/ima_mmap.c
+++ b/testcases/kernel/security/integrity/ima/src/ima_mmap.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
+ * Copyright (c) Linux Test Project, 2010-2020
  * Copyright (c) International Business Machines Corp., 2009
  *
  * Authors:
@@ -33,7 +34,7 @@ static void cleanup(void)
 static void run(void)
 {
 	if (!filename)
-		tst_brk(TBROK, "Usage: %s -f filename", TCID);
+		tst_brk(TBROK, "missing filename (-f filename)");
 
 	fd = SAFE_OPEN(filename, O_CREAT | O_RDWR, S_IRWXU);
 
diff --git a/testcases/kernel/syscalls/memfd_create/memfd_create01.c b/testcases/kernel/syscalls/memfd_create/memfd_create01.c
index fdd37f64b..e0db69dff 100644
--- a/testcases/kernel/syscalls/memfd_create/memfd_create01.c
+++ b/testcases/kernel/syscalls/memfd_create/memfd_create01.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
+ * Copyright (c) Linux Test Project, 2017-2020
  * Copyright (C) 2017  Red Hat, Inc.
  */
 
@@ -241,7 +242,7 @@ static void verify_memfd_create(unsigned int n)
 
 	tst_res(TINFO, "%s", tc->desc);
 
-	fd = CHECK_MFD_NEW(TCID, MFD_DEF_SIZE, tc->flags);
+	fd = CHECK_MFD_NEW("ltp_memfd_create01", MFD_DEF_SIZE, tc->flags);
 
 	tc->func(fd);
 
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 2/9] lib: Fix linking error multiple TCID definitions with -fno-common
  2020-04-15 11:26 [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 1/9] Remove use of TCID in new API tests Petr Vorel
@ 2020-04-15 11:26 ` Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 3/9] controllers: Simplify fullpath definition Petr Vorel
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-04-15 11:26 UTC (permalink / raw)
  To: ltp

-fno-common is a default for gcc-10 and if not used on many targets
implies a speed and code size penalty on global variable references.
It requires either defining variable in header as extern or moving it
to C source.

https://gcc.gnu.org/gcc-10/porting_to.html

Due different TCID handling in legacy API (which defines TCID in the
test source) and new API (TCID defined in the library header) it's not
enough to simply move that definition into tst_test.c because that would
mean that old API test would end up with multiple definitions one in the
corresponding test and one in the new library library code. To workaround
this added definition in tst_test.c with weak linker attribute.

Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Tested-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/tst_test.h | 4 ----
 lib/tst_test.c     | 5 +++++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/tst_test.h b/include/tst_test.h
index 42c02b549..484842e59 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -319,9 +319,5 @@ int main(int argc, char *argv[])
 
 #define TST_TEST_TCONF(message)                                 \
         static struct tst_test test = { .tconf_msg = message  } \
-/*
- * This is a hack to make the testcases link without defining TCID
- */
-const char *TCID;
 
 #endif	/* TST_TEST_H__ */
diff --git a/lib/tst_test.c b/lib/tst_test.c
index e502c2c1a..64cd3ac33 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -32,6 +32,11 @@
 #include "old_device.h"
 #include "old_tmpdir.h"
 
+/*
+ * Hack to get TCID defined in newlib tests
+ */
+const char *TCID __attribute__((weak));
+
 #define LINUX_GIT_URL "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id="
 #define CVE_DB_URL "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-"
 
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 3/9] controllers: Simplify fullpath definition
  2020-04-15 11:26 [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 1/9] Remove use of TCID in new API tests Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 2/9] lib: Fix linking error multiple TCID definitions with -fno-common Petr Vorel
@ 2020-04-15 11:26 ` Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 4/9] controllers: Fix linking with -fno-common Petr Vorel
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-04-15 11:26 UTC (permalink / raw)
  To: ltp

PATH_MAX has been in <limits.h> in all libc for a long time.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/controllers/libcontrollers/libcontrollers.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/testcases/kernel/controllers/libcontrollers/libcontrollers.h b/testcases/kernel/controllers/libcontrollers/libcontrollers.h
index cdde9f9e6..f999f705e 100644
--- a/testcases/kernel/controllers/libcontrollers/libcontrollers.h
+++ b/testcases/kernel/controllers/libcontrollers/libcontrollers.h
@@ -42,11 +42,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#ifdef PATH_MAX
 char fullpath[PATH_MAX];
-#else
-char fullpath[1024]; /* Guess */
-#endif
 
 int FLAG;
 volatile int timer_expired;
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 4/9] controllers: Fix linking with -fno-common
  2020-04-15 11:26 [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Petr Vorel
                   ` (2 preceding siblings ...)
  2020-04-15 11:26 ` [LTP] [PATCH v2 3/9] controllers: Simplify fullpath definition Petr Vorel
@ 2020-04-15 11:26 ` Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 5/9] kernel/mem: Fix linking error " Petr Vorel
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-04-15 11:26 UTC (permalink / raw)
  To: ltp

by moving definitions to libcontrollers.c and adding extern declarations
to libcontrollers.h.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 .../controllers/cpuctl/cpuctl_def_task01.c    |  2 --
 .../controllers/cpuctl/cpuctl_def_task02.c    |  2 --
 .../controllers/cpuctl/cpuctl_def_task03.c    |  2 --
 .../controllers/cpuctl/cpuctl_def_task04.c    |  2 --
 .../kernel/controllers/cpuctl/cpuctl_test01.c |  2 --
 .../kernel/controllers/cpuctl/cpuctl_test02.c |  1 -
 .../kernel/controllers/cpuctl/cpuctl_test03.c |  2 --
 .../kernel/controllers/cpuctl/cpuctl_test04.c |  2 --
 .../libcontrollers/libcontrollers.c           | 11 ++++++++
 .../libcontrollers/libcontrollers.h           | 28 +++++++------------
 10 files changed, 21 insertions(+), 33 deletions(-)

diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c b/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c
index 90119e4ad..578c60c89 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c
@@ -81,8 +81,6 @@ extern void cleanup(void)
 	/* Report exit status */
 }
 
-volatile int timer_expired = 0;
-
 int main(int argc, char *argv[])
 {
 
diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c b/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c
index dc1546e88..658c6fd3f 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c
@@ -76,8 +76,6 @@ extern void cleanup(void)
 	/* Report exit status */
 }
 
-volatile int timer_expired = 0;
-
 int main(int argc, char *argv[])
 {
 
diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c b/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c
index 92b451793..a700ca515 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c
@@ -76,8 +76,6 @@ extern void cleanup(void)
 	/* Report exit status */
 }
 
-volatile int timer_expired = 0;
-
 int main(int argc, char *argv[])
 {
 
diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c b/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c
index 108e576e1..1726f810d 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c
@@ -76,8 +76,6 @@ extern void cleanup(void)
 	/* Report exit status */
 }
 
-volatile int timer_expired = 0;
-
 int main(int argc, char *argv[])
 {
 
diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_test01.c b/testcases/kernel/controllers/cpuctl/cpuctl_test01.c
index d7be1c80c..8f6d11de0 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_test01.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_test01.c
@@ -79,8 +79,6 @@ extern void cleanup(void)
 	tst_exit();		/* Report exit status */
 }
 
-volatile int timer_expired = 0;
-
 int main(int argc, char *argv[])
 {
 
diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_test02.c b/testcases/kernel/controllers/cpuctl/cpuctl_test02.c
index 2a5cd4a11..52ad8aa2f 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_test02.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_test02.c
@@ -78,7 +78,6 @@ extern void cleanup(void)
 }
 
 int migrate_task();
-volatile int timer_expired = 0;
 
 int main(void)
 {
diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_test03.c b/testcases/kernel/controllers/cpuctl/cpuctl_test03.c
index 8a80d6932..0e0a26dc3 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_test03.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_test03.c
@@ -76,8 +76,6 @@ extern void cleanup(void)
 	tst_exit();		/* Report exit status */
 }
 
-volatile int timer_expired = 0;
-
 int main(int argc, char *argv[])
 {
 
diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_test04.c b/testcases/kernel/controllers/cpuctl/cpuctl_test04.c
index 791a58dd2..dae0d4c05 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_test04.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_test04.c
@@ -77,8 +77,6 @@ extern void cleanup(void)
 	tst_exit();		/* Report exit status */
 }
 
-volatile int timer_expired = 0;
-
 int main(int argc, char *argv[])
 {
 
diff --git a/testcases/kernel/controllers/libcontrollers/libcontrollers.c b/testcases/kernel/controllers/libcontrollers/libcontrollers.c
index 75766fc19..e9917271c 100644
--- a/testcases/kernel/controllers/libcontrollers/libcontrollers.c
+++ b/testcases/kernel/controllers/libcontrollers/libcontrollers.c
@@ -35,6 +35,17 @@
 
 #include "libcontrollers.h"
 
+char fullpath[PATH_MAX];
+int FLAG;
+volatile int timer_expired = 0;
+int retval;
+unsigned int num_line;
+unsigned int current_shares;
+unsigned int total_shares;
+unsigned int *shares_pointer;
+char target[LINE_MAX];
+struct dirent *dir_pointer;
+
 /*
  * Function: scan_shares_file()
  * This function scans all the shares files under the mountpoint
diff --git a/testcases/kernel/controllers/libcontrollers/libcontrollers.h b/testcases/kernel/controllers/libcontrollers/libcontrollers.h
index f999f705e..7d7b8324b 100644
--- a/testcases/kernel/controllers/libcontrollers/libcontrollers.h
+++ b/testcases/kernel/controllers/libcontrollers/libcontrollers.h
@@ -42,24 +42,16 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-char fullpath[PATH_MAX];
-
-int FLAG;
-volatile int timer_expired;
-
-int retval;
-
-unsigned int num_line;//??
-
-unsigned int current_shares;
-
-unsigned int total_shares;
-
-unsigned int *shares_pointer;//??
-
-char target[LINE_MAX];
-
-struct dirent 	*dir_pointer;
+extern char fullpath[PATH_MAX];
+extern int FLAG;
+extern volatile int timer_expired;
+extern int retval;
+extern unsigned int num_line;
+extern unsigned int current_shares;
+extern unsigned int total_shares;
+extern unsigned int *shares_pointer;
+extern char target[LINE_MAX];
+extern struct dirent *dir_pointer;
 
 enum{
 	GET_SHARES	=1,
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 5/9] kernel/mem: Fix linking error with -fno-common
  2020-04-15 11:26 [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Petr Vorel
                   ` (3 preceding siblings ...)
  2020-04-15 11:26 ` [LTP] [PATCH v2 4/9] controllers: Fix linking with -fno-common Petr Vorel
@ 2020-04-15 11:26 ` Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 6/9] hugepage: " Petr Vorel
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-04-15 11:26 UTC (permalink / raw)
  To: ltp

Adding missing extern.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/mem/include/mem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/mem/include/mem.h b/testcases/kernel/mem/include/mem.h
index a12c2231f..cce9c0497 100644
--- a/testcases/kernel/mem/include/mem.h
+++ b/testcases/kernel/mem/include/mem.h
@@ -37,7 +37,7 @@ static inline void clean_node(unsigned long *array)
 #define MLOCK			2
 #define KSM			3
 
-long overcommit;
+extern long overcommit;
 void oom(int testcase, int lite, int retcode, int allow_sigkill);
 void testoom(int mempolicy, int lite, int retcode, int allow_sigkill);
 
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 6/9] hugepage: Fix linking error with -fno-common
  2020-04-15 11:26 [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Petr Vorel
                   ` (4 preceding siblings ...)
  2020-04-15 11:26 ` [LTP] [PATCH v2 5/9] kernel/mem: Fix linking error " Petr Vorel
@ 2020-04-15 11:26 ` Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 7/9] hugetlb: " Petr Vorel
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-04-15 11:26 UTC (permalink / raw)
  To: ltp

by moving definitions to tst_hugepage.c and adding extern declarations
to tst_hugepage.h.

Fixes: 156f91396 ("hugetlb: move nr_opt to tst_hugepage.h")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/tst_hugepage.h | 4 ++--
 lib/tst_hugepage.c     | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/tst_hugepage.h b/include/tst_hugepage.h
index 30e00a377..60c03c5c5 100644
--- a/include/tst_hugepage.h
+++ b/include/tst_hugepage.h
@@ -9,8 +9,8 @@
 #define PATH_HUGEPAGES	"/sys/kernel/mm/hugepages/"
 #define PATH_NR_HPAGES	"/proc/sys/vm/nr_hugepages"
 
-char *nr_opt; /* -s num   Set the number of the been allocated hugepages */
-char *Hopt;   /* -H /..   Location of hugetlbfs, i.e.  -H /var/hugetlbfs */
+extern char *nr_opt; /* -s num   Set the number of the been allocated hugepages */
+extern char *Hopt;   /* -H /..   Location of hugetlbfs, i.e.  -H /var/hugetlbfs */
 
 /*
  * Try the best to request a specified number of huge pages from system,
diff --git a/lib/tst_hugepage.c b/lib/tst_hugepage.c
index 34fd27ede..52667a14e 100644
--- a/lib/tst_hugepage.c
+++ b/lib/tst_hugepage.c
@@ -9,6 +9,8 @@
 #include "tst_hugepage.h"
 
 unsigned long tst_hugepages;
+char *nr_opt;
+char *Hopt;
 
 unsigned long tst_request_hugepages(unsigned long hpages)
 {
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 7/9] hugetlb: Fix linking error with -fno-common
  2020-04-15 11:26 [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Petr Vorel
                   ` (5 preceding siblings ...)
  2020-04-15 11:26 ` [LTP] [PATCH v2 6/9] hugepage: " Petr Vorel
@ 2020-04-15 11:26 ` Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 8/9] realtime: " Petr Vorel
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-04-15 11:26 UTC (permalink / raw)
  To: ltp

Adding missing extern.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/mem/hugetlb/lib/hugetlb.c | 2 ++
 testcases/kernel/mem/hugetlb/lib/hugetlb.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/mem/hugetlb/lib/hugetlb.c b/testcases/kernel/mem/hugetlb/lib/hugetlb.c
index cd1b27eb3..4bb2d500e 100644
--- a/testcases/kernel/mem/hugetlb/lib/hugetlb.c
+++ b/testcases/kernel/mem/hugetlb/lib/hugetlb.c
@@ -39,6 +39,8 @@
 #include <pwd.h>
 #include "hugetlb.h"
 
+key_t shmkey;
+
 /*
  * getipckey() - generates and returns a message key used by the "get"
  *		 calls to create an IPC resource.
diff --git a/testcases/kernel/mem/hugetlb/lib/hugetlb.h b/testcases/kernel/mem/hugetlb/lib/hugetlb.h
index 88890ebfb..f75109f3e 100644
--- a/testcases/kernel/mem/hugetlb/lib/hugetlb.h
+++ b/testcases/kernel/mem/hugetlb/lib/hugetlb.h
@@ -34,7 +34,7 @@
  */
 #define MODE_MASK	0x01FF
 
-key_t shmkey;			/* an IPC key generated by ftok() */
+extern key_t shmkey;			/* an IPC key generated by ftok() */
 
 int getipckey(void);
 int getuserid(char *user);
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 8/9] realtime: Fix linking error with -fno-common
  2020-04-15 11:26 [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Petr Vorel
                   ` (6 preceding siblings ...)
  2020-04-15 11:26 ` [LTP] [PATCH v2 7/9] hugetlb: " Petr Vorel
@ 2020-04-15 11:26 ` Petr Vorel
  2020-04-15 11:26 ` [LTP] [PATCH v2 9/9] travis: Build " Petr Vorel
  2020-04-15 12:01 ` [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Jan Stancek
  9 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-04-15 11:26 UTC (permalink / raw)
  To: ltp

by declaring iters_per_us as static and moving from header into
C source.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/realtime/include/librttest.h | 1 -
 testcases/realtime/lib/librttest.c     | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/realtime/include/librttest.h b/testcases/realtime/include/librttest.h
index c18236200..b829f4089 100644
--- a/testcases/realtime/include/librttest.h
+++ b/testcases/realtime/include/librttest.h
@@ -66,7 +66,6 @@ extern char *optarg;
 
 #define _MAXTHREADS 256
 #define CALIBRATE_LOOPS 100000
-unsigned long iters_per_us;
 
 #define NS_PER_MS 1000000
 #define NS_PER_US 1000
diff --git a/testcases/realtime/lib/librttest.c b/testcases/realtime/lib/librttest.c
index 36790581e..722d99d50 100644
--- a/testcases/realtime/lib/librttest.c
+++ b/testcases/realtime/lib/librttest.c
@@ -63,6 +63,7 @@
 
 static LIST_HEAD(_threads);
 static atomic_t _thread_count = { -1 };
+static unsigned long iters_per_us;
 
 pthread_mutex_t _buffer_mutex;
 char *_print_buffer = NULL;
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 9/9] travis: Build with -fno-common
  2020-04-15 11:26 [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Petr Vorel
                   ` (7 preceding siblings ...)
  2020-04-15 11:26 ` [LTP] [PATCH v2 8/9] realtime: " Petr Vorel
@ 2020-04-15 11:26 ` Petr Vorel
  2020-04-15 12:01 ` [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Jan Stancek
  9 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-04-15 11:26 UTC (permalink / raw)
  To: ltp

This is the default with gcc-10, but use it with all compilers.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.sh b/build.sh
index e3d268c83..50fb527e4 100755
--- a/build.sh
+++ b/build.sh
@@ -9,7 +9,7 @@
 
 set -e
 
-CFLAGS="${CFLAGS:--Werror=implicit-function-declaration}"
+CFLAGS="${CFLAGS:--Werror=implicit-function-declaration -fno-common}"
 CC="${CC:-gcc}"
 
 DEFAULT_PREFIX="$HOME/ltp-install"
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10)
  2020-04-15 11:26 [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Petr Vorel
                   ` (8 preceding siblings ...)
  2020-04-15 11:26 ` [LTP] [PATCH v2 9/9] travis: Build " Petr Vorel
@ 2020-04-15 12:01 ` Jan Stancek
  2020-04-15 13:04   ` Cyril Hrubis
  9 siblings, 1 reply; 13+ messages in thread
From: Jan Stancek @ 2020-04-15 12:01 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> Hi,
> 
> I added 1st commit "Remove use of TCID in new API tests" which allows to
> remove extern const char *TCID;
> 
> https://travis-ci.org/github/pevik/ltp/builds/675251626
> 
> Kind regards,
> Petr

Looks good, ack.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10)
  2020-04-15 12:01 ` [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Jan Stancek
@ 2020-04-15 13:04   ` Cyril Hrubis
  2020-04-15 13:09     ` Petr Vorel
  0 siblings, 1 reply; 13+ messages in thread
From: Cyril Hrubis @ 2020-04-15 13:04 UTC (permalink / raw)
  To: ltp

Hi!
Acked as well.

-- 
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10)
  2020-04-15 13:04   ` Cyril Hrubis
@ 2020-04-15 13:09     ` Petr Vorel
  0 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-04-15 13:09 UTC (permalink / raw)
  To: ltp

Hi Jan, Cyril,

> Hi!
> Acked as well.

Thanks both for a review, merged.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-04-15 13:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 11:26 [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Petr Vorel
2020-04-15 11:26 ` [LTP] [PATCH v2 1/9] Remove use of TCID in new API tests Petr Vorel
2020-04-15 11:26 ` [LTP] [PATCH v2 2/9] lib: Fix linking error multiple TCID definitions with -fno-common Petr Vorel
2020-04-15 11:26 ` [LTP] [PATCH v2 3/9] controllers: Simplify fullpath definition Petr Vorel
2020-04-15 11:26 ` [LTP] [PATCH v2 4/9] controllers: Fix linking with -fno-common Petr Vorel
2020-04-15 11:26 ` [LTP] [PATCH v2 5/9] kernel/mem: Fix linking error " Petr Vorel
2020-04-15 11:26 ` [LTP] [PATCH v2 6/9] hugepage: " Petr Vorel
2020-04-15 11:26 ` [LTP] [PATCH v2 7/9] hugetlb: " Petr Vorel
2020-04-15 11:26 ` [LTP] [PATCH v2 8/9] realtime: " Petr Vorel
2020-04-15 11:26 ` [LTP] [PATCH v2 9/9] travis: Build " Petr Vorel
2020-04-15 12:01 ` [LTP] [PATCH v2 0/9] Fix compilation with -fno-common (gcc-10) Jan Stancek
2020-04-15 13:04   ` Cyril Hrubis
2020-04-15 13:09     ` Petr Vorel

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.