Bug 9478 - glibc-2.22 cannot find -lgcc with gcc 4.9
Summary: glibc-2.22 cannot find -lgcc with gcc 4.9
Status: RESOLVED NOTABUG
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 2.0.2
Hardware: Other arm
: Undecided normal
Target Milestone: ---
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-04-18 21:28 UTC by Charles
Modified: 2016-04-19 11:00 UTC (History)
2 users (show)

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


Attachments
Complete error log when `bitbake gcc` (8.76 MB, text/plain)
2016-04-18 21:28 UTC, Charles
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Charles 2016-04-18 21:28:19 UTC
Created attachment 3132 [details]
Complete error log when `bitbake gcc`

Jethro Branch, when compiled with gcc4.9, glibc failed at do_compiled.

sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi.gcc-cross-initial-arm/../../libexec/arm-poky-linux-gnueabi.gcc-cross-initial-arm/gcc/arm-poky-linux-gnueabi/5.2.0/ld: cannot find -lgcc
| collect2: error: ld returned 1 exit status
Comment 1 Ross Burton 2016-04-19 09:02:44 UTC
Works for me:

$ gcc --version
gcc (Debian 4.9.2-10) 4.9.2

$ bitbake gcc
[snip]
NOTE: Tasks Summary: Attempted 503 tasks of which 345 didn't need to be rerun and all succeeded.

Do you have any more relevant details?  What distro and host compiler?  Did you change the default compiler that jethro builds (5.2), or when you say gcc4.9 do you mean host compiler?  If you changed our compiler, how did you do that?
Comment 2 Charles 2016-04-19 09:38:10 UTC
I am using freescale.github.io Jethro repo.  

In local.conf, I have added these as well as tried to commenting them out and see what happened. I am pretty sure that gcc is using 4.9 to compile. I have also tried removed the 5.2 files.  This is my local.conf

MACHINE ??= 'hio-imx6dl-board'
DISTRO ?= 'poky'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES = "debug-tweaks ssh-server-openssh \
package-management tools-sdk tools-debug "

USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
ASSUME_PROVIDED += "libsdl-native"
CONF_VERSION = "1"

BB_NUMBER_THREADS = '32'
PARALLEL_MAKE = '-j 32'

DL_DIR ?= "/yocto/downloads/"
SSTATE_DIR ?= "/yocto/sstate-cache"
ACCEPT_FSL_EULA = "1"
LICENSE_FLAGS_WHITELIST = "commercial"
DISTRO_FEATURES_remove = " x11 wayland "
DISTRO_FEATURES_append = " opengl "

PREFERRED_VERSION_gcc-cross ?= "4.9%"
PREFERRED_VERSION_gcc-cross-initial ?= "4.9%"
PREFERRED_VERSION_gcc-crosssdk ?= "4.9%"
PREFERRED_VERSION_gcc-crosssdk-initial ?= "4.9%"
PREFERRED_VERSION_gcc-runtime ?= "4.9%"
PREFERRED_VERSION_gcc-sanitizers ?= "4.9%"
PREFERRED_VERSION_gcc-source ?= "4.9%"
PREFERRED_VERSION_libgcc ?= "4.9%"
PREFERRED_VERSION_libgcc-initial ?= "4.9%"
PREFERRED_VERSION_libgfortran ?= "4.9%"
PREFERRED_VERSION_libgcc ?= "4.9%"
PREFERRED_VERSION_libgcc-initial ?= "4.9%"
PREFERRED_VERSION_libgfortran ?= "4.9%"
Comment 3 Charles 2016-04-19 09:40:31 UTC
Sorry, was missing one important line copied from local.conf

PREFERRED_VERSION_GCC ?= "4.9%"
Comment 4 Ross Burton 2016-04-19 09:41:37 UTC
PREFERRED_VERSION_gcc-cross ?= "4.9%"
PREFERRED_VERSION_gcc-cross-initial ?= "4.9%"
PREFERRED_VERSION_gcc-crosssdk ?= "4.9%"
PREFERRED_VERSION_gcc-crosssdk-initial ?= "4.9%"
PREFERRED_VERSION_gcc-runtime ?= "4.9%"
PREFERRED_VERSION_gcc-sanitizers ?= "4.9%"
PREFERRED_VERSION_gcc-source ?= "4.9%"
PREFERRED_VERSION_libgcc ?= "4.9%"
PREFERRED_VERSION_libgcc-initial ?= "4.9%"
PREFERRED_VERSION_libgfortran ?= "4.9%"
PREFERRED_VERSION_libgcc ?= "4.9%"
PREFERRED_VERSION_libgcc-initial ?= "4.9%"
PREFERRED_VERSION_libgfortran ?= "4.9%"

Don't do that.  Just do:

GCCVERSION="4.9%"

That might catch a recipe that you missed.  Can you re-test?
Comment 5 Charles 2016-04-19 10:09:38 UTC
Thank you, Setting GCCVERSION = "4.9%" fixed the error.

And thanks for pointing out the default configuration of poky in Jethro

http://cgit.openembedded.org/openembedded-core/tree/meta/conf/distro/include/tcmode-default.inc?h=jethro
Comment 6 Ross Burton 2016-04-19 11:00:08 UTC
Changing to NOTABUG so QA don't have to validate.