[dpdk-dev] mk: fix build of assembly files for ARM64
diff mbox

Message ID 1484663736-32195-1-git-send-email-zbigniew.bodek@caviumnetworks.com
State Changes Requested, archived
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

zbigniew.bodek@caviumnetworks.com Jan. 17, 2017, 2:35 p.m. UTC
From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>

Avoid using incorrect assembler (nasm) and unsupported flags
when building for ARM64.

Fixes: af75078fece3 ("first public release")
Fixes: b3ce00e5fe36 ("mk: introduce ARMv8 architecture")

Signed-off-by: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 mk/arch/arm64/rte.vars.mk    | 1 -
 mk/toolchain/gcc/rte.vars.mk | 6 ++++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Thomas Monjalon Jan. 17, 2017, 10:45 p.m. UTC | #1
2017-01-17 15:35, zbigniew.bodek@caviumnetworks.com:
> -# for now, we don't use as but nasm.
> -# AS      = $(CROSS)as

It looks to be a very very old comment.

> +ifeq ($(CONFIG_RTE_ARCH_X86),y)
>  AS        = nasm

There is no asm file in DPDK as far as I know.
So why would we have a dependency on nasm for x86?

> +else
> +AS        = $(CROSS)as
> +endif
zbigniew.bodek@caviumnetworks.com Jan. 18, 2017, 11:31 a.m. UTC | #2
On 17.01.2017 23:45, Thomas Monjalon wrote:
> 2017-01-17 15:35, zbigniew.bodek@caviumnetworks.com:
>> -# for now, we don't use as but nasm.
>> -# AS      = $(CROSS)as
>
> It looks to be a very very old comment.
>
>> +ifeq ($(CONFIG_RTE_ARCH_X86),y)
>>  AS        = nasm
>
> There is no asm file in DPDK as far as I know.
> So why would we have a dependency on nasm for x86?

Yes, there is no such file now. We were to add assembly code but 
eventually we decided to put it in a separate library. Nevertheless this 
fix should be harmless if there is no ASM file and will behave correctly 
if someone will add ASM file in the future.

>
>> +else
>> +AS        = $(CROSS)as
>> +endif
>
Thomas Monjalon Jan. 27, 2017, 4:20 p.m. UTC | #3
2017-01-18 12:31, Zbigniew Bodek:
> 
> On 17.01.2017 23:45, Thomas Monjalon wrote:
> > 2017-01-17 15:35, zbigniew.bodek@caviumnetworks.com:
> >> -# for now, we don't use as but nasm.
> >> -# AS      = $(CROSS)as
> >
> > It looks to be a very very old comment.
> >
> >> +ifeq ($(CONFIG_RTE_ARCH_X86),y)
> >>  AS        = nasm
> >
> > There is no asm file in DPDK as far as I know.
> > So why would we have a dependency on nasm for x86?
> 
> Yes, there is no such file now. We were to add assembly code but 
> eventually we decided to put it in a separate library. Nevertheless this 
> fix should be harmless if there is no ASM file and will behave correctly 
> if someone will add ASM file in the future.

Please remove the ifeq and keep only $(CROSS)as as below.

> >> +else
> >> +AS        = $(CROSS)as
> >> +endif
> >

Patch
diff mbox

diff --git a/mk/arch/arm64/rte.vars.mk b/mk/arch/arm64/rte.vars.mk
index c168426..3b1178a 100644
--- a/mk/arch/arm64/rte.vars.mk
+++ b/mk/arch/arm64/rte.vars.mk
@@ -53,7 +53,6 @@  CROSS ?=
 
 CPU_CFLAGS  ?=
 CPU_LDFLAGS ?=
-CPU_ASFLAGS ?= -felf
 
 export ARCH CROSS CPU_CFLAGS CPU_LDFLAGS CPU_ASFLAGS
 
diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index ff70f3d..94f6412 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -41,9 +41,11 @@ 
 CC        = $(CROSS)gcc
 KERNELCC  = $(CROSS)gcc
 CPP       = $(CROSS)cpp
-# for now, we don't use as but nasm.
-# AS      = $(CROSS)as
+ifeq ($(CONFIG_RTE_ARCH_X86),y)
 AS        = nasm
+else
+AS        = $(CROSS)as
+endif
 AR        = $(CROSS)ar
 LD        = $(CROSS)ld
 OBJCOPY   = $(CROSS)objcopy