From b51fd37426d5c381f52bf93c5950479a9a13a594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Str=C3=B6mb=C3=A4ck?= Date: Tue, 26 May 2020 16:57:05 +0200 Subject: Fixed compilation error on GCC 10. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 10 uses -fno-common by default, which makes multiple definitions of the same symbol in multiple object files an error. This was used in the userspace test library, and broke with GCC10. Therefore, the relevant symbol is now marked as "weak" to solve the issue and to clarify the intent. Signed-off-by: Filip Strömbäck --- src/tests/lib.c | 2 ++ src/tests/userprog/no-vm/multi-oom.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/tests/lib.c b/src/tests/lib.c index ee36505..5e34069 100644 --- a/src/tests/lib.c +++ b/src/tests/lib.c @@ -5,6 +5,8 @@ #include #include +// Note: test_name is overridden in some tests, and not in others. +__attribute__((weak)) const char *test_name; bool quiet = false; diff --git a/src/tests/userprog/no-vm/multi-oom.c b/src/tests/userprog/no-vm/multi-oom.c index 6a4472d..bd09269 100644 --- a/src/tests/userprog/no-vm/multi-oom.c +++ b/src/tests/userprog/no-vm/multi-oom.c @@ -73,6 +73,7 @@ consume_some_resources_and_die (int seed) { case 0: *(int *) NULL = 42; + break; case 1: return *(int *) NULL; @@ -82,6 +83,7 @@ consume_some_resources_and_die (int seed) case 3: *PHYS_BASE = 42; + break; case 4: open ((char *)PHYS_BASE); -- cgit v1.2.1