Bug 14113 - GNU Fortran is not working
Summary: GNU Fortran is not working
Status: RESOLVED NOTABUG
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 3.0.5
Hardware: x86 arm64
: Medium+ major
Target Milestone: 3.3 M1
Assignee: ninos
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-11-03 05:31 UTC by ninos
Modified: 2020-12-12 15:32 UTC (History)
6 users (show)

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


Attachments
building info (380.10 KB, text/x-log)
2020-11-03 05:31 UTC, ninos
no flags Details
libgfortran do_configure error info (67.34 KB, text/x-log)
2020-11-03 05:32 UTC, ninos
no flags Details
libgfortran configure info (96.84 KB, text/x-log)
2020-11-03 05:32 UTC, ninos
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ninos 2020-11-03 05:31:13 UTC
Created attachment 4745 [details]
building info

target system: arm64-xilinx-linux
build system: ubuntu 16.04
yocto version: zeus (git commit id unkown, because xilinx provides it)
meta-ros version: https://github.com/ros/meta-ros/tree/zeus, git_commit_id 5707a46
action: use xilinx "petalinux-tools" (wrapping on bitbake) to integrate meta-ros into xilinx device.

issue:  GNU Fortran is not working
It seems like gfortran is misconfigred, as mentions below:
recipe libgfortran-9.2.0-r0: task do_configure: Failed

Attachment:
1. petalinux-build.log: use "petalinux-build" to evoke bitbake and record building info in this file.
2. gfortran_do_config_err.log: libgfortran do_configure related failure info.
3. gfortran_config.log: libgfortran configuration info.

I'm new to yocto, any hints is very appreciated. Thanks in advance!
Comment 1 ninos 2020-11-03 05:32:17 UTC
Created attachment 4746 [details]
libgfortran do_configure error info
Comment 2 ninos 2020-11-03 05:32:42 UTC
Created attachment 4747 [details]
libgfortran configure info
Comment 3 ninos 2020-11-03 22:23:01 UTC
More info here~~~

I grep "libgfortran configure info" and find "aarch64-xilinx-linux-gfortran: command not found". So aarch64-xilinx-linux-gfortran is not installed?

Also, more suspectible options are:
    ac_cv_fc_compiler_gnu=no
    ac_cv_func_dlopen=no
    ac_cv_func_shl_load=no
    ac_cv_header_minix_config_h=no 
    ac_cv_lib_dld_shl_load=no
    ac_cv_prog_fc_g=no
    lt_cv_archive_cmds_need_lc=no
    lt_cv_prog_compiler_c_o_FC=no
    lt_cv_prog_compiler_rtti_exceptions=no
    lt_cv_prog_compiler_static_works_FC=no
    lt_cv_shlibpath_overrides_runpath=no
    enable_static='no'


For detailed suspectible items, see below (grep from "libgfortran configure info"): 

1. --enable-version-specific-runtime-libs is no

2. "enable maintainer-specific portions of Makefiles" is no

3. aarch64-xilinx-linux-gcc  -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot -V >&5
   aarch64-xilinx-linux-gcc: error: unrecognized command line option '-V'
   aarch64-xilinx-linux-gcc: fatal error: no input files

4. aarch64-xilinx-linux-gcc  -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot -qversion >&5
   aarch64-xilinx-linux-gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
   aarch64-xilinx-linux-gcc: fatal error: no input files

5. aarch64-xilinx-linux-gcc -E --sysroot=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot  -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  conftest.c
   conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory
       9 | #include <ac_nonexistent.h>

6. aarch64-xilinx-linux-gcc  -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot -c  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0=/usr/src/debug/libgfortran/9.2.0-r0                      -fdebug-prefix-map=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0=/usr/src/debug/libgfortran/9.2.0-r0                      -fdebug-prefix-map=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot-native=   conftest.c >&5
   conftest.c:52:10: fatal error: minix/config.h: No such file or directory
      52 | #include <minix/config.h>
failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Fortran Runtime Library"
| #define PACKAGE_TARNAME "libgfortran"
| #define PACKAGE_VERSION "0.3"
| #define PACKAGE_STRING "GNU Fortran Runtime Library 0.3"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgfortran/"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| #include <minix/config.h>

7. aarch64-xilinx-linux-gcc -E --sysroot=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot  -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  conftest.c
   conftest.c:19:10: fatal error: minix/config.h: No such file or directory
      19 | #include <minix/config.h>
failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Fortran Runtime Library"
| #define PACKAGE_TARNAME "libgfortran"
| #define PACKAGE_VERSION "0.3"
| #define PACKAGE_STRING "GNU Fortran Runtime Library 0.3"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgfortran/"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h.  */
| #include <minix/config.h>

8. aarch64-xilinx-linux-gcc  -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot -V >&5
   aarch64-xilinx-linux-gcc: error: unrecognized command line option '-V'
   aarch64-xilinx-linux-gcc: fatal error: no input files

9. aarch64-xilinx-linux-gcc  -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot -qversion >&5
   aarch64-xilinx-linux-gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
   aarch64-xilinx-linux-gcc: fatal error: no input files

10. "CET support" is no

11. aarch64-xilinx-linux-gcc  -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot -o conftest -std=gnu11  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0=/usr/src/debug/libgfortran/9.2.0-r0                      -fdebug-prefix-map=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0=/usr/src/debug/libgfortran/9.2.0-r0                      -fdebug-prefix-map=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot-native=     -mclear-hwcap conftest.c  >&5
   aarch64-xilinx-linux-gcc: error: unrecognized command line option '-mclear-hwcap'
failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Fortran Runtime Library"
| #define PACKAGE_TARNAME "libgfortran"
| #define PACKAGE_VERSION "0.3"
| #define PACKAGE_STRING "GNU Fortran Runtime Library 0.3"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgfortran/"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| return 0;
|   ;
|   return 0;
| }

12. /home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: /tmp/ccvyGu7H.o: in function `main':
   /usr/src/debug/libgfortran/9.2.0-r0/gcc-9.2.0/build.aarch64-xilinx-linux.aarch64-xilinx-linux/aarch64-xilinx-linux/libgfortran/conftest.c:60: undefined reference to `shl_load'
   collect2: error: ld returned 1 exit status
failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Fortran Runtime Library"
| #define PACKAGE_TARNAME "libgfortran"
| #define PACKAGE_VERSION "0.3"
| #define PACKAGE_STRING "GNU Fortran Runtime Library 0.3"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgfortran/"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h.  */
| /* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define shl_load innocuous_shl_load
| 
| /* System header to define __stub macros and hopefully few prototypes,
|     which can conflict with char shl_load (); below.
|     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|     <limits.h> exists even on freestanding compilers.  */
| 
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| 
| #undef shl_load
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char shl_load ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_shl_load || defined __stub___shl_load
| choke me
| #endif
| 
| int
| main ()
| {
| return shl_load ();
|   ;
|   return 0;
| }

13. /home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: cannot find -ldld
   collect2: error: ld returned 1 exit status
failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Fortran Runtime Library"
| #define PACKAGE_TARNAME "libgfortran"
| #define PACKAGE_VERSION "0.3"
| #define PACKAGE_STRING "GNU Fortran Runtime Library 0.3"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgfortran/"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char shl_load ();
| int
| main ()
| {
| return shl_load ();
|   ;
|   return 0;
| }

14. /home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../libexec/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/9.2.0/ld: /tmp/ccTAVrwg.o: in function `main':
   /usr/src/debug/libgfortran/9.2.0-r0/gcc-9.2.0/build.aarch64-xilinx-linux.aarch64-xilinx-linux/aarch64-xilinx-linux/libgfortran/conftest.c:60: undefined reference to `dlopen'
   collect2: error: ld returned 1 exit status
failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Fortran Runtime Library"
| #define PACKAGE_TARNAME "libgfortran"
| #define PACKAGE_VERSION "0.3"
| #define PACKAGE_STRING "GNU Fortran Runtime Library 0.3"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgfortran/"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h.  */
| /* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define dlopen innocuous_dlopen
| 
| /* System header to define __stub macros and hopefully few prototypes,
|     which can conflict with char dlopen (); below.
|     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|     <limits.h> exists even on freestanding compilers.  */
| 
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| 
| #undef dlopen
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char dlopen ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_dlopen || defined __stub___dlopen
| choke me
| #endif
| 
| int
| main ()
| {
| return dlopen ();
|   ;
|   return 0;
| }

16. "build static libraries" is no

17. checking whether we are using the GNU Fortran compiler
configure:13223: aarch64-xilinx-linux-gfortran  -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot -c   conftest.F >&5
   ../../../../../../../../work-shared/gcc-9.2.0-r0/gcc-9.2.0/libgfortran/configure: line 1960: aarch64-xilinx-linux-gfortran: command not found
failed program was:
|       program main
| #ifndef __GNUC__
|        choke me
| #endif
| 
|       end

18. configure:13249: aarch64-xilinx-linux-gfortran  -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/base/zynqmp/build/tmp/work/aarch64-xilinx-linux/libgfortran/9.2.0-r0/recipe-sysroot -c -g  conftest.f >&5
   ../../../../../../../../work-shared/gcc-9.2.0-r0/gcc-9.2.0/libgfortran/configure: line 1960: aarch64-xilinx-linux-gfortran: command not found
failed program was:
|       program main
| 
|       end

19. ac_cv_fc_compiler_gnu=no
    ac_cv_func_dlopen=no
    ac_cv_func_shl_load=no
    ac_cv_header_minix_config_h=no 
    ac_cv_lib_dld_shl_load=no
    ac_cv_prog_fc_g=no
    lt_cv_archive_cmds_need_lc=no
    lt_cv_prog_compiler_c_o_FC=no
    lt_cv_prog_compiler_rtti_exceptions=no
    lt_cv_prog_compiler_static_works_FC=no
    lt_cv_shlibpath_overrides_runpath=no
    enable_static='no'
Comment 4 ninos 2020-11-04 01:27:08 UTC
FYI-update

yocto version: zeus 3.0.1 (git commit id unkown)
Comment 5 ninos 2020-11-04 04:07:14 UTC
> 
> yocto version: zeus 3.0.1 (git commit id unkown)

To be more specific:
According to oe-core/meta/recipes-kernel/linux/linux-yocto_5.2.bb, 
LINUX_VERSION ?= "5.2.28"

According to oe-core/meta/recipes-kernel/linux/linux-yocto_4.19.bb, 
LINUX_VERSION ?= "4.19.87"
Comment 6 Randy MacLeod 2020-11-05 07:49:31 UTC
Assigning to Ross. We think there's an example in local.conf.extended - Ross?
Comment 7 Ross Burton 2020-11-05 07:51:38 UTC
Do you actually enable fortran support?  As per local.conf.sample.extended, you need to set:

FORTRAN_forcevariable = ",fortran"

Typically in local.conf, but the distro can do this.
Comment 9 ninos 2020-11-19 11:04:47 UTC
(In reply to comment #8)
> http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-poky/conf/local.
> conf.sample.extended#n316

Hi Ross,
There's no FORTRAN_forcevariable = ",fortran" in conf/local.conf. 

Three files constains "FORTRAN_forcevariable = ",fortran"", and they are:
1. core/meta/lib/oeqa/selftest/cases/buildoptions.py
2. meta-ros/meta-ros-common/conf/ros-distro/include/enable-fortran.inc
3. meta-openembedded/meta-oe/recipes-devtools/lapack/lapack_3.8.0.bb
Comment 10 ninos 2020-11-19 12:59:25 UTC
Hi Ross

There are other modification I made:
1. in core/meta/recipes-devtools/gcc/gcc-9.2.inc:
   - FORTRAN = ""
   + FORTRAN = ",fortran"
2. in core/meta/recipes-devtools/gcc/gcc-configure-common.inc:
   - FORTRAN ?= ",f77"
   - LANGUAGES ?= "c,c++${FORTRAN}"
   + FORTRAN = ",fortran"
   + LANGUAGES = "c,c++${FORTRAN}"
3. in meta-openembedded/meta-oe/recipes-devtools/lapack/lapack_3.8.0.bb:
   - #FORTRAN_forcevariable = ",fortran"
   - #RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath"
   + FORTRAN_forcevariable = ",fortran"
   + RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath"
4. meta-ros/meta-ros1-melodic/conf/ros-distro/include/melodic/ros-distro.inc:
   - #ROS_UNRESOLVED_PLATFORM_PKG_gfortran = "gfortran"
   + ROS_UNRESOLVED_PLATFORM_PKG_gfortran = "gfortran"
Comment 11 Ross Burton 2020-11-19 17:28:09 UTC
> There are other modification I made:
> 1. in core/meta/recipes-devtools/gcc/gcc-9.2.inc:
>    - FORTRAN = ""
>    + FORTRAN = ",fortran"

Revert this.

> 2. in core/meta/recipes-devtools/gcc/gcc-configure-common.inc:
>    - FORTRAN ?= ",f77"
>    - LANGUAGES ?= "c,c++${FORTRAN}"
>    + FORTRAN = ",fortran"
>    + LANGUAGES = "c,c++${FORTRAN}"

Revert this too.

> 3. in meta-openembedded/meta-oe/recipes-devtools/lapack/lapack_3.8.0.bb:
>    - #FORTRAN_forcevariable = ",fortran"
>    - #RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath"
>    + FORTRAN_forcevariable = ",fortran"
>    + RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath"

That was an example of what to put in local.conf. It's also out of date.  Revert that.

> 4. meta-ros/meta-ros1-melodic/conf/ros-distro/include/melodic/ros-distro.inc:
>    - #ROS_UNRESOLVED_PLATFORM_PKG_gfortran = "gfortran"
>    + ROS_UNRESOLVED_PLATFORM_PKG_gfortran = "gfortran"

I don't know what this is meant to do as I have never used ROS.

The correct approach is to simply add FORTRAN_forcevariable = ",fortran" to your local.conf. Please do just that, reverting your other changes, and see what happens.
Comment 12 Ross Burton 2020-11-19 17:28:42 UTC
(forgot to reset status)
Comment 13 ninos 2020-11-20 01:59:41 UTC
(In reply to comment #11)
> > There are other modification I made:
> > 1. in core/meta/recipes-devtools/gcc/gcc-9.2.inc:
> >    - FORTRAN = ""
> >    + FORTRAN = ",fortran"
> 
> Revert this.
> 
> > 2. in core/meta/recipes-devtools/gcc/gcc-configure-common.inc:
> >    - FORTRAN ?= ",f77"
> >    - LANGUAGES ?= "c,c++${FORTRAN}"
> >    + FORTRAN = ",fortran"
> >    + LANGUAGES = "c,c++${FORTRAN}"
> 
> Revert this too.
> 
> > 3. in meta-openembedded/meta-oe/recipes-devtools/lapack/lapack_3.8.0.bb:
> >    - #FORTRAN_forcevariable = ",fortran"
> >    - #RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath"
> >    + FORTRAN_forcevariable = ",fortran"
> >    + RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath"
> 
> That was an example of what to put in local.conf. It's also out of date. 
> Revert that.
> 
> > 4. meta-ros/meta-ros1-melodic/conf/ros-distro/include/melodic/ros-distro.inc:
> >    - #ROS_UNRESOLVED_PLATFORM_PKG_gfortran = "gfortran"
> >    + ROS_UNRESOLVED_PLATFORM_PKG_gfortran = "gfortran"
> 
> I don't know what this is meant to do as I have never used ROS.
> 
> The correct approach is to simply add FORTRAN_forcevariable = ",fortran" to
> your local.conf. Please do just that, reverting your other changes, and see
> what happens.

I've done those. Build still failed.
I've checked "run.do_configure" and "log.do_configure". They are as same as previous "run.do_configure" and "log.do_configure".
Comment 14 ninos 2020-11-20 02:27:55 UTC
I searched warning and error in log.do_configure, and found following:

1. configure: WARNING: unrecognized options: --disable-dependency-tracking, --with-libtool-sysroot, --enable-languages, --enable-threads, --enable-default-pie, --enable-c99, --enable-long-long, --enable-symvers, --enable-libstdcxx-pch, --without-local-prefix, --enable-lto, --disable-libssp, --enable-libitm, --disable-bootstrap, --disable-libmudflap, --with-system-zlib, --with-linker-hash-style, --enable-linker-build-id, --with-ppl, --with-cloog, --enable-checking, --enable-cheaders, --without-isl, --with-sysroot, --with-build-sysroot, --disable-nls, --with-glibc-version, --enable-initfini-array, --enable-__cxa_atexit

2. configure: error: GNU Fortran is not working
Comment 15 ninos 2020-11-20 02:32:18 UTC
I searched warning and error in log.do_configure, and found following (cont.):

3. libtool.m4: error: problem compiling FC test program
Comment 16 Ross Burton 2020-11-20 11:46:51 UTC
I did a fresh checkout of poky zeus, added FORTRAN_forcevariable = ",fortran" to local.conf, and libgfortan builds fine.

I suggest that either you're not doing the FORTRAN assignment correctly (double check that), or either meta-ros/petalinux is breaking something.

I'd verify that plain poky/zeus works for you, and then contact xilinx for support.
Comment 17 ninos 2020-11-21 04:06:25 UTC
(In reply to comment #16)
> I did a fresh checkout of poky zeus, added FORTRAN_forcevariable =
> ",fortran" to local.conf, and libgfortan builds fine.
Thanks. 
Did you integrate meta-ros while trying this?

> I suggest that either you're not doing the FORTRAN assignment correctly
> (double check that), or either meta-ros/petalinux is breaking something.
What's your procedure of doing this. Maybe I can check yours with mine. 
If you're insterested in how I doing this, I can briefly describe my procedure of building.

> I'd verify that plain poky/zeus works for you, and then contact xilinx for
> support.
That'll be great! Thanks again.
What's the different between plain and fresh checkout of poky/zeus?
Comment 18 ninos 2020-11-21 04:21:44 UTC
(need info)
Comment 19 Ross Burton 2020-11-23 10:22:02 UTC
> > I did a fresh checkout of poky zeus, added FORTRAN_forcevariable =
> > ",fortran" to local.conf, and libgfortan builds fine.
> Thanks. 
> Did you integrate meta-ros while trying this?

No.  This is the main Yocto Project bugzilla for oe-core, if meta-ros is breaking the fortran support then that is a meta-ros issue and should be filed with them.  I verified that poky's fortran support is working fine.

> > I suggest that either you're not doing the FORTRAN assignment correctly
> > (double check that), or either meta-ros/petalinux is breaking something.
> What's your procedure of doing this. Maybe I can check yours with mine. 
> If you're insterested in how I doing this, I can briefly describe my
> procedure of building.
> 
> > I'd verify that plain poky/zeus works for you, and then contact xilinx for
> > support.
> That'll be great! Thanks again.
> What's the different between plain and fresh checkout of poky/zeus?

By plain I meant "a fresh checkout with no other layers added".

Do a fresh git clone of poky and checkout zeus.  Set FORTRAN_forcevariable in local.conf, build libgfortan, verify it builds.  If that works add the pieces that you are using step by step to determine where it breaks.
Comment 20 Ross Burton 2020-12-03 15:59:58 UTC
ninos: did you manage to reproduce?
Comment 21 ninos 2020-12-07 06:03:28 UTC
(In reply to comment #20)
> ninos: did you manage to reproduce?

Not yet. 
Please see https://github.com/ros/meta-ros/issues/766 if you're interested.
Comment 22 Martin Jansa 2020-12-07 13:35:08 UTC
The buildinfo log shows that you have gcc-cross from locked sstate:

WARNING: The gcc-cross-aarch64:do_configure sig is computed to be b82d263638d24146da57a29e794778daf3e61f06f76de7883c75740a4b0230aa, but the sig is locked to ff27bebc760f41bbca5ccfec3bb67f59f0b4bd7de398025251610484956a27b0 in SIGGEN_LOCKEDSIGS_t-x86-64-aarch64
The gcc-cross-aarch64:do_install sig is computed to be 8667e6ca769afb673d644a9d1819f7f143b8f537cb60c0b97426d6eb77a6bd47, but the sig is locked to 3f594128c1168945309268ae13378d6fbcf83dd2b9604133f4e6563181a5aded in SIGGEN_LOCKEDSIGS_t-x86-64-aarch64
The libgcc-initial:do_configure sig is computed to be b99f9fc816611921a723fae10fa6fd005185046d80dbac4448c6d947e2a8b724, but the sig is locked to 4c5ac9cade2d84677670b2b721f16c15f26aa544d6a46bf15f7ee7deae8952d5 in SIGGEN_LOCKEDSIGS_t-aarch64

you need to remove locking for gcc to respect FORTRAN variable.
Comment 23 Ross Burton 2020-12-10 16:22:44 UTC
So yes, this is the system behaving as expected.  You're using locked sstate so you can't alter locked recipes.  You altered the base recipes, the system warned you that your changes are being ignored (the warning in the top of the build log).

If you want to rebuild gcc then unlock your sstate.
Comment 24 ninos 2020-12-12 15:32:01 UTC
Hi Jansa
Thanks for your reply. It works.