Bug 5515 - sato-sdk for sugarbay fails to build with gcc security flags
Summary: sato-sdk for sugarbay fails to build with gcc security flags
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 1.5
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.5.1
Assignee: Saul Wold
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-11-11 16:10 UTC by Alexandru Georgescu
Modified: 2014-01-16 12:50 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
compile log (246.11 KB, application/octet-stream)
2013-11-11 16:11 UTC, Alexandru Georgescu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandru Georgescu 2013-11-11 16:10:35 UTC
poky master:57498cede4696526c121e0112b5dea3e6e8365ac


After seing https://bugzilla.yoctoproject.org/show_bug.cgi?id=5505 I tried with another BSP, which is sugarbay. I also opened another bug since it's different architecture. If wrong, please mark as duplicate with #5505

Building it with -k revealed the following tasks failing ($ bitbake -k  core-image-sato-sdk):


Summary: 7 tasks failed:
  /mnt/ssd/poky-gcc-security/meta/recipes-connectivity/openssl/openssl_1.0.1e.bb, do_compile
  /mnt/ssd/poky-gcc-security/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb, do_configure
  /mnt/ssd/poky-gcc-security/meta/recipes-kernel/lttng/lttng-ust_2.3.0.bb, do_compile
  /mnt/ssd/poky-gcc-security/meta/recipes-connectivity/libpcap/libpcap_1.4.0.bb, do_compile
  /mnt/ssd/poky-gcc-security/meta/recipes-support/libproxy/libproxy_0.4.7.bb, do_compile
  /mnt/ssd/poky-gcc-security/meta/recipes-extended/newt/libnewt_0.52.14.bb, do_compile
  /mnt/ssd/poky-gcc-security/meta/recipes-devtools/valgrind/valgrind_3.8.1.bb, do_compile

The full log is attached.
Comment 1 Alexandru Georgescu 2013-11-11 16:11:29 UTC
Created attachment 1615 [details]
compile log
Comment 2 Ionut Chisanovici 2013-11-12 09:52:30 UTC
Hi,

The same issue for the build for qemux86-64 image having the security flags enable in local.conf.

make[2]: Entering directory `/home/ionut/work/poky/build64_sf/tmp/work/x86_64-poky-linux/openssl/1.0.1e-r15.0/openssl-1.0.1e'
[ -z "" ] || x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build64_sf/tmp/sysroots/qemux86-64 -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN 	-DTER
MIO  -O2 -pipe -g -feliminate-unused-debug-types -fstack-protector-all -pie -fpie -D_FORTIFY_SOURCE=2 -Wall -Wa,--noexecstack -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_M
ONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -Iinclude \
		-DFINGERPRINT_PREMAIN_DSO_LOAD -o fips_premain_dso  \
		fips_premain.c fipscanister.o \
		libcrypto.a -lgcc -ldl
make[3]: Entering directory `/home/ionut/work/poky/build64_sf/tmp/work/x86_64-poky-linux/openssl/1.0.1e-r15.0/openssl-1.0.1e'
make[4]: Entering directory `/home/ionut/work/poky/build64_sf/tmp/work/x86_64-poky-linux/openssl/1.0.1e-r15.0/openssl-1.0.1e'
/home/ionut/work/poky/build64_sf/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.8.1/ld: libcrypto.a(cryptlib.o): relocation R_X86_64_PC32 against symbol `OPENSSL_showfatal'
 can not be used when making a shared object; recompile with -fPIC
/home/ionut/work/poky/build64_sf/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.8.1/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[4]: *** [link_a.gnu] Error 1
make[4]: Leaving directory `/home/ionut/work/poky/build64_sf/tmp/work/x86_64-poky-linux/openssl/1.0.1e-r15.0/openssl-1.0.1e'
make[3]: *** [do_linux-shared] Error 2
make[3]: Leaving directory `/home/ionut/work/poky/build64_sf/tmp/work/x86_64-poky-linux/openssl/1.0.1e-r15.0/openssl-1.0.1e'
make[2]: *** [libcrypto.so.1.0.0] Error 2
make[2]: Leaving directory `/home/ionut/work/poky/build64_sf/tmp/work/x86_64-poky-linux/openssl/1.0.1e-r15.0/openssl-1.0.1e'
make[1]: *** [shared] Error 2
make[1]: Leaving directory `/home/ionut/work/poky/build64_sf/tmp/work/x86_64-poky-linux/openssl/1.0.1e-r15.0/openssl-1.0.1e/crypto'
make: *** [build_crypto] Error 1
ERROR: oe_runmake failed
WARNING: exit code 1 from a shell command.
Comment 3 Saul Wold 2013-11-18 22:31:18 UTC
I have tried to reproduce this and was not able, is it possible you enabled the 
security flags in a build that already existed?  That could cause this issue 
and the issue mentioned in bug 5505, I could build openssl with no issues.
Comment 4 Ionut Chisanovici 2013-11-19 08:27:59 UTC
Hi Saul,

This is happening for the 64 bits images.
Try a build for 64 bits image.

Cheers,
Ionut
Comment 5 Saul Wold 2013-11-20 23:43:16 UTC
Yes, I am building for genericx86-64, which is a 64bit system, can you confirm 
this in a clean build area please.
Comment 6 Alexandru Georgescu 2013-11-21 09:25:33 UTC
(In reply to comment #5)
> Yes, I am building for genericx86-64, which is a 64bit system, can you
> confirm 
> this in a clean build area please.

Hi Saul,
We have tried with clean builds (didn't build anything before).
Comment 8 Ionut Chisanovici 2013-12-12 14:04:05 UTC
Hi Soul,

We have another problem now, something related to zlib libraries.
This is happening for core-image-sato-sdk builds for the 64 bits images (genericx86-64 and nuc) having security flags enabled within the local.conf.
Checked this on Fedora 19 and Ubuntu 13 and on both systems I have zlib and zlib libraries installed.

Please see below:

ERROR: Function failed: do_configure (log file is located at /home/ionut/work/poky/build_sf/tmp/work/x86_64-poky-linux/libid3tag/0.15.1b-r7/temp/log.do_configure.30447)
ERROR: Logfile of failure stored in: /home/ionut/work/poky/build_sf/tmp/work/x86_64-poky-linux/libid3tag/0.15.1b-r7/temp/log.do_configure.30447
Log data follows:
| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: SITE files ['endian-little', 'common-linux', 'common-glibc', 'bit-64', 'x86_64-linux', 'common']
| DEBUG: Executing shell function autotools_preconfigure
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing shell function do_configure
| automake (GNU automake) 1.13.4
| Copyright (C) 2013 Free Software Foundation, Inc.
| License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
| This is free software: you are free to change and redistribute it.
| There is NO WARRANTY, to the extent permitted by law.
| 
| Written by Tom Tromey <tromey@redhat.com>
|        and Alexandre Duret-Lutz <adl@gnu.org>.
| AUTOV is 1.13
| NOTE: Executing ACLOCAL="aclocal --system-acdir=/home/ionut/work/poky/build_sf/tmp/work/x86_64-poky-linux/libid3tag/0.15.1b-r7/build/aclocal-copy/ --automake-acdir=/home/ionut/work/poky/build_sf/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.13" autoreconf --verbose --install --force --exclude=autopoint
| autoreconf: Entering directory `.'
| autoreconf: configure.ac: not using Gettext
| autoreconf: running: aclocal --system-acdir=/home/ionut/work/poky/build_sf/tmp/work/x86_64-poky-linux/libid3tag/0.15.1b-r7/build/aclocal-copy/ --automake-acdir=/home/ionut/work/poky/build_sf/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.13 --force
| autoreconf: configure.ac: tracing
| autoreconf: running: libtoolize --copy --force
| libtoolize: putting auxiliary files in `.'.
| libtoolize: copying file `./ltmain.sh'
| libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
| libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
| libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
| autoreconf: running: /home/ionut/work/poky/build_sf/tmp/sysroots/x86_64-linux/usr/bin/autoconf --force
| autoreconf: running: /home/ionut/work/poky/build_sf/tmp/sysroots/x86_64-linux/usr/bin/autoheader --force
| autoreconf: running: automake --foreign --add-missing --copy --force-missing
| autoreconf: running: gnu-configize
| autoreconf: Leaving directory `.'
| NOTE: Running /home/ionut/work/poky/build_sf/tmp/work/x86_64-poky-linux/libid3tag/0.15.1b-r7/libid3tag-0.15.1b/configure  --build=x86_64-linux 		  --host=x86_64-poky-linux 		  --target=x86_64-poky-linux 		  --prefix=/usr 		  --exec_prefix=/usr 		  --bindir=/usr/bin 		  --sbindir=/usr/sbin 		  --libexecdir=/usr/lib/libid3tag 	  --datadir=/usr/share 		  --sysconfdir=/etc 		  --sharedstatedir=/com 		  --localstatedir=/var 		  --libdir=/usr/lib 		  --includedir=/usr/include 		  --oldincludedir=/usr/include 		  --infodir=/usr/share/info 		  --mandir=/usr/share/man 		  --disable-silent-rules 		  --disable-dependency-tracking 		  --with-libtool-sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc -enable-speed
| configure: WARNING: unrecognized options: --enable-speed
| configure: loading site script /home/ionut/work/poky/meta/site/endian-little
| configure: loading site script /home/ionut/work/poky/meta/site/common-linux
| configure: loading site script /home/ionut/work/poky/meta/site/common-glibc
| configure: loading site script /home/ionut/work/poky/meta/site/x86_64-linux
| configure: loading site script /home/ionut/work/poky/meta/site/common
| configure: loading site script /home/ionut/work/poky/build_sf/tmp/sysroots/nuc/usr/share/x86_64-poky-linux_config_site.d/eglibc_config
| checking for a BSD-compatible install... /usr/bin/install -c
| checking whether build environment is sane... yes
| checking for x86_64-poky-linux-strip... x86_64-poky-linux-strip
| checking for a thread-safe mkdir -p... /bin/mkdir -p
| checking for gawk... gawk
| checking whether make sets $(MAKE)... yes
| checking whether make supports nested variables... yes
| checking build system type... x86_64-pc-linux-gnu
| checking host system type... x86_64-poky-linux-gnu
| checking for x86_64-poky-linux-gcc... x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc
| checking whether the C compiler works... yes
| checking for C compiler default output file name... a.out
| checking for suffix of executables...
| checking whether we are cross compiling... yes
| checking for suffix of object files... o
| checking whether we are using the GNU C compiler... yes
| checking whether x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc accepts -g... yes
| checking for x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc option to accept ISO C89... none needed
| checking for style of include used by make... GNU
| checking dependency style of x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc... none
| checking how to print strings... printf
| checking for a sed that does not truncate output... (cached) sed
| checking for grep that handles long lines and -e... /bin/grep
| checking for egrep... /bin/grep -E
| checking for fgrep... /bin/grep -F
| checking for ld used by x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc... x86_64-poky-linux-ld --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc
| checking if the linker (x86_64-poky-linux-ld --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc  ) is GNU ld... yes
| checking for BSD- or MS-compatible name lister (nm)... x86_64-poky-linux-nm
| checking the name lister (x86_64-poky-linux-nm) interface... BSD nm
| checking whether ln -s works... yes
| checking the maximum length of command line arguments... 1572864
| checking whether the shell understands some XSI constructs... yes
| checking whether the shell understands "+="... yes
| checking how to convert x86_64-pc-linux-gnu file names to x86_64-poky-linux-gnu format... func_convert_file_noop
| checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
| checking for x86_64-poky-linux-ld --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc   option to reload object files... -r
| checking for x86_64-poky-linux-objdump... x86_64-poky-linux-objdump
| checking how to recognize dependent libraries... pass_all
| checking for x86_64-poky-linux-dlltool... no
| checking for dlltool... no
| checking how to associate runtime and link libraries... printf %s\n
| checking for x86_64-poky-linux-ar... x86_64-poky-linux-ar
| checking for archiver @FILE support... @
| checking for x86_64-poky-linux-strip... (cached) x86_64-poky-linux-strip
| checking for x86_64-poky-linux-ranlib... x86_64-poky-linux-ranlib
| checking command to parse x86_64-poky-linux-nm output from x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc object... ok
| checking for sysroot... /home/ionut/work/poky/build_sf/tmp/sysroots/nuc
| checking for x86_64-poky-linux-mt... no
| checking for mt... mt
| configure: WARNING: using cross tools not prefixed with host triplet
| checking if mt is a manifest tool... no
| checking how to run the C preprocessor... x86_64-poky-linux-gcc -E --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc  -m64
| checking for ANSI C header files... (cached) yes
| checking for sys/types.h... (cached) yes
| checking for sys/stat.h... (cached) yes
| checking for stdlib.h... (cached) yes
| checking for string.h... (cached) yes
| checking for memory.h... (cached) yes
| checking for strings.h... (cached) yes
| checking for inttypes.h... (cached) yes
| checking for stdint.h... (cached) yes
| checking for unistd.h... (cached) yes
| checking for dlfcn.h... (cached) yes
| checking for objdir... .libs
| checking if x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc supports -fno-rtti -fno-exceptions... no
| checking for x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc option to produce PIC... -fPIC -DPIC
| checking if x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc PIC flag -fPIC -DPIC works... yes
| checking if x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc static flag -static works... no
| checking if x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc supports -c -o file.o... yes
| checking if x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc supports -c -o file.o... (cached) yes
| checking whether the x86_64-poky-linux-gcc  -m64 --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc linker (x86_64-poky-linux-ld --sysroot=/home/ionut/work/poky/build_sf/tmp/sysroots/nuc   -m elf_x86_64) supports shared libraries... yes
| checking whether -lc should be explicitly linked in... no
| checking dynamic linker characteristics... GNU/Linux ld.so
| checking how to hardcode library paths into programs... immediate
| checking whether stripping libraries is possible... yes
| checking if libtool supports shared libraries... yes
| checking whether to build shared libraries... yes
| checking whether to build static libraries... yes
| checking for ANSI C header files... (cached) yes
| checking for assert.h... (cached) yes
| checking for unistd.h... (cached) yes
| checking zlib.h usability... yes
| checking zlib.h presence... yes
| checking for zlib.h... yes
| checking for an ANSI C-conforming const... yes
| checking for inline... inline
| checking for ftruncate... (cached) yes
| checking for compress2 in -lz... no
| configure: error: libz was not found
| *** You must first install zlib (libz) before you can build this package.
| *** If zlib is already installed, you may need to use the LDFLAGS
| *** environment variable to specify its installed location, e.g. -L<dir>.
| Configure failed. The contents of all config.log files follows to aid debugging
| ERROR: oe_runconf failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/ionut/work/poky/build_sf/tmp/work/x86_64-poky-linux/libid3tag/0.15.1b-r7/temp/log.do_configure.30447)
ERROR: Task 4307 (/home/ionut/work/poky/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb, do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4169 tasks of which 422 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  /home/ionut/work/poky/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb, do_configure
Summary: There were 18 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.


Cheers,
IonutC
Comment 9 Ionut Chisanovici 2013-12-12 14:07:05 UTC
I baptized Saul ... sorry :)
Comment 10 Saul Wold 2013-12-12 21:26:25 UTC
I am not sure what that last comment was supposed to mean. 

It seems we met another issue with the obsuce linkage issue, I am doing a full 
build with core-image-sato-sdk and qemux86-64 to see if I find anymore issues.
Comment 12 Ionut Chisanovici 2013-12-20 10:00:40 UTC
Tried another two builds using the below commits:

meta-yocto-bsp    = "master:bc1e359aaefeeddf8525b46eb80ac14db7f637b3"
meta-intel        
meta-nuc          = "master:a665015a6a95be732eeee8f7a915fcf0e030c112"

1. for nuc for which everything was ok, the core-image-sato-sdk image was build without errors;
2. for generix86-64 which failed with the below error:

ERROR: Function failed: do_compile (log file is located at /home/ionut/work/poky/build/tmp/work/x86_64-linux/grub-efi-native/2.00-r2/temp/log.do_compile.6800)
ERROR: Logfile of failure stored in: /home/ionut/work/poky/build/tmp/work/x86_64-linux/grub-efi-native/2.00-r2/temp/log.do_compile.6800
| /usr/bin/ld: -r and -shared may not be used together
| collect2: error: ld returned 1 exit status
| make[3]: *** [trig.module] Error 1
| make[3]: *** Waiting for unfinished jobs....
| make[3]: Leaving directory `/home/ionut/work/poky/build/tmp/work/x86_64-linux/grub-efi-native/2.00-r2/grub-2.00/grub-core'
| make[2]: *** [all] Error 2
| make[2]: Leaving directory `/home/ionut/work/poky/build/tmp/work/x86_64-linux/grub-efi-native/2.00-r2/grub-2.00/grub-core'
| make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory `/home/ionut/work/poky/build/tmp/work/x86_64-linux/grub-efi-native/2.00-r2/grub-2.00'
| make: *** [all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/ionut/work/poky/build/tmp/work/x86_64-linux/grub-efi-native/2.00-r2/temp/log.do_compile.6800)
ERROR: Task 1284 (virtual:native:/home/ionut/work/poky/meta/recipes-bsp/grub/grub-efi_2.00.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 5587 tasks of which 437 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  virtual:native:/home/ionut/work/poky/meta/recipes-bsp/grub/grub-efi_2.00.bb, do_compile
Summary: There were 22 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

Cheers,
IonutC
Comment 13 Saul Wold 2014-01-14 19:27:47 UTC
I beleive this is now really fixed
Comment 14 Ionut Chisanovici 2014-01-16 12:50:20 UTC
Issue is now fixed.
This was verified with:
meta-yocto-bsp    = "master:cea75f9c8c083d76ad8c45127be332665ef09d06"
meta-sugarbay     = "master:381f53495e662454873ff858e4d40a64e3b20a55"

Cheers,
Ionut C