From: Guillaume Tucker <guillaume.tucker@collabora.com>
To: "Ser, Simon" <simon.ser@intel.com>,
"Hiler, Arkadiusz" <arkadiusz.hiler@intel.com>,
"Latvala, Petri" <petri.latvala@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t v2 1/4] meson: add libatomic dependency
Date: Tue, 18 Jun 2019 09:33:41 +0100 [thread overview]
Message-ID: <250e4bb0-efa6-1f23-6195-9cf3a7398c06@collabora.com> (raw)
In-Reply-To: <d479de99f2729dbd0f2f0615b41ebeaff025cc9a.camel@intel.com>
On 14/06/2019 09:07, Ser, Simon wrote:
> On Thu, 2019-06-13 at 14:53 +0100, Guillaume Tucker wrote:
>> Add conditional dependency on libatomic in order to be able to use the
>> __atomic_* functions instead of the older __sync_* ones. The
>> libatomic library is only needed when there aren't any native support
>> on the current architecture, so a linker test is used for this
>> purpose. This enables atomic operations to be on a wider number of
>> architectures including MIPS.
>>
>> Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
>> ---
>> meson.build | 13 +++++++++++++
>> 1 file changed, 13 insertions(+)
>>
>> diff --git a/meson.build b/meson.build
>> index 6268c58d3634..da25a28f3268 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -179,6 +179,19 @@ math = cc.find_library('m')
>> realtime = cc.find_library('rt')
>> dlsym = cc.find_library('dl')
>> zlib = cc.find_library('z')
>> +if cc.links('''
>> +#include <stdint.h>
>> +int main(void) {
>> + uint32_t x32 = 0;
>> + uint64_t x64 = 0;
>> + __atomic_load_n(&x32, __ATOMIC_SEQ_CST);
>> + __atomic_load_n(&x64, __ATOMIC_SEQ_CST);
>
> Minor: maybe we could've used stdatomic.h's atomic_* functions (without
> the "__" prefix) for consistency with the actual IGT code?
I actually thought it was more correct to use the __atomic_*
functions directly from the libatomic library as this is a linker
test. If for any reason stdatomic.h changes between versions or
compilers and uses something else than libatomic, then this test
would become invalid.
>> + return 0;
>> +}''', name : 'built-in atomics')
>> + libatomic = []
>
> We could use null_dep instead, to make it consistent with the other
> branch.
Ack, will fix that in v3.
>> +else
>> + libatomic = cc.find_library('atomic')
>> +endif
>>
>> if cc.has_header('linux/kd.h')
>> config.set('HAVE_LINUX_KD_H', 1)
Thanks,
Guillaume
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-06-18 8:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 13:53 [igt-dev] [PATCH i-g-t v2 0/4] Use C11 atomics Guillaume Tucker
2019-06-13 13:53 ` [Intel-gfx] [PATCH i-g-t v2 1/4] meson: add libatomic dependency Guillaume Tucker
2019-06-14 8:07 ` [igt-dev] " Ser, Simon
2019-06-18 8:33 ` Guillaume Tucker [this message]
2019-06-18 13:11 ` Ser, Simon
2019-06-13 13:53 ` [igt-dev] [PATCH i-g-t v2 2/4] gitlab-ci: add libatomic to docker images Guillaume Tucker
2019-06-14 8:08 ` Ser, Simon
2019-06-14 10:00 ` Petri Latvala
2019-06-14 11:24 ` Ser, Simon
2019-06-14 12:43 ` Petri Latvala
2019-06-14 12:53 ` [Intel-gfx] " Ser, Simon
2019-06-18 8:42 ` Guillaume Tucker
2019-06-13 13:53 ` [igt-dev] [PATCH i-g-t v2 3/4] i915/gem_create: use atomic_* instead of __sync_* Guillaume Tucker
2019-06-14 8:11 ` Ser, Simon
2019-06-13 13:53 ` [Intel-gfx] [PATCH i-g-t v2 4/4] tests/sw_sync: " Guillaume Tucker
2019-06-14 8:12 ` [igt-dev] " Ser, Simon
2019-06-13 16:33 ` [igt-dev] ✓ Fi.CI.BAT: success for Use C11 atomics Patchwork
2019-06-15 5:16 ` [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=250e4bb0-efa6-1f23-6195-9cf3a7398c06@collabora.com \
--to=guillaume.tucker@collabora.com \
--cc=arkadiusz.hiler@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=petri.latvala@intel.com \
--cc=simon.ser@intel.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