| Summary: | Libgfortran broken for cross-compilation | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Nick Clark <nicholas.clark> | ||||
| Component: | devtools / tool chain | Assignee: | Richard Purdie <richard.purdie> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | Medium | CC: | matthias.schoepfer, meta.mr.watcher, meta.watcher, randy.macleod, sergio.paracuellos | ||||
| Version: | 2.4.1 | ||||||
| Target Milestone: | 2.1.4 | ||||||
| Hardware: | All | ||||||
| OS: | arm | ||||||
| Whiteboard: | |||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||
| Verified: | Documentation change: | Don't know | |||||
| Attachments: |
|
||||||
|
Description
Nick Clark
2017-12-04 21:43:55 UTC
Some extra notes. It seems that libbacktrace is always built for my host architecture (x86-64), regardless of what the target is.
So on my machine, the archive:
build/tmp/${MACHINE}/${DISTRO}/work/cortexa9hf-neon-ua-linux-gnueabi/gcc-runtime/7.2.0-r0/gcc-7.2.0/build.arm-ua-linux-gnueabi.arm-ua-linux-gnueabi/libbacktrace/libbacktrace.la
appears to contain x86-64 .o's instead of ARM.
I've sent a patch which fixes this against master and also added a test for this to oe-selftest. Created attachment 4162 [details]
Full error log bitbake libgfortran with MACHINE="qemux86_64"
Hi there,
I am stuck with the same problem. I tried the afore mentioned patch (regarding libbacktrace in Makefile.am / Makefile.in), but no luck:
ERROR: libgfortran-7.2.0-r0 do_packagedata: The recipe libgfortran is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
/home/mschoepf/identpro/yocto/ros-devel/tmp/pkgdata/qemux86-64/runtime/libgfortran
(matched in manifest-qemux86-64-gcc-runtime.packagedata)
/home/mschoepf/identpro/yocto/ros-devel/tmp/pkgdata/qemux86-64/runtime/libgfortran-dev
(matched in manifest-qemux86-64-gcc-runtime.packagedata)
/home/mschoepf/identpro/yocto/ros-devel/tmp/pkgdata/qemux86-64/runtime/libgfortran-staticdev
(matched in manifest-qemux86-64-gcc-runtime.packagedata)
Please verify which recipe should provide the above files.
Can you please post you patch or where to find it. I searched in poky master but could not find it there...
Thanks and Regards,
Matthias
Nevermind, I found it in openembedded-core master. Thanks, Richard! You rock. I have a similar issue in 'sumo' branch. The patch you are pointing here is not enough to solve the issue. I have to apply the following patch to be able to find libbacktrace headers: diff -Naur gcc-7.3.0/libgfortran/Makefile.in gcc-7.3.0.modif/libgfortran/Makefile.in --- gcc-7.3.0/libgfortran/Makefile.in 2018-01-25 09:17:54.059232055 +0100 +++ gcc-7.3.0.modif/libgfortran/Makefile.in 2019-01-08 12:42:00.583138367 +0100 @@ -582,7 +582,7 @@ toolexeclib_DATA = libgfortran.spec libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS) libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \ - $(LTLDFLAGS) $(LIBQUADLIB) ../libbacktrace/libbacktrace.la \ + $(LTLDFLAGS) $(LIBQUADLIB) ../../libbacktrace/libbacktrace.la \ $(HWCAP_LDFLAGS) \ -lm $(extra_ldflags_libgfortran) \ $(version_arg) -Wc,-shared-libgcc @@ -603,7 +603,7 @@ -I$(MULTIBUILDTOP)../libgcc \ -I$(srcdir)/$(MULTISRCTOP)../libbacktrace \ -I$(MULTIBUILDTOP)../libbacktrace \ - -I../libbacktrace + -I../../libbacktrace gfor_io_src = io/size_from_kind.c $(am__append_2) gfor_io_headers = \ but then I get the following error: | /home/sergio/YOCTO/build/tmp/work/aarch64-poky-linux/gcc-runtime/7.3.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/ld: ../../libbacktrace/.libs/libbacktrace.a(dwarf.o): Relocations in generic ELF (EM: 62) | /home/sergio/YOCTO/build/tmp/work/aarch64-poky-linux/gcc-runtime/7.3.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/ld: ../../libbacktrace/.libs/libbacktrace.a(dwarf.o): Relocations in generic ELF (EM: 62) | /home/sergio/YOCTO/build/tmp/work/aarch64-poky-linux/gcc-runtime/7.3.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/ld: ../../libbacktrace/.libs/libbacktrace.a(dwarf.o): Relocations in generic ELF (EM: 62) | ../../libbacktrace/.libs/libbacktrace.a(dwarf.o): error adding symbols: File in wrong format | collect2: error: ld returned 1 exit status | Makefile:1364: recipe for target 'libgfortran.la' failed | make[1]: *** [libgfortran.la] Error 1 | make[1]: Leaving directory '/home/sergio/YOCTO/build/tmp/work/aarch64-poky-linux/gcc-runtime/7.3.0-r0/gcc-7.3.0/build.aarch64-poky-linux.aarch64-poky-linux/aarch64-poky-linux/libgfortran' | Makefile:1242: recipe for target 'all' failed | 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/sergio/YOCTO/build/tmp/work/aarch64-poky-linux/gcc-runtime/7.3.0-r0/temp/log.do_compile.24547) ERROR: Task (/home/sergio/YOCTO/workspace/poky/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb:do_compile) failed with exit code '1' So It seems that libbacktrace is always built for my host architecture instead of for arm64 bits... Is this a known problem? Am I doing something wrong? The problem was using a bbappend file for recipes-devtools/gcc/gcc-runtime_7.3.bbappend with: RUNTIMETARGET += "libgfortran" It seems that in 'sumo' libgfortran is a separate recipe so avoiding this bbappend file fortran compiles properly as it is. Sorry for the noise. |