From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: Gavin Hu <Gavin.Hu@arm.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Jacob, Jerin" <Jerin.JacobKollanukkaran@cavium.com>
Subject: Re: dev Digest, Vol 195, Issue 45
Date: Wed, 16 May 2018 10:35:06 +0530 [thread overview]
Message-ID: <20180516050505.GA16248@jerin> (raw)
In-Reply-To: <DB7PR08MB31637C042CB07826BE425E5F8F920@DB7PR08MB3163.eurprd08.prod.outlook.com>
-----Original Message-----
> Date: Wed, 16 May 2018 02:08:48 +0000
> From: Gavin Hu <Gavin.Hu@arm.com>
> To: "dev@dpdk.org" <dev@dpdk.org>, "Jacob, Jerin"
> <Jerin.JacobKollanukkaran@cavium.com>
> Subject: Re: [dpdk-dev] dev Digest, Vol 195, Issue 45
>
> >
> > For ARM64 platform, libdpdk.a includes the
> > librte_pmd_octeontx_ssovf.a, which requires the libatomic.a
> > support.The atomic lib is built-in in the gcc toolchain, but for clang it has to be explicitly linked.
> > For more details, please refer to
> > https://clang.llvm.org/docs/Toolchain.html
> >
> > ~/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function `timvf_timer_cancel_burst':
> > timvf_worker.c:(.text+0x80): undefined reference to `__atomic_fetch_add_8'
> > /home/gavin/arm_repo/dpdk/build/lib/librte_pmd_octeontx_ssovf.a(timvf_worker.o): In function `timvf_timer_arm_burst_sp':
> > timvf_worker.c:(.text+0x200): undefined reference to `__atomic_fetch_add_8'
> > timvf_worker.c:(.text+0x244): undefined reference to `__atomic_store_2'
> > timvf_worker.c:(.text+0x278): undefined reference to `__atomic_fetch_add_4'
> > timvf_worker.c:(.text+0x30c): undefined reference to `__atomic_store_2'
> >
> > Signed-off-by: Gavin Hu <gavin.hu@arm.com>
> > Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
>
>
>
> Following patch is part of upstream. Are you testing with following patch/upstream.
>
> With this patch from Nikhilesh, this __ atomic__ compiling issue was gone.
> The two patches fix the same issue.
> Should I abandon my patch?
The root cause is analyzed, the -latomic needs only when atomic
operations on variable are not aligned. The fix added to align variable where it was
not correct.This fix the performance issue as well, adding -latomic
will simply hide the problem by not letting to know the
alignment/performance issue. IMO, If there is no dependency with -latomic
in current code base then we should NOT add new dependency.
>
> I see this note on: https://clang.llvm.org/docs/Toolchain.html
> Note
> Clang does not currently automatically link against libatomic when using libgcc_s. You may need to manually add -latomic to support this configuration when using non-native atomic operations (if you see link errors referring to __atomic_* functions).
>
> commit 55fbc92d7800100628579643c9ee2770614fef10
> Author: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Date: Wed May 9 02:56:00 2018 +0530
>
> event/octeontx: fix build with clang 6
>
> Clang 6 & 7 fail to naturally align packed structs due to this clang
> can't use 8byte atomic primitives and splits them into lesser atomic
> primitives. To use lesser atomic primitives we need to link libatomic
> (-latomic), instead supply alignment attribute to the compiler.
>
> timvf_worker.c:(.text+0x498): undefined reference to `__atomic_fetch_add_8'
> timvf_worker.c:(.text+0x525): undefined reference to `__atomic_store_2'
> timvf_worker.c:(.text+0x557): undefined reference to `__atomic_fetch_add_4'
> timvf_worker.c:(.text+0x5de): undefined reference to `__atomic_store_2'
>
> Fixes: f874c1eb1519 ("event/octeontx: create and free timer
> adapter")
>
> Reported-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
prev parent reply other threads:[~2018-05-16 5:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.3990.1526375522.30695.dev@dpdk.org>
2018-05-16 2:08 ` dev Digest, Vol 195, Issue 45 Gavin Hu
2018-05-16 5:05 ` Jerin Jacob [this message]
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=20180516050505.GA16248@jerin \
--to=jerin.jacob@caviumnetworks.com \
--cc=Gavin.Hu@arm.com \
--cc=Jerin.JacobKollanukkaran@cavium.com \
--cc=dev@dpdk.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.