public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Lyude <lyude@redhat.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/4] lib/igt_core: Make igt_subtest_jmpbuf/igt_dynamic_jmpbuf extern
Date: Mon, 16 Mar 2020 12:11:29 -0400	[thread overview]
Message-ID: <20200316161132.29833-2-lyude@redhat.com> (raw)
In-Reply-To: <20200316161132.29833-1-lyude@redhat.com>

From: Lyude Paul <lyude@redhat.com>

Since gcc 10, -fno-common has become the default (vs. -fcommon). As a
result, gcc is much stricter about missing extern and static keywords
and causes our build to fail in anything including igt_core.h:

/usr/bin/ld:
lib/libigt-i915_gem_context_c.a(i915_gem_context.c.o):lib/igt_core.h:149:
multiple definition of `igt_dynamic_jmpbuf';
lib/libigt-drmtest_c.a(drmtest.c.o):lib/igt_core.h:149: first defined
here
/usr/bin/ld:
lib/libigt-i915_gem_context_c.a(i915_gem_context.c.o):lib/igt_core.h:148:
multiple definition of `igt_subtest_jmpbuf';
lib/libigt-drmtest_c.a(drmtest.c.o):lib/igt_core.h:148: first defined
here

So, fix this by marking these as extern and declaring them in
lib/igt_core.c.

Signed-off-by: Lyude Paul <lyude@redhat.com>
---
 lib/igt_core.c | 3 +++
 lib/igt_core.h | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 51041793..2b928f1a 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -261,6 +261,9 @@
  * such as those related to Chamelium support.
  */
 
+jmp_buf igt_subtest_jmpbuf;
+jmp_buf igt_dynamic_jmpbuf;
+
 static unsigned int exit_handler_count;
 const char *igt_interactive_debug;
 bool igt_skip_crc_compare;
diff --git a/lib/igt_core.h b/lib/igt_core.h
index c17a7ba8..fae5f59e 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -145,8 +145,8 @@ void __igt_fixture_end(void) __attribute__((noreturn));
 			 __igt_fixture_complete())
 
 /* subtest infrastructure */
-jmp_buf igt_subtest_jmpbuf;
-jmp_buf igt_dynamic_jmpbuf;
+extern jmp_buf igt_subtest_jmpbuf;
+extern jmp_buf igt_dynamic_jmpbuf;
 typedef int (*igt_opt_handler_t)(int opt, int opt_index, void *data);
 #define IGT_OPT_HANDLER_SUCCESS 0
 #define IGT_OPT_HANDLER_ERROR -2
-- 
2.24.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-03-16 16:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 16:11 [igt-dev] [PATCH i-g-t 0/4] Fixes for GCC 10's -fcommon default Lyude
2020-03-16 16:11 ` Lyude [this message]
2020-03-16 23:11   ` [igt-dev] [PATCH i-g-t 1/4] lib/igt_core: Make igt_subtest_jmpbuf/igt_dynamic_jmpbuf extern Chris Wilson
2020-03-16 16:11 ` [igt-dev] [PATCH i-g-t 2/4] lib/rendercopy_gen*: Make cc/viewport static Lyude
2020-03-16 23:11   ` Chris Wilson
2020-03-16 16:11 ` [igt-dev] [PATCH i-g-t 3/4] assembler/gen4asm.h: Make struct src_operand extern Lyude
2020-03-16 23:08   ` Chris Wilson
2020-03-17 16:56     ` Lyude Paul
2020-03-19 17:29       ` Lyude Paul
2020-03-16 23:10   ` Chris Wilson
2020-03-19 17:40   ` [igt-dev] [PATCH i-g-t v2] assembler/gen4asm.h: Remove struct src_operand src_operand variable Lyude
2020-03-20 12:24     ` Petri Latvala
2020-03-16 16:11 ` [igt-dev] [PATCH i-g-t 4/4] meson: Add -fcommon to cc_flags Lyude
2020-03-17  6:34   ` Petri Latvala
2020-03-16 17:16 ` [igt-dev] ✓ Fi.CI.BAT: success for Fixes for GCC 10's -fcommon default Patchwork
2020-03-17  0:39 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-03-19 18:59 ` [igt-dev] ✗ Fi.CI.BAT: failure for Fixes for GCC 10's -fcommon default (rev2) Patchwork

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=20200316161132.29833-2-lyude@redhat.com \
    --to=lyude@redhat.com \
    --cc=igt-dev@lists.freedesktop.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox