[dpdk-dev] [PATCH] event/octeontx: fix clang 6 linker error
Jerin Jacob
jerin.jacob at caviumnetworks.com
Wed May 9 03:53:08 CEST 2018
-----Original Message-----
> Date: Wed, 9 May 2018 02:56:00 +0530
> From: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> To: jerin.jacob at caviumnetworks.com, santosh.shukla at caviumnetworks.com,
> arybchenko at solarflare.com
> Cc: dev at dpdk.org, Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH] event/octeontx: fix clang 6 linker error
> X-Mailer: git-send-email 2.17.0
>
> 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 at solarflare.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
> ---
> drivers/event/octeontx/timvf_evdev.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h
> index b1b2a8464..1cac1e612 100644
> --- a/drivers/event/octeontx/timvf_evdev.h
> +++ b/drivers/event/octeontx/timvf_evdev.h
> @@ -145,7 +145,7 @@ struct tim_mem_bucket {
> };
> uint64_t current_chunk;
> uint64_t pad;
> -} __rte_packed;
> +} __rte_packed __rte_aligned(8);
>
> struct tim_mem_entry {
> uint64_t w0;
> --
> 2.17.0
>
More information about the dev
mailing list