So I think I have a fix for this issue.
I'm not a compiler/linker expert but basically LD complains when we try to make all symbols (including symbols in SW crypto library archive) public. The following patch fixes the issue by telling the compiler to not export symbols from the crypto library archives:
https://gerrit.fd.io/r/#/c/5650/

Thanks,
Sergio

On 06/03/2017 19:37, Billy McFall wrote:
Let me know if you need anything else from me. I'll be glad to test something if need be.

As a side note, what is the recommended version of nasm? I tested with nasm 2.12.02 on Fedora 25 and nasm 2.12.01 and 2.12.02 on Centos 7.3 and all have the error I reported.

The version of nasm in Centos 7.3 distro is nasm 2.10.07, and it has a different compiler error. Googled this issue and I found a link that indicated this was fixed in a newer version of nasm, which lead me to the nasm 2.12.02 build.
  Making object file obj/mb_mgr_hmac_submit_avx512.o
nasm -o obj/mb_mgr_hmac_submit_avx512.o -felf64 -Xgnu -gdwarf -DLINUX -D__linux__ -Iinclude/ -I./ -Iavx/ -Iavx2/ -Iavx512/ -Isse/ avx512/mb_mgr_hmac_submit_avx512.asm avx512/mb_mgr_hmac_submit_avx512.asm:173: error: parser: instruction expected avx512/mb_mgr_hmac_submit_avx512.asm:174: error: symbol `vmovdqu32' redefined avx512/mb_mgr_hmac_submit_avx512.asm:174: error: parser: instruction expected
  make[4]: *** [obj/mb_mgr_hmac_submit_avx512.o] Error 1

Thanks,
Billy McFall

On Mon, Mar 6, 2017 at 11:30 AM, Sergio Gonzalez Monroy <sergio.gonzalez.mon...@intel.com <mailto:sergio.gonzalez.mon...@intel.com>> wrote:

    Hi Billy,

    It seems that things have changed a bit since DPDK is built as a
    plugin and we are looking into this issue.

    I'll update once I have more details.

    Regards,
    Sergio

    On 03/03/2017 16:59, Billy McFall wrote:
    Like the original email on this thread, I am trying to build
    latest vpp with vpp_uses_dpdk_cryptodev_sw = yes option to enable
    vpp sw crypto. The difference is I am running on Fedora 25. I
    attempted to followed the suggestions in this email chain:
    * I updated /build-data/platforms/vpp.mk <http://vpp.mk> with
     "-Wl,--whole-archive,-l:libIPSec_MB.a,--no-whole-archive" and
    copied libIPSec_MB.a into /usr/lib/.
    * I set link_all_deplibs to yes
    in vpp/build-root/build-vpp-native/dpdk/isa-l_crypto-master/aclocal.m4
    after running 'make bootstrap', which set it in
    vpp/build-root/build-vpp-native/vpp/libtool.

    If anyone has instructions on how to update libtool from source,
    I will attempt that.


    Below is the error I am seeing:

    make[3]: Entering directory
    
'/home/bmcfall/dev/2017_03_03_VPP_Master/vpp/build-root/build-vpp-native/vpp'
      CCLD libvppinfra.la <http://libvppinfra.la>
    /usr/bin/ld:
    
/home/bmcfall/dev/2017_03_03_VPP_Master/vpp/build-root/install-vpp-native/dpdk/lib/libIPSec_MB.a(aes128_cntr_by4_sse.o):
    relocation R_X86_64_PC32 against symbol `byteswap_const' can not
    be used when making a shared object; recompile with -fPIC
    /usr/bin/ld: final link failed: Bad value
    collect2: error: ld returned 1 exit status
    Makefile:4564: recipe for target 'libvppinfra.la
    <http://libvppinfra.la>' failed
    make[3]: *** [libvppinfra.la <http://libvppinfra.la>] Error 1


    I am also seeing a lot of warnings when the dpdk/crypto is being
    built (this is just a snippet, I am seeing a lot more):

    make[4]: Entering directory
    
'/home/bmcfall/dev/2017_03_03_VPP_Master/vpp/build-root/build-vpp-native/dpdk/isa-l_crypto-master'
    Building isa-l_crypto.h
    make --no-print-directory all-am
      CC md5_mb/md5_ctx_sse.lo
      CC md5_mb/md5_ctx_avx.lo
      CC md5_mb/md5_ctx_avx2.lo
      CC md5_mb/md5_mb_mgr_init_sse.lo
      CC md5_mb/md5_mb_mgr_init_avx2.lo
      CC md5_mb/md5_mb_mgr_init_avx512.lo
      MKTMP  md5_mb/md5_mb_mgr_submit_sse.s
      CCAS md5_mb/md5_mb_mgr_submit_sse.lo
    md5_mb/md5_mb_mgr_submit_sse.s:151: warning: absolute address can
    not be RIP-relative
      MKTMP  md5_mb/md5_mb_mgr_submit_avx.s
      CCAS md5_mb/md5_mb_mgr_submit_avx.lo
    md5_mb/md5_mb_mgr_submit_avx.s:150: warning: absolute address can
    not be RIP-relative
      MKTMP  md5_mb/md5_mb_mgr_submit_avx2.s
      CCAS md5_mb/md5_mb_mgr_submit_avx2.lo
    md5_mb/md5_mb_mgr_submit_avx2.s:159: warning: absolute address
    can not be RIP-relative
      MKTMP  md5_mb/md5_mb_mgr_flush_sse.s
      CCAS md5_mb/md5_mb_mgr_flush_sse.lo
    md5_mb/md5_mb_mgr_flush_sse.s:119: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_sse.s:121: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_sse.s:123: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_sse.s:125: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_sse.s:127: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_sse.s:129: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_sse.s:131: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_sse.s:164: warning: absolute address can
    not be RIP-relative
      MKTMP  md5_mb/md5_mb_mgr_flush_avx.s
      CCAS md5_mb/md5_mb_mgr_flush_avx.lo
    md5_mb/md5_mb_mgr_flush_avx.s:119: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_avx.s:121: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_avx.s:123: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_avx.s:125: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_avx.s:127: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_avx.s:129: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_avx.s:131: warning: absolute address can
    not be RIP-relative
    md5_mb/md5_mb_mgr_flush_avx.s:163: warning: absolute address can
    not be RIP-relative
    :
      CCAS md5_mb/md5_mb_x4x2_sse.lo
    md5_mb/md5_mb_x4x2_sse.s:361: warning: absolute address can not
    be RIP-relative
    md5_mb/md5_mb_x4x2_sse.s:539: warning: absolute address can not
    be RIP-relative
    md5_mb/md5_mb_x4x2_sse.s:162: ... from macro `MD5_STEP1' defined here
    md5_mb/md5_mb_x4x2_sse.s:120: ... from macro `MAGIC_I' defined here
    md5_mb/md5_mb_x4x2_sse.s:539: warning: absolute address can not
    be RIP-relative
    md5_mb/md5_mb_x4x2_sse.s:164: ... from macro `MD5_STEP1' defined here
    md5_mb/md5_mb_x4x2_sse.s:120: ... from macro `MAGIC_I' defined here
    md5_mb/md5_mb_x4x2_sse.s:540: warning: absolute address can not
    be RIP-relative
    md5_mb/md5_mb_x4x2_sse.s:162: ... from macro `MD5_STEP1' defined here
    md5_mb/md5_mb_x4x2_sse.s:120: ... from macro `MAGIC_I' defined here
    :

    Any suggestions would be greatly appreciated,
    Billy McFall

    On Fri, Feb 24, 2017 at 7:03 AM, yusuf khan
    <yusuf.at...@gmail.com <mailto:yusuf.at...@gmail.com>> wrote:

        Hi All,

        As Radu suggested, after updating libtool from source it
        works fine.

        Thanks a lot everyone.

        Br
        Yusuf

        On 24-Feb-2017 1:49 PM, "Chen, Zhaoyan"
        <zhaoyan.c...@intel.com <mailto:zhaoyan.c...@intel.com>> wrote:

            Met the same issue.

            Vpp uses its “libtool” under
            “./build-root/build-vpp-native/vpp/libtool” (version is
            2.4.6)

            Quickly workaround is that modify this libtool,
            “link_all_deplibs=no” => “link_all_deplibs=yes”

            Then “make run-release” again.

            Tested under Ubuntu 16.04, in VM.

            /Zhaoyan

            *From:*vpp-dev-boun...@lists.fd.io
            <mailto:vpp-dev-boun...@lists.fd.io>
            [mailto:vpp-dev-boun...@lists.fd.io
            <mailto:vpp-dev-boun...@lists.fd.io>] *On Behalf Of
            *Nicolau, Radu
            *Sent:* Thursday, February 23, 2017 6:06 PM
            *To:* Tkachuk, Georgii <georgii.tkac...@intel.com
            <mailto:georgii.tkac...@intel.com>>; Lu, Patrick
            <patrick...@intel.com <mailto:patrick...@intel.com>>;
            yusuf khan <yusuf.at...@gmail.com
            <mailto:yusuf.at...@gmail.com>>; vpp-dev@lists.fd.io
            <mailto:vpp-dev@lists.fd.io>
            *Subject:* Re: [vpp-dev] dpdk sw crypto- build error

            If the issue appears on Ubuntu and other Debian based
            distros then the root of the problem is libtool, which is
            patched to set link_all_deplibs=no in the libtool script,
            effectively making libtool ignore library dependencies –
            the dependency_libs section in the .la files.

            A quick workaround is to install libtool from sources.

            Regards,

            Radu

            *From:*vpp-dev-boun...@lists.fd.io
            <mailto:vpp-dev-boun...@lists.fd.io>
            [mailto:vpp-dev-boun...@lists.fd.io
            <mailto:vpp-dev-boun...@lists.fd.io>] *On Behalf Of
            *Tkachuk, Georgii
            *Sent:* Wednesday, February 22, 2017 6:10 PM
            *To:* Lu, Patrick <patrick...@intel.com
            <mailto:patrick...@intel.com>>; yusuf khan
            <yusuf.at...@gmail.com <mailto:yusuf.at...@gmail.com>>;
            vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>
            *Subject:* Re: [vpp-dev] dpdk sw crypto- build error

            We worked around this by adding extra compile flags to
            prevent the IPSec lib from being stripped from the
            compiler command:

            Also, we proactively placed the libIPSec_MB.a into
            /usr/lib/. so that we don’t have to provide the path.

            diff --git a/build-data/platforms/vpp.mk <http://vpp.mk>
            b/build-data/platforms/vpp.mk <http://vpp.mk>

            index 401a383..b5b2369 100644

            --- a/build-data/platforms/vpp.mk <http://vpp.mk>

            +++ b/build-data/platforms/vpp.mk <http://vpp.mk>

            @@ -54,7 +54,7 @@ vpp_debug_TAG_LDFLAGS = -g -O0
            -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \

            -fstack-protector-all -fPIC -Werror

             vpp_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2
            -march=$(MARCH) -mtune=$(MTUNE) \

            - -fstack-protector -fPIC -Werror

            + -fstack-protector -fPIC -Werror
            -Wl,--whole-archive,-l:libIPSec_MB.a,--no-whole-archive

             vpp_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2
            -march=$(MARCH) -mtune=$(MTUNE) \

            -fstack-protector -fPIC -Werror

            If you don’t want to modify the vpp.mk <http://vpp.mk> it
            should also be possible to add the change to the vpp by
            guarding the IPSec lib as above in this bit:

            if WITH_DPDK_CRYPTO_SW

            DPDK_LD_ADD = -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB

            endif

            Regards,

            George

            *From:*Lu, Patrick
            *Sent:* Wednesday, February 22, 2017 11:02 AM
            *To:* yusuf khan <yusuf.at...@gmail.com
            <mailto:yusuf.at...@gmail.com>>; vpp-dev@lists.fd.io
            <mailto:vpp-dev@lists.fd.io>
            *Cc:* Tkachuk, Georgii <georgii.tkac...@intel.com
            <mailto:georgii.tkac...@intel.com>>
            *Subject:* RE: [vpp-dev] dpdk sw crypto- build error

            Hi Yusuf,

            We saw the same issue. Copying George for workaround.

            Thanks,

            Patrick

            *From:*vpp-dev-boun...@lists.fd.io
            <mailto:vpp-dev-boun...@lists.fd.io>
            [mailto:vpp-dev-boun...@lists.fd.io
            <mailto:vpp-dev-boun...@lists.fd.io>] *On Behalf Of
            *yusuf khan
            *Sent:* Wednesday, February 22, 2017 8:50 AM
            *To:* vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>
            *Subject:* [vpp-dev] dpdk sw crypto- build error

            Hi,

            I am trying to build latest vpp with
            vpp_uses_dpdk_cryptodev_sw = yes option to enable vpp sw
            crypto.

            Initilia steps of downloading/compiling aesni-mb and
            isal-crypto works fine.

            But during linking stage i am getting below errors...

            CCLD bin/vpp
              CCLD     vpp_api_test
              CCLD     pcap2pg
            ./.libs/libvnet.so: undefined reference to
            `aesni_gcm256_init'
            ./.libs/libvnet.so: undefined reference to
            `aes_xcbc_expand_key_avx'
            ./.libs/libvnet.so: undefined reference to `submit_job_sse'
            ./.libs/libvnet.so: undefined reference to
            `sha1_one_block_sse'
            ./.libs/libvnet.so: undefined reference to `flush_job_avx2'
            ./.libs/libvnet.so: undefined reference to
            `sha512_one_block_avx'
            ./.libs/libvnet.so: undefined reference to
            `aesni_gcm256_dec_finalize'
            ./.libs/libvnet.so: undefined reference to
            `aesni_gcm128_enc_update'
            ./.libs/libvnet.so: undefined reference to `aesni_gcm128_pre'
            ./.libs/libvnet.so: undefined reference to
            `sha1_one_block_avx'
            ./.libs/libvnet.so: undefined reference to
            `sha256_one_block_sse'
            ./.libs/libvnet.so: undefined reference to
            `aes_xcbc_expand_key_sse'
            ./.libs/libvnet.so: undefined reference to
            `sha224_one_block_avx'
            ./.libs/libvnet.so: undefined reference to
            `sha256_one_block_avx'
            ./.libs/libvnet.so: undefined reference to `init_mb_mgr_avx2'
            ./.libs/libvnet.so: undefined reference to
            `aesni_gcm128_init'
            ./.libs/libvnet.so: undefined reference to
            `sha384_one_block_sse'
            ./.libs/libvnet.so: undefined reference to `submit_job_avx2'
            ./.libs/libvnet.so: undefined reference to
            `aesni_gcm256_dec_update'
            ./.libs/libvnet.so: undefined reference to `flush_job_avx'
            ./.libs/libvnet.so: undefined reference to
            `submit_job_avx512'
            ./.libs/libvnet.so: undefined reference to
            `aes_keyexp_256_avx'
            ./.libs/libvnet.so: undefined reference to
            `aesni_gcm128_dec_finalize'
            ./.libs/libvnet.so: undefined reference to
            `aes_keyexp_192_avx'
            ./.libs/libvnet.so: undefined reference to `init_mb_mgr_sse'
            ./.libs/libvnet.so: undefined reference to
            `aes_keyexp_256_sse'
            ./.libs/libvnet.so: undefined reference to
            `aesni_gcm256_enc_finalize'
            ./.libs/libvnet.so: undefined reference to `init_mb_mgr_avx'
            ./.libs/libvnet.so: undefined reference to
            `aes_keyexp_128_sse'
            ./.libs/libvnet.so: undefined reference to
            `sha512_one_block_sse'
            ./.libs/libvnet.so: undefined reference to
            `aes_keyexp_128_avx'
            ./.libs/libvnet.so: undefined reference to
            `init_mb_mgr_avx512'
            ./.libs/libvnet.so: undefined reference to
            `aesni_gcm128_dec_update'
            ./.libs/libvnet.so: undefined reference to `flush_job_avx512'
            ./.libs/libvnet.so: undefined reference to
            `sha384_one_block_avx'
            ./.libs/libvnet.so: undefined reference to
            `sha224_one_block_sse'
            ./.libs/libvnet.so: undefined reference to
            `md5_one_block_sse'
            ./.libs/libvnet.so: undefined reference to
            `aesni_gcm256_enc_update'
            ./.libs/libvnet.so: undefined reference to
            `aesni_gcm128_enc_finalize'
            ./.libs/libvnet.so: undefined reference to `aesni_gcm256_pre'
            ./.libs/libvnet.so: undefined reference to
            `aes_keyexp_192_sse'
            ./.libs/libvnet.so: undefined reference to `submit_job_avx'
            ./.libs/libvnet.so: undefined reference to `flush_job_sse'
            collect2: error: ld returned 1 exit status
            Makefile:4651: recipe for target 'bin/vpp' failed

            Most probably libvnet links with some dpdk.a , which
            inturn links to aes*-crypto libs but its undefined.

            I tried nm on
            build-root/install-vpp-native/dpdk/lib/librte_pmd_aesni_gcm.a
            and i get same undefined .

            root@VPP:~/sample/vpp# nm
            build-root/install-vpp-native/dpdk/lib/librte_pmd_aesni_gcm.a
            |grep U
                             U aesni_gcm128_dec_finalize
                             U aesni_gcm128_dec_update
                             U aesni_gcm128_enc_finalize
                             U aesni_gcm128_enc_update
                             U aesni_gcm128_init
                             U aesni_gcm128_pre
                             U aesni_gcm256_dec_finalize
                             U aesni_gcm256_dec_update
                             U aesni_gcm256_enc_finalize
                             U aesni_gcm256_enc_update
                             U aesni_gcm256_init
                             U aesni_gcm256_pre

            Let me know if this is known issue?

            BTW i am building on ubuntu xenial native, no vm.

            Br,

            Yusuf


        _______________________________________________
        vpp-dev mailing list
        vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>
        https://lists.fd.io/mailman/listinfo/vpp-dev
        <https://lists.fd.io/mailman/listinfo/vpp-dev>




    _______________________________________________
    vpp-dev mailing list
    vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>
    https://lists.fd.io/mailman/listinfo/vpp-dev
    <https://lists.fd.io/mailman/listinfo/vpp-dev>

    _______________________________________________ vpp-dev mailing
    list vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>
    https://lists.fd.io/mailman/listinfo/vpp-dev
<https://lists.fd.io/mailman/listinfo/vpp-dev>
_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to