From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 279EF212 for ; Thu, 2 Oct 2014 10:05:59 +0200 (CEST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by orsmga103.jf.intel.com with ESMTP; 02 Oct 2014 01:10:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,637,1406617200"; d="scan'208";a="481453662" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by azsmga001.ch.intel.com with ESMTP; 02 Oct 2014 01:12:24 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s928CNs1029726; Thu, 2 Oct 2014 09:12:23 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s928CNln028085; Thu, 2 Oct 2014 09:12:23 +0100 Received: (from smonroy@localhost) by sivswdev02.ir.intel.com with id s928CMrV028081; Thu, 2 Oct 2014 09:12:22 +0100 Date: Thu, 2 Oct 2014 09:12:22 +0100 From: Sergio Gonzalez Monroy To: Tetsuya Mukawa Message-ID: <20141002081221.GA27208@sivswdev02.ir.intel.com> References: <1412137623-18817-1-git-send-email-mukawa@igel.co.jp> <20141001105022.GB21151@hmsreliant.think-freely.org> <3354420.dnXLPNUCVP@xps13> <542CBD05.5000507@igel.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <542CBD05.5000507@igel.co.jp> User-Agent: Mutt/1.5.20 (2009-06-14) 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 08:06:01 -0000 On Thu, Oct 02, 2014 at 11:48:37AM +0900, Tetsuya Mukawa wrote: > (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 message? > > > > 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=gcc > COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper > Target: x86_64-linux-gnu > Configured with: ../src/configure -v --with-pkgversion='Ubuntu > 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs > --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr > --program-suffix=-4.8 --enable-shared --enable-linker-build-id > --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix > --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib > --enable-nls --with-sysroot=/ --enable-clocale=gnu > --enable-libstdcxx-debug --enable-libstdcxx-time=yes > --enable-gnu-unique-object --disable-libmudflap --enable-plugin > --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk > --enable-gtk-cairo > --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre > --enable-java-home > --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 > --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 > --with-arch-directory=amd64 > --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc > --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 > --with-multilib-list=m32,m64,mx32 --with-tune=generic > --enable-checking=release --build=x86_64-linux-gnu > --host=x86_64-linux-gnu --target=x86_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=y > $ T=x86_64-native-linuxapp-gcc make install V=1 > > ....... > > == Build app/test-acl > gcc -Wp,-MD,./.main.o.d.tmp -m64 -pthread -fPIC -march=native > -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=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C > -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=native -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=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C > -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=testacl.map,--cref > -o testacl main.o -Wl,-export-dynamic > -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib > -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=native > -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=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C > -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=native -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=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C > -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=testacl.map,--cref > -o testacl main.o -Wl,-export-dynamic > -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib > -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 > Hi Tetsuya, Would you mind posting the output of the last command adding the option '-v'? Sergio > ---------------------------------------------------------------------- > > 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 library. > Does "--start-group/--end-group" options work with dynamic link libraries? > > Regards, > Tetsuya >