[yocto] gcc: issue in make a src.rpm
Hi, I found that Poky can not create gcc/gcc-runtime/libgcc src.rpm package correctly while other middles are OK. In my case: [lizj@suika build-poky-1.5]$cat EOF local/local.conf INHERIT += archive-patched-source SOURCE_ARCHIVE_PACKAGE_TYPE = srpm EOF [lizj@suika build-poky-1.5]$ bitbake gcc gcc-runtime libgcc WARNING: Host distribution CentOS-6.3 has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution. Loading cache: 100% || ETA: 00:00:00 Loaded 1187 entries from dependency cache. NOTE: Resolving any missing task queue dependencies Build Configuration: BB_VERSION= 1.20.0 BUILD_SYS = x86_64-linux NATIVELSBSTRING = CentOS-6.3 TARGET_SYS= x86_64-poky-linux MACHINE = qemux86-64 DISTRO= poky DISTRO_VERSION= 1.5 TUNE_FEATURES = m64 TARGET_FPU= meta meta-yocto meta-yocto-bsp= (detachedfromyocto-1.5):102bf5e0f640fe85068452a42b85077f1c81e0c9 ... [lizj@suika build-poky-1.5]$ ls -sh tmp/deploy/sources/deploy-srpm/x86_64/GPL-3.0-with-GCC-exceptionGPL-3.0/ total 32K 12K gcc-4.8.1-r0.src.rpm 12K gcc-runtime-4.8.1-r0.src.rpm 8.0K libgcc-4.8.1-r0.src.rpm In these src.rpm packages, they don't contain any source code, only one spec file in bb file of gcc, it set S to a work-shard directory so that when doing archive_patched_sources and package_write_rpm, no any source code is found at WORK_DIR. Any help or ideas? -- Best regards. Li Zhijian gcc.spec file don't contain line of Source [lizj@suika build-poky-1.5]$ cat tmp/work/x86_64-poky-linux/gcc/4.8.1-r0/gcc.spec Summary: gcc version 4.8.1-r0 Name: gcc Version: 4.8.1 Release: r0 License: GPL-3.0-with-GCC-exception GPLv3 Group: devel Packager: Poky p...@yoctoproject.org URL: http://www.gnu.org/software/gcc/ BuildRequires: libtool-cross BuildRequires: autoconf-native BuildRequires: libtool-native BuildRequires: libmpc BuildRequires: virtual/gettext BuildRequires: zlib BuildRequires: gettext-native BuildRequires: gnu-config-native BuildRequires: virtual/libc BuildRequires: virtual/x86_64-poky-linux-compilerlibs BuildRequires: gmp BuildRequires: virtual/x86_64-poky-linux-gcc BuildRequires: automake-native BuildRequires: mpfr Requires: rtld(GNU_HASH) Requires: libc.so.6(GLIBC_2.3)(64bit) Requires: libc.so.6(GLIBC_2.14)(64bit) Requires: libc.so.6(GLIBC_2.11)(64bit) Requires: libmpfr.so.4()(64bit) Requires: libmpfr4 = 3.1.2 Requires: libdl.so.2(GLIBC_2.2.5)(64bit) Requires: ld-linux-x86-64.so.2(GLIBC_2.3)(64bit) Requires: libdl.so.2()(64bit) Requires: libz1 = 1.2.8 Requires: libgmp10 = 5.1.1 Requires: libc.so.6()(64bit) Requires: libc.so.6(GLIBC_2.2.5)(64bit) Requires: libgmp.so.10()(64bit) Requires: libmpc.so.3()(64bit) Requires: ld-linux-x86-64.so.2()(64bit) Requires: libc6 = 2.18 Requires: libmpc3 = 1.0.1 Requires: libz.so.1()(64bit) Requires: libc.so.6(GLIBC_2.7)(64bit) Provides: liblto_plugin.so.0()(64bit) Provides: elf(buildid) = a346e9df7f420d6155dfa7e7215bf2e372410fe9 Provides: elf(buildid) = 4225e548430e0f28257607257c816df8225fdef5 Provides: elf(buildid) = f5bb275a50a33985fceeb7e80b7ff61c7a0e05e4 Provides: elf(buildid) = 16e2894befe569c06528ce518e83cf0630960d5b Provides: elf(buildid) = 714d3a4ab86a9b71533cd7cd045e14a1e50faf81 Provides: elf(buildid) = d1d156cfcefe49da86f3dd9a7e24127531abe0a0 Provides: elf(buildid) = 74a8dedc49fcc62fb4d57ba1c3ff8b7959ae6c3a Provides: elf(buildid) = 066a7eea7b44fe55d6e22c5003ddf0966e6176e2 Provides: elf(buildid) = c8b459e71bca7d0c835cbf6a8743505ddc80d44c Provides: elf(buildid) = 23f5e0a856a11eb409f006f4f3a314e462ac1b9b %description The GNU cc and gcc C compilers. %package -n gcc-plugins Summary: gcc version 4.8.1-r0 Group: devel %description -n gcc-plugins The GNU cc and gcc C compilers. %package -n gcc-symlinks Summary: gcc version 4.8.1-r0 Group: devel Requires: gcc %description -n gcc-symlinks The GNU cc and gcc C compilers. %package -n g++ Summary: gcc version 4.8.1-r0 Group: devel Requires: rtld(GNU_HASH) Requires: libc.so.6(GLIBC_2.3)(64bit) Requires: libc.so.6(GLIBC_2.14)(64bit) Requires: libc6 = 2.18 Requires: ld-linux-x86-64.so.2(GLIBC_2.3)(64bit) Requires: libc.so.6(GLIBC_2.11)(64bit) Requires: libc.so.6(GLIBC_2.2.5)(64bit) Requires: ld-linux-x86-64.so.2()(64bit) Requires: libc.so.6()(64bit) Provides: elf(buildid) = 62b3649b33ea4c096abbf228942f3d4ff0590937 %description -n g++ The GNU cc and gcc C compilers. %package -n g++-symlinks Summary: gcc version 4.8.1-r0 Group: devel Requires: g++ %description -n g++-symlinks The GNU cc and gcc C compilers. %package -n cpp Summary: gcc version 4.8.1-r0 Group: devel Requires: rtld(GNU_HASH) Requires: libc.so.6(GLIBC_2.3)(64bit) Requires: libc.so.6(GLIBC_2.14)(64bit) Requires: libc6 = 2.18 Requires: ld-linux-x86-64.so.2(GLIBC_2.3)(64bit) Requires: libc.so.6(GLIBC_2.11)(64bit
Re: [yocto] [poky] Is this a bug of binutils
Hi,Laurentiu I think it could be something wrong with binutils(2.23.1 or later) there is different behavior at binutils-2.23.1/ld/ldfile.c(ldfile_open_file_search) from binutils-2.22 If both --sysroot directory and -L directory include libc.so , ld don't work In my case, there are double libc.so(/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-poky-linux/usr/lib/libc.so and tmp/sysroots/qemux86-64/usr/lib/libc.so) ld will link tmp/sysroots/qemux86-64/usr/lib/libc.so(ld always searchs -L directory at first) then link /lib/libc.so.6 specified at tmp/sysroots/qemux86-64/usr/lib/libc.so instead of append sysroot directory path before /lib/libc.so.6 here is a sample method reproduce it lizj@suika x86-64-yocto-1.3]$ source toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux [lizj@suika x86-64-yocto-1.3]$ echo $CC x86_64-poky-linux-gcc -m64 --sysroot=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-poky-linux [lizj@suika x86-64-yocto-1.3]$ $LD --version GNU ld (GNU Binutils) 2.23.1.20121113 [lizj@suika x86-64-yocto-1.3]$ mkdir -p fake_rootfs/usr/lib [lizj@suika x86-64-yocto-1.3]$ cp /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-poky-linux/usr/lib/libc.so fake_rootfs/usr/lib/ [lizj@suika x86-64-yocto-1.3]$ ls fake_rootfs/usr/lib/ libc.so [lizj@suika x86-64-yocto-1.3]$ $CC -o test test.c -L ./fake_rootfs/usr/lib/ test.c: In function 'main': test.c:3:9: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default] /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6 /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: cannot find /lib/libc.so.6 /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: cannot find /usr/lib/libc_nonshared.a collect2: error: ld returned 1 exit status - It seems that ld don‘t really reasonable to do like that,which binutils-2.22 can handle correctly Does poky mind this behavior 以上 -- Best regards. Li Zhijian at 2013-9-20 19:00, Laurentiu Palcu wrote: Hi, On Fri, Sep 20, 2013 at 06:25:19PM +0800, Li Zhijian wrote: III) compile a simple C program # cat test.c int main () { printf(hello world\n); return 0; } # source toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux # $CC -o test test.c -L tmp/sysroots/qemux86-64/usr/lib/ -lm OK, it looks like something strange happens in your setup. To debug it, let's add '-Wl,--verbose' at the end of your command and you should be able to see where the linker is looking for libraries. Also, the linker script will be printed. You should see it try your directory first tmp/sysroots/qemux86-64/usr/lib/, and then fall through the default ones with the sysroot prefix added and, at the end, the system ones: /lib:/usr/lib. Thanks, Laurentiu ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] [poky] Is this a bug of binutils
at 2013-9-20 19:00, Laurentiu Palcu wrote: Hi, On Fri, Sep 20, 2013 at 06:25:19PM +0800, Li Zhijian wrote: III) compile a simple C program # cat test.c int main () { printf(hello world\n); return 0; } # source toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux # $CC -o test test.c -L tmp/sysroots/qemux86-64/usr/lib/ -lm OK, it looks like something strange happens in your setup. To debug it, let's add '-Wl,--verbose' at the end of your command and you should be able to see where the linker is looking for libraries. Also, the linker script will be printed. You should see it try your directory first tmp/sysroots/qemux86-64/usr/lib/, and then fall through the default ones with the sysroot prefix added and, at the end, the system ones: /lib:/usr/lib. Thanks, Laurentiu First,in this case [lizj@suika x86-64-yocto-1.3]$ source toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux [lizj@suika x86-64-yocto-1.3]$ echo $CC x86_64-poky-linux-gcc -m64 --sysroot=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-poky-linux [lizj@suika x86-64-yocto-1.3]$ $CC -o test test.c -L tmp/sysroots/qemux86-64/usr/lib/ -lm -Wl,--verbose test.c: In function 'main': test.c:3:9: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default] GNU ld (GNU Binutils) 2.23.1.20121113 Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om using internal linker script: == /* Script for -z combreloc: combine and sort reloc sections */ OUTPUT_FORMAT(elf64-x86-64, elf64-x86-64, elf64-x86-64) OUTPUT_ARCH(i386:x86-64) ENTRY(_start) SEARCH_DIR(/opt/poky/1.3+snapshot/sysroots/x86_64-pokysdk-linux/usr/x86_64-poky-linux/lib64); SEARCH_DIR(=/usr/local/lib64); SEARCH_DIR(=/lib64); SEARCH_DIR(=/usr/lib64); SEARCH_DIR(=/usr/local/lib); SEARCH_DIR(=/lib); SEARCH_DIR(=/usr/lib); SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = SEGMENT_START(text-segment, 0x40)); . = SEGMENT_START(text-segment, 0x40) + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } .gnu.version: { *(.gnu.version) } .gnu.version_d : { *(.gnu.version_d) } .gnu.version_r : { *(.gnu.version_r) } .rela.dyn : { *(.rela.init) *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) *(.rela.fini) *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) *(.rela.ctors) *(.rela.dtors) *(.rela.got) *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) *(.rela.ifunc) } .rela.plt : { *(.rela.plt) PROVIDE_HIDDEN (__rela_iplt_start = .); *(.rela.iplt) PROVIDE_HIDDEN (__rela_iplt_end = .); } .init : { KEEP (*(SORT_NONE(.init))) } .plt: { *(.plt) *(.iplt) } .text : { *(.text.unlikely .text.*_unlikely) *(.text.exit .text.exit.*) *(.text.startup .text.startup.*) *(.text.hot .text.hot.*) *(.text .stub .text.* .gnu.linkonce.t.*) /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) } .fini : { KEEP (*(SORT_NONE(.fini))) } PROVIDE (__etext = .); PROVIDE (_etext = .); PROVIDE (etext = .); .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } .rodata1: { *(.rodata1) } .eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } /* These sections are generated by the Sun/Oracle C++ compiler. */ .exception_ranges : ONLY_IF_RO { *(.exception_ranges .exception_ranges*) } /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); /* Exception handling */ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } /* Thread Local Storage sections */ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } .tbss
Re: [yocto] [poky] Is this a bug of binutils
at 2013-9-23 10:34, Li Zhijian wrote: at 2013-9-20 19:00, Laurentiu Palcu wrote: Hi, On Fri, Sep 20, 2013 at 06:25:19PM +0800, Li Zhijian wrote: III) compile a simple C program # cat test.c int main () { printf(hello world\n); return 0; } # source toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux # $CC -o test test.c -L tmp/sysroots/qemux86-64/usr/lib/ -lm OK, it looks like something strange happens in your setup. To debug it, let's add '-Wl,--verbose' at the end of your command and you should be able to see where the linker is looking for libraries. Also, the linker script will be printed. You should see it try your directory first tmp/sysroots/qemux86-64/usr/lib/, and then fall through the default ones with the sysroot prefix added and, at the end, the system ones: /lib:/usr/lib. Thanks, Laurentiu First,in this case Secondly, clear all the environment setuped with environment-setup-x86_64-poky-linux previously and then set --sysroot=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/tmp/sysroots/qemux86-64 In this case ,toolchain work fine [lizj@suika x86-64-yocto-1.3]$ bash [lizj@suika x86-64-yocto-1.3]$ /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc --sysroot=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/tmp/sysroots/qemux86-64 -o test test.c -L tmp/sysroots/qemux86-64/usr/lib/ -lm x86-64 -o test test.c -L tmp/sysroots/qemux86-64/usr/lib/ -lm -Wl,--verbose test.c: In function 'main': test.c:3:9: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default] GNU ld (GNU Binutils) 2.23.1.20121113 Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om using internal linker script: == /* Script for -z combreloc: combine and sort reloc sections */ OUTPUT_FORMAT(elf64-x86-64, elf64-x86-64, elf64-x86-64) OUTPUT_ARCH(i386:x86-64) ENTRY(_start) SEARCH_DIR(/opt/poky/1.3+snapshot/sysroots/x86_64-pokysdk-linux/usr/x86_64-poky-linux/lib64); SEARCH_DIR(=/usr/local/lib64); SEARCH_DIR(=/lib64); SEARCH_DIR(=/usr/lib64); SEARCH_DIR(=/usr/local/lib); SEARCH_DIR(=/lib); SEARCH_DIR(=/usr/lib); SECTIONS { /* Read-only sections, merged into text segment: */ PROVIDE (__executable_start = SEGMENT_START(text-segment, 0x40)); . = SEGMENT_START(text-segment, 0x40) + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } .gnu.version: { *(.gnu.version) } .gnu.version_d : { *(.gnu.version_d) } .gnu.version_r : { *(.gnu.version_r) } .rela.dyn : { *(.rela.init) *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) *(.rela.fini) *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) *(.rela.ctors) *(.rela.dtors) *(.rela.got) *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) *(.rela.ifunc) } .rela.plt : { *(.rela.plt) PROVIDE_HIDDEN (__rela_iplt_start = .); *(.rela.iplt) PROVIDE_HIDDEN (__rela_iplt_end = .); } .init : { KEEP (*(SORT_NONE(.init))) } .plt: { *(.plt) *(.iplt) } .text : { *(.text.unlikely .text.*_unlikely) *(.text.exit .text.exit.*) *(.text.startup .text.startup.*) *(.text.hot .text.hot.*) *(.text .stub .text.* .gnu.linkonce.t.*) /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) } .fini : { KEEP (*(SORT_NONE(.fini))) } PROVIDE (__etext = .); PROVIDE (_etext = .); PROVIDE (etext = .); .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } .rodata1: { *(.rodata1) } .eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } /* These sections are generated by the Sun/Oracle C++ compiler. */ .exception_ranges : ONLY_IF_RO { *(.exception_ranges .exception_ranges*) } /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); /* Exception handling */ .eh_frame : ONLY_IF_RW
[yocto] Is this a bug of binutils
-poky-linux export OECORE_ACLOCAL_OPTS=-I /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/share/aclocal export OECORE_DISTRO_VERSION=1.3+snapshot-20130912 export OECORE_SDK_VERSION=1.3+snapshot -- Best regards. Li Zhijian (8555) ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Is this a bug of binutils
at 2013-9-20 16:43, Laurentiu Palcu wrote: Hi, On Fri, Sep 20, 2013 at 02:45:24PM +0800, Li Zhijian wrote: Hi,all I got a big problem when using the cross-toolchain to compile a simple C program. This problem since 3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 which is to upgrade the binutils from 2.22 to 2.23.1 what I do is as follows, any help or ideas ? I) Build my cross-toolchain # git clone http://git.yoctoproject.org/git/poky/.git # cd poky # git checkout 3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 -b tcmode-default ...skip some steps... # bitbake meta-toolchain Loading cache: 100% || ETA: 00:00:00 Loaded 1122 entries from dependency cache. Build Configuration: BB_VERSION = 1.17.0 BUILD_SYS = x86_64-linux NATIVELSBSTRING = CentOS-6.3 TARGET_SYS = x86_64-poky-linux MACHINE = qemux86-64 DISTRO = poky DISTRO_VERSION = 1.3+snapshot-20130912 TUNE_FEATURES = m64 TARGET_FPU = meta meta-yocto meta-yocto-bsp = tcmode-default:3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 ..cost a long time.. all of the build work successfully II) Install my cross-toolchain # ./poky-eglibc-x86_64-x86_64-toolchain-1.3+snapshot-20130912.sh Enter target directory for SDK (default: /opt/poky/1.3+snapshot): toolchain-1.3-tcmode-default III) compile a simple C program # cat test.c int main () { printf(hello world\n); return 0; } # source toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux # $CC -o test test.c -L tmp/sysroots/qemux86-64/usr/lib/ -lm Technically, for this simple program, it's enough to do: $CC -o test test.c i know that is enough and it is compiled OK but in the case with -L option ,it is failed The $CC contains the sysroot option and the linker will automatically prefix /lib and /usr/lib with the target sysroot. So, it should be able to compile just fine. I haved source the toolchian environment which is installed by ./poky-eglibc-x86_64-x86_64-toolchain-1.3+snapshot-20130912.sh and i think that would include all the correct environment value # source toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux this file's detail is at the last of this thread # echo $CC x86_64-poky-linux-gcc -m64 --sysroot=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-poky-linux the sysroot points to directory which is install by ./poky-eglibc-x86_64-x86_64-toolchain-1.3+snapshot-20130912.sh this directory includes a basic target sysroot The -L option just adds another search path for libraries which will be searched before the default ones. So, it shouldn't be a problem. Somehow, it looks like it tries to link against the host's libraries. yes, it seems that ld try to link to host's libraries but i am not sure that if i had do some wrong steps Before compiling, do a 'echo $CC' and make sure the --sysroot points to the correct directory. you means that i must make --sysroot points to the sysroot build by myself instead of the sysroot provided by poky-eglibc-x86_64-x86_64-toolchain-1.3+snapshot-20130912.sh ?? -- Best regards. Li Zhijian Laurentiu test.c: In function 'main': test.c:3:9: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default] /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6 /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: cannot find /lib/libc.so.6 /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: cannot find /usr/lib/libc_nonshared.a collect2: error: ld returned 1 exit status #cat toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux export PATH=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin:/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux:$PATH export PKG_CONFIG_SYSROOT_DIR=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-poky-linux export PKG_CONFIG_PATH=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-poky-linux/usr/lib/pkgconfig export CONFIG_SITE=/yocto/fnst
Re: [yocto] [poky] Is this a bug of binutils
at 2013-9-20 16:50, Laurentiu Palcu wrote: On Fri, Sep 20, 2013 at 11:43:31AM +0300, Laurentiu Palcu wrote: Hi, On Fri, Sep 20, 2013 at 02:45:24PM +0800, Li Zhijian wrote: Hi,all I got a big problem when using the cross-toolchain to compile a simple C program. This problem since 3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 which is to upgrade the binutils from 2.22 to 2.23.1 Apparently I missed this... Make sure you checkout 0333796a6b167dd754806700d7f771dd4a74e4ab (binutils_2.23.1.bb: Correct typo in enable-targets configure option). This might be your problem. Laurentiu i am sorry,i don't understand what do you mean in poky git tree, 3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 is newer than 0333796a6b167dd754806700d7f771dd4a74e4ab this checkout 0333796a6b167dd754806700d7f771dd4a74e4ab , toolchain work fine # git log commit 3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 Author: Khem Raj raj.k...@gmail.com Date: Wed Aug 8 10:33:41 2012 -0700 tcmode-default.inc: Use binutils 2.23.1 ...skip... commit 0333796a6b167dd754806700d7f771dd4a74e4ab Author: Khem Raj raj.k...@gmail.com Date: Wed Aug 8 07:57:46 2012 -0700 oprofile: Include config.h before bfd.h oprofile uses bfd.h from binutils which now in 2.23+ expects config.h so lets include it ...skip... -- Best regards. Li Zhijian what I do is as follows, any help or ideas ? I) Build my cross-toolchain # git clone http://git.yoctoproject.org/git/poky/.git # cd poky # git checkout 3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 -b tcmode-default ...skip some steps... # bitbake meta-toolchain Loading cache: 100% || ETA: 00:00:00 Loaded 1122 entries from dependency cache. Build Configuration: BB_VERSION = 1.17.0 BUILD_SYS = x86_64-linux NATIVELSBSTRING = CentOS-6.3 TARGET_SYS = x86_64-poky-linux MACHINE = qemux86-64 DISTRO = poky DISTRO_VERSION = 1.3+snapshot-20130912 TUNE_FEATURES = m64 TARGET_FPU = meta meta-yocto meta-yocto-bsp = tcmode-default:3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 ..cost a long time.. all of the build work successfully II) Install my cross-toolchain # ./poky-eglibc-x86_64-x86_64-toolchain-1.3+snapshot-20130912.sh Enter target directory for SDK (default: /opt/poky/1.3+snapshot): toolchain-1.3-tcmode-default III) compile a simple C program # cat test.c int main () { printf(hello world\n); return 0; } # source toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux # $CC -o test test.c -L tmp/sysroots/qemux86-64/usr/lib/ -lm Technically, for this simple program, it's enough to do: $CC -o test test.c The $CC contains the sysroot option and the linker will automatically prefix /lib and /usr/lib with the target sysroot. So, it should be able to compile just fine. The -L option just adds another search path for libraries which will be searched before the default ones. So, it shouldn't be a problem. Somehow, it looks like it tries to link against the host's libraries. Before compiling, do a 'echo $CC' and make sure the --sysroot points to the correct directory. Laurentiu test.c: In function 'main': test.c:3:9: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default] /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6 /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: cannot find /lib/libc.so.6 /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: cannot find /usr/lib/libc_nonshared.a collect2: error: ld returned 1 exit status #cat toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux export PATH=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin:/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux:$PATH export PKG_CONFIG_SYSROOT_DIR=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-poky-linux export PKG_CONFIG_PATH=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-poky-linux/usr/lib/pkgconfig export CONFIG_SITE=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3
Re: [yocto] [poky] Is this a bug of binutils
at 2013-9-20 18:02, Laurentiu Palcu wrote: On Fri, Sep 20, 2013 at 05:56:25PM +0800, Li Zhijian wrote: at 2013-9-20 16:50, Laurentiu Palcu wrote: On Fri, Sep 20, 2013 at 11:43:31AM +0300, Laurentiu Palcu wrote: Hi, On Fri, Sep 20, 2013 at 02:45:24PM +0800, Li Zhijian wrote: Hi,all I got a big problem when using the cross-toolchain to compile a simple C program. This problem since 3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 which is to upgrade the binutils from 2.22 to 2.23.1 Apparently I missed this... Make sure you checkout 0333796a6b167dd754806700d7f771dd4a74e4ab (binutils_2.23.1.bb: Correct typo in enable-targets configure option). This might be your problem. Laurentiu i am sorry,i don't understand what do you mean My bad, I copy-pasted the wrong sha1 (the summary was good though). Here's the correct sha1: a8fa49fbc21d460479ecadeb1996a800cc4e3e07 not really this fix,i build meta-toolchain on yocto-1.4.1(73f103bf9b2cdf985464dc53bf4f1cfd71d4531f) and got the same problem even at the latest poky, got the same problem -- Best regards. Li Zhijian Laurentiu in poky git tree, 3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 is newer than 0333796a6b167dd754806700d7f771dd4a74e4ab this checkout 0333796a6b167dd754806700d7f771dd4a74e4ab , toolchain work fine # git log commit 3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 Author: Khem Raj raj.k...@gmail.com Date: Wed Aug 8 10:33:41 2012 -0700 tcmode-default.inc: Use binutils 2.23.1 ...skip... commit 0333796a6b167dd754806700d7f771dd4a74e4ab Author: Khem Raj raj.k...@gmail.com Date: Wed Aug 8 07:57:46 2012 -0700 oprofile: Include config.h before bfd.h oprofile uses bfd.h from binutils which now in 2.23+ expects config.h so lets include it ...skip... -- Best regards. Li Zhijian what I do is as follows, any help or ideas ? I) Build my cross-toolchain # git clone http://git.yoctoproject.org/git/poky/.git # cd poky # git checkout 3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 -b tcmode-default ...skip some steps... # bitbake meta-toolchain Loading cache: 100% || ETA: 00:00:00 Loaded 1122 entries from dependency cache. Build Configuration: BB_VERSION = 1.17.0 BUILD_SYS = x86_64-linux NATIVELSBSTRING = CentOS-6.3 TARGET_SYS = x86_64-poky-linux MACHINE = qemux86-64 DISTRO = poky DISTRO_VERSION = 1.3+snapshot-20130912 TUNE_FEATURES = m64 TARGET_FPU = meta meta-yocto meta-yocto-bsp = tcmode-default:3ae71c74c71f13a390b21b4c3ead04e51aaa82b8 ..cost a long time.. all of the build work successfully II) Install my cross-toolchain # ./poky-eglibc-x86_64-x86_64-toolchain-1.3+snapshot-20130912.sh Enter target directory for SDK (default: /opt/poky/1.3+snapshot): toolchain-1.3-tcmode-default III) compile a simple C program # cat test.c int main () { printf(hello world\n); return 0; } # source toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux # $CC -o test test.c -L tmp/sysroots/qemux86-64/usr/lib/ -lm Technically, for this simple program, it's enough to do: $CC -o test test.c The $CC contains the sysroot option and the linker will automatically prefix /lib and /usr/lib with the target sysroot. So, it should be able to compile just fine. The -L option just adds another search path for libraries which will be searched before the default ones. So, it shouldn't be a problem. Somehow, it looks like it tries to link against the host's libraries. Before compiling, do a 'echo $CC' and make sure the --sysroot points to the correct directory. Laurentiu test.c: In function 'main': test.c:3:9: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default] /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6 /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: cannot find /lib/libc.so.6 /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a /yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.7.2/ld: cannot find /usr/lib/libc_nonshared.a collect2: error: ld returned 1 exit status #cat toolchain-1.3-tcmode-default/environment-setup-x86_64-poky-linux export PATH=/yocto/fnst/lizj/build_yocto/x86-64-yocto-1.3/toolchain-1.3-tcmode-default/sysroots/x86_64-pokysdk-linux/usr/bin:/yocto/fnst/lizj
[yocto] [Question] libxml: How about add --with-catalog to EXTRA_OECONF ?
Hi, I had build libxml and executed xmlcatalog It shows follow messages # xmlcatalog --help libxml was not compiled with catalog and output support meta/recipes-core/libxml/libxml2.inc: 32 EXTRA_OECONF = --without-python --without-debug --without-legacy --without-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions Is it reasonable to add --without-catalog EXTRA_OECONF ? Thanks Best regards. Li Zhijian ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] How to modify SRC_URI[md5sum] if there are mutil remote files
resolved. thanks at 2013-5-27 14:52, Nicolas Dechesne wrote: On Mon, May 27, 2013 at 7:40 AM, Li Zhijian lizhij...@cn.fujitsu.com wrote: I modified as follows ,but it don't work. --- a/meta-oe/recipes-support/ntp/ntp.inc +++ b/meta-oe/recipes-support/ntp/ntp.inc @@ -20,6 +20,9 @@ SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.g file://ntpdate.default \ file://ntp.keys \ " +SRC_URI[md5sum] = "00df80a84ec9528fcfb09498075525bc" +SRC_URI[sha256sum] = "d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c" +SRC_URI += "http://jaist.dl.sourceforge.net/project/ictom/ntpstat-0.2.tar.gz " +SRC_URI[md5sum] += "516847d99a772305cab711339998f9ea" +SRC_URI[sha256sum] += "486fdfceb38590a9ff52ab8de1cc1ec4fc696f2e94da992e9ccf30157c32f01e" Any help or ideas? you should have a look at: http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-extended/bash/bash_4.2.bb or http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-bsp/apmd/apmd_3.2.2-14.bb and for more examples, you can run $ git grep "\.md5sum" in the OE-core tree. basically, the idea is to 'name' each of your sources, and refer them as name.md5sum -- Best regards. Li Zhijian ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
[yocto] How to modify SRC_URI[md5sum] if there are mutil remote files
Hi, I modified as follows ,but it don't work. --- a/meta-oe/recipes-support/ntp/ntp.inc +++ b/meta-oe/recipes-support/ntp/ntp.inc @@ -20,6 +20,9 @@ SRC_URI = http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.g file://ntpdate.default \ file://ntp.keys \ +SRC_URI[md5sum] = 00df80a84ec9528fcfb09498075525bc +SRC_URI[sha256sum] = d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c +SRC_URI += http://jaist.dl.sourceforge.net/project/ictom/ntpstat-0.2.tar.gz +SRC_URI[md5sum] += 516847d99a772305cab711339998f9ea +SRC_URI[sha256sum] += 486fdfceb38590a9ff52ab8de1cc1ec4fc696f2e94da992e9ccf30157c32f01e Any help or ideas? -- Best regards. Li Zhijian ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto