kumquat-buildroot/package/ltp-testsuite/0002-testcases-kernel-fs-declare-int-openlog-as-static.patch
Fabrice Fontaine e47efc9b90 package/ltp-testsuite: fix static build
Fix the following static build failure:

/nvmedata/autobuild/instance-15/output-1/per-package/ltp-testsuite/host/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/10.3.0/../../../../mipsel-buildroot-linux-uclibc/bin/ld: /nvmedata/autobuild/instance-15/output-1/per-package/ltp-testsuite/host/bin/../mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(syslog.os): in function `openlog':
syslog.c:(.text+0x6b8): multiple definition of `openlog'; /tmp/ccvRnqfT.o:/nvmedata/autobuild/instance-15/output-1/build/ltp-testsuite-20220121/testcases/kernel/fs/fs-bench/random-access.c:14: first defined here

Fixes:
 - http://autobuild.buildroot.org/results/bfd0d906a05564a4f323db604f3b908abf552b20

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-04-27 20:50:17 +02:00

78 lines
3.1 KiB
Diff

From 002ca0320cd2c5e1515bf202f470d4becdf01532 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sun, 24 Apr 2022 21:56:36 +0200
Subject: [PATCH] testcases/kernel/fs: declare int openlog as static
Declare int openlog as static to avoid the following build failure when
building statically (e.g. on buildroot):
/nvmedata/autobuild/instance-15/output-1/per-package/ltp-testsuite/host/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/10.3.0/../../../../mipsel-buildroot-linux-uclibc/bin/ld: /nvmedata/autobuild/instance-15/output-1/per-package/ltp-testsuite/host/bin/../mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(syslog.os): in function `openlog':
syslog.c:(.text+0x6b8): multiple definition of `openlog'; /tmp/ccvRnqfT.o:/nvmedata/autobuild/instance-15/output-1/build/ltp-testsuite-20220121/testcases/kernel/fs/fs-bench/random-access.c:14: first defined here
Fixes:
- http://autobuild.buildroot.org/results/bfd0d906a05564a4f323db604f3b908abf552b20
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
[Retrieved from:
https://github.com/linux-test-project/ltp/commit/002ca0320cd2c5e1515bf202f470d4becdf01532]
---
testcases/kernel/fs/fs-bench/random-access-del-create.c | 2 --
testcases/kernel/fs/fs-bench/random-access.c | 2 +-
testcases/kernel/fs/fs-bench/random-del-create.c | 2 +-
testcases/kernel/fs/scsi/ltpfs/main.c | 2 +-
4 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/testcases/kernel/fs/fs-bench/random-access-del-create.c b/testcases/kernel/fs/fs-bench/random-access-del-create.c
index 1f62a76b5e..1878fd78b5 100644
--- a/testcases/kernel/fs/fs-bench/random-access-del-create.c
+++ b/testcases/kernel/fs/fs-bench/random-access-del-create.c
@@ -11,8 +11,6 @@
#define FAIL 0
#define SUCCESS 1
-int openlog[2] = { 0, 0 };
-
#define MAXNUM 0x100000
#define MAXERROR 1024
diff --git a/testcases/kernel/fs/fs-bench/random-access.c b/testcases/kernel/fs/fs-bench/random-access.c
index cf41d6e81c..c2f32b86e7 100644
--- a/testcases/kernel/fs/fs-bench/random-access.c
+++ b/testcases/kernel/fs/fs-bench/random-access.c
@@ -11,7 +11,7 @@
#define FAIL 0
#define SUCCESS 1
-int openlog[2] = { 0, 0 };
+static int openlog[2] = { 0, 0 };
#define MAXNUM 0x100000
diff --git a/testcases/kernel/fs/fs-bench/random-del-create.c b/testcases/kernel/fs/fs-bench/random-del-create.c
index 0a86f976f3..345031f283 100644
--- a/testcases/kernel/fs/fs-bench/random-del-create.c
+++ b/testcases/kernel/fs/fs-bench/random-del-create.c
@@ -11,7 +11,7 @@
#define FAIL 0
#define SUCCESS 1
-int openlog[2] = { 0, 0 };
+static int openlog[2] = { 0, 0 };
#define MAXNUM 0x100000
diff --git a/testcases/kernel/fs/scsi/ltpfs/main.c b/testcases/kernel/fs/scsi/ltpfs/main.c
index 2c67c7a478..90a5531ac3 100644
--- a/testcases/kernel/fs/scsi/ltpfs/main.c
+++ b/testcases/kernel/fs/scsi/ltpfs/main.c
@@ -38,7 +38,7 @@ int startc = 0;
int showchar[] = { 124, 47, 45, 92, 124, 47, 45, 92 };
int nullFileHandle;
-int openlog[2] = { 0, 0 };
+static int openlog[2] = { 0, 0 };
int cFileCount, dFileCount, errorCount;
static int disk_space_pool = 0;