From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by dpdk.org (Postfix) with ESMTP id D417C212 for ; Thu, 2 Oct 2014 04:41:52 +0200 (CEST) Received: by mail-pa0-f51.google.com with SMTP id lj1so1402200pab.38 for ; Wed, 01 Oct 2014 19:48:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=l06aGb+er8QaGdgv20t8cDc+zYGBr9yNF1wfQ9SjMRw=; b=VYky13QinMGKcuEVx8pNf4hy7YuJQwTAipRhtmx1EnfhOsfN8erts9IrDd+zEfFphI K4BcknbsYOUaHEGaV3yjqFK4suM0nQppq1TqxfVYVLUuuomyC3awG2+Ku+iwZHf8cp/7 RPGPkcgM6ut41EfiGm7jnFpm906o0PwOSB0jP4DiMnT+20iEh+QwbzTR0CfGvhQuY8Cg +Bk8dCTZJ/BNustdeBPy46WnGYeXLzzaJvugF7GdYoT1HBx/VES3z6OeanhqzD01XHCI Um723+klTGyq8xycdtBQ+QhfU0fDlI5CwQUuAJi0aXroMbV9zYoHH/81+h41uTbEMR5b oDIw== X-Gm-Message-State: ALoCoQnlDiwxEAXw6bZ31/8UZYJ/1Jh32OE55j2iutNNWROqfLZQP+8A+W9UtP34poRwq2oI4+kT X-Received: by 10.66.142.105 with SMTP id rv9mr47011551pab.88.1412218119883; Wed, 01 Oct 2014 19:48:39 -0700 (PDT) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id hm1sm2111694pdb.84.2014.10.01.19.48.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 19:48:39 -0700 (PDT) Message-ID: <542CBD05.5000507@igel.co.jp> Date: Thu, 02 Oct 2014 11:48:37 +0900 From: Tetsuya Mukawa User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Thomas Monjalon References: <1412137623-18817-1-git-send-email-mukawa@igel.co.jp> <20141001105022.GB21151@hmsreliant.think-freely.org> <3354420.dnXLPNUCVP@xps13> In-Reply-To: <3354420.dnXLPNUCVP@xps13> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] Fix linking errors when CONFIG_RTE_BUILD_SHARED_LIB is enabled X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2014 02:41:53 -0000 (2014/10/01 20:56), Thomas Monjalon wrote: > 2014-10-01 06:50, Neil Horman: >> On Wed, Oct 01, 2014 at 01:27:03PM +0900, mukawa@igel.co.jp wrote: >>> When CONFIG_RTE_BUILD_SHARED_LIB is enabled, linking errors occured >>> while compiling. It seems those errors are caused by wrong link order= >>> of some libraries. The patch fixes it like following. >>> >>> 1. librte_eal >>> 2. librte_malloc >>> 3. librte_mempool >>> 4. librte_ring >>> 5. librte_pmd_bond >>> 6. librte_kvargs >>> >> I'm not sure why thats necesecary. We add a --start-group/--end-group= pair >> halfway through this makefile. If we just encompassed the entire set = of >> libraries in that group, order would be irrelevant. > I don't see any error. > Please Tetsuya, could you describe how you test and what is the error m= essage? > > Thanks Thank you for testing. I have confirmed '--start-group/--end-groups' is specified while compiling, but I am still seeing the error. Here is what I actually did. ---------------------------------------------------------------------- << Show my environment >> $ uname -a Linux eris 3.13.0-29-generic #53-Ubuntu SMP Wed Jun 4 21:00:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.1 LTS Release: 14.04 Codename: trusty $ gcc -v Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Ubuntu 4.8.2-19ubuntu1' --with-bugurl=3Dfile:///usr/share/doc/gcc-4.8/README.Bug= s --enable-languages=3Dc,c++,java,go,d,fortran,objc,obj-c++ --prefix=3D/usr= --program-suffix=3D-4.8 --enable-shared --enable-linker-build-id --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dpos= ix --with-gxx-include-dir=3D/usr/include/c++/4.8 --libdir=3D/usr/lib --enable-nls --with-sysroot=3D/ --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable-libstdcxx-time=3Dyes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=3Dgtk --enable-gtk-cairo --with-java-home=3D/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=3D/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=3D/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=3Damd64 --with-ecj-jar=3D/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=3Di686 --with-abi=3Dm6= 4 --with-multilib-list=3Dm32,m64,mx32 --with-tune=3Dgeneric --enable-checking=3Drelease --build=3Dx86_64-linux-gnu --host=3Dx86_64-linux-gnu --target=3Dx86_64-linux-gnu Thread model: posix gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) << Compile DPDK >> $ git clone git://dpdk.org/dpdk $ cd dpdk $ vi config/common_linuxapp CONFIG_RTE_BUILD_SHARED_LIB=3Dy $ T=3Dx86_64-native-linuxapp-gcc make install V=3D1 =2E...... =3D=3D Build app/test-acl gcc -Wp,-MD,./.main.o.d.tmp -m64 -pthread -fPIC -march=3Dnative -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_F16C -DRTE_COMPILE_TIME_CPUFLAGS=3DRTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLA= G_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLA= G_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C=20 -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -o main.o -c /home/mukawa/tmp/dpdk/app/test-acl/main.c gcc -m64 -pthread -fPIC -march=3Dnative -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_F16C -DRTE_COMPILE_TIME_CPUFLAGS=3DRTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLA= G_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLA= G_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C=20 -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wl,-Map=3Dtestacl.map,--cref -o testacl main.o -Wl,-export-dynamic -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib=20 -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt -Wl,-lm -Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so: undefined reference to `rte_mempool_lookup' /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so: undefined reference to `rte_mempool_create' << Reproduce the issue with same options >> $ cd x86_64-native-linuxapp-gcc/build/app/test-acl/ $ gcc -Wp,-MD,./.main.o.d.tmp -m64 -pthread -fPIC -march=3Dnative -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_F16C -DRTE_COMPILE_TIME_CPUFLAGS=3DRTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLA= G_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLA= G_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C=20 -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -o main.o -c /home/mukawa/tmp/dpdk/app/test-acl/main.c mukawa@eris:~/tmp/dpdk/x86_64-native-linuxapp-gcc/build/app/test-acl$ gcc -m64 -pthread -fPIC -march=3Dnative -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_F16C -DRTE_COMPILE_TIME_CPUFLAGS=3DRTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLA= G_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLA= G_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C=20 -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wl,-Map=3Dtestacl.map,--cref -o testacl main.o -Wl,-export-dynamic -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib=20 -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt -Wl,-lm -Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so: undefined reference to `rte_mempool_lookup' /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so: undefined reference to `rte_mempool_create' collect2: error: ld returned 1 exit status ---------------------------------------------------------------------- I just enabled the following option, then compile DPDK. CONFIG_RTE_BUILD_SHARED_LIB Is this collect to compile PMDs as dynamic link libraries? With the option, all libraries include are compiled as dynamic link libra= ry. Does "--start-group/--end-group" options work with dynamic link libraries= ? Regards, Tetsuya