From: Petri Latvala <petri.latvala@intel.com>
To: Lyude <lyude@redhat.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 2/7] meson: Don't redefine gettid if the C library provides it
Date: Wed, 17 Apr 2019 11:37:41 +0300 [thread overview]
Message-ID: <20190417083741.GP22949@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20190416201101.9132-3-lyude@redhat.com>
On Tue, Apr 16, 2019 at 04:10:56PM -0400, Lyude wrote:
> From: Lyude Paul <lyude@redhat.com>
>
> glibc 2.30+ will actually include a definition for gettid() that makes
> it so that users don't have to manually define a wrapper for it
> themselves with syscall(). We don't currently check for this, and as a
> result will end up redefining gettid() on the latest versions of glibc,
> causing the build to fail:
>
> FAILED: lib/76b5a35@@igt-igt_kmod_c@sta/igt_kmod.c.o
> In file included from /usr/include/unistd.h:1170,
> from ../../mnt/vol/lib/igt_core.h:43,
> from ../../mnt/vol/lib/igt_kmod.c:28:
> /usr/include/bits/unistd_ext.h:34:28: error: macro "gettid" passed 1 arguments, but takes just 0
> 34 | extern __pid_t gettid (void) __THROW;
> | ^
> In file included from ../../mnt/vol/lib/igt_kmod.c:27:
> ../../mnt/vol/lib/igt_aux.h:40: note: macro "gettid" defined here
> 40 | #define gettid() syscall(__NR_gettid)
> |
> [36/771] Compiling C object 'lib/76b5a35@@igt-igt_kms_c@sta/igt_kms.c.o'.
> ninja: build stopped: subcommand failed.
>
> So, fix this by by adding some meson checks to define HAVE_GETTID whenever the
> host defines its own gettid(), and avoid redefining gettid() when HAVE_GETTID is
> defined.
>
> This fixes build intel-gpu-tools for me on Fedora Rawhide
Unless that's the package name on Fedora (and then, why), igt-gpu-tools :)
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> ---
> lib/igt_aux.h | 3 +++
> meson.build | 3 +++
> 2 files changed, 6 insertions(+)
>
> diff --git a/lib/igt_aux.h b/lib/igt_aux.h
> index 55392790..39fefcbf 100644
> --- a/lib/igt_aux.h
> +++ b/lib/igt_aux.h
> @@ -36,7 +36,10 @@
> #include <i915/gem_submission.h>
>
> /* signal interrupt helpers */
> +#ifndef HAVE_GETTID
> #define gettid() syscall(__NR_gettid)
> +#endif
> +
> #define sigev_notify_thread_id _sigev_un._tid
>
> /* auxialiary igt helpers from igt_aux.c */
> diff --git a/meson.build b/meson.build
> index 557400a5..e73275dd 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -237,6 +237,9 @@ if cc.has_header('cpuid.h')
> # FIXME: Do we need the example link test from configure.ac?
> config.set('HAVE_CPUID_H', 1)
> endif
> +if cc.has_header_symbol('unistd.h', 'gettid', args : '-D_GNU_SOURCE')
> + config.set('HAVE_GETTID', 1)
> +endif
All users of gettid() have #include unistd.h? Check.
Are there any other direct calls to syscall(__NR_gettid)? Or
syscall(SYS_gettid)? (is that the same?)
benchmarks/gem_syslatency.c:#define gettid() syscall(__NR_gettid)
lib/igt_core.c: pid_t tid = syscall(SYS_gettid);
tests/core_auth.c: return syscall(SYS_gettid) == tid;
tests/drm_import_export.c: igt_debug("start %ld\n", syscall(SYS_gettid));
tests/i915/gem_close_race.c:#define gettid() syscall(__NR_gettid)
--
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-04-17 8:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-16 20:10 [igt-dev] [PATCH i-g-t 0/7] Fixes from updating igt packaging in Fedora Lyude
2019-04-16 20:10 ` [igt-dev] [PATCH i-g-t 1/7] lib/tests: Fix test failures with meson 0.50.0 Lyude
2019-04-17 8:29 ` Petri Latvala
2019-04-16 20:10 ` [igt-dev] [PATCH i-g-t 2/7] meson: Don't redefine gettid if the C library provides it Lyude
2019-04-17 8:37 ` Petri Latvala [this message]
2019-04-16 20:10 ` [igt-dev] [PATCH i-g-t 3/7] lib: Stop using assert() for runtime checks Lyude
2019-04-17 8:52 ` Petri Latvala
2019-04-24 0:36 ` Lyude Paul
2019-04-24 10:13 ` Petri Latvala
2019-04-16 20:10 ` [igt-dev] [PATCH i-g-t 4/7] lib/igt_core: Just use igt_can_fail() in __igt_run_subtest() Lyude
2019-04-17 9:05 ` Petri Latvala
2019-04-16 20:10 ` [igt-dev] [PATCH i-g-t 5/7] Use pkgconfig() macros with dnf in Fedora Dockerfile Lyude
2019-04-17 9:09 ` Petri Latvala
2019-04-24 17:18 ` Lyude Paul
2019-04-16 20:11 ` [igt-dev] [PATCH i-g-t 6/7] Update Dockerfile.fedora to Fedora 29 Lyude
2019-04-16 20:11 ` [igt-dev] [PATCH i-g-t 7/7] Gitlab CI: Do builds with -Db_ndebug=true Lyude
2019-04-16 20:44 ` [igt-dev] ✓ Fi.CI.BAT: success for Fixes from updating igt packaging in Fedora Patchwork
2019-04-17 6:04 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20190417083741.GP22949@platvala-desk.ger.corp.intel.com \
--to=petri.latvala@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=lyude@redhat.com \
/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