diff mbox series

[v2,1/2] gfortran: update runtime dependencies

Message ID 20240614232131.1036271-2-kai.kang@windriver.com
State New
Headers show
Series Update for gfortran | expand

Commit Message

Kai June 14, 2024, 11:21 p.m. UTC
From: Kai Kang <kai.kang@windriver.com>

It fails to run both `gcc` and `gfortran` with errors:

| root@qemux86-64:~# x86_64-poky-linux-gcc a.c
| x86_64-poky-linux-gcc: fatal error: cannot execute 'as': posix_spawnp: No such file or directory

then add binutils which provides `as` to RDEPENDS of gcc.

libgfortran-dev provides libgfortran.spec which required by gfortran:

| root@qemux86-64:~# gfortran hello.f95
| gfortran: fatal error: cannot read spec file 'libgfortran.spec': No such file or directory

And gcc provides liblto_plugin.so:

| root@qemux86-64:~# gfortran hello.f95
| gfortran: fatal error: '-fuse-linker-plugin', but liblto_plugin.so not found

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/recipes-devtools/gcc/gcc-target.inc | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
index 82da5ef82b..daf24741aa 100644
--- a/meta/recipes-devtools/gcc/gcc-target.inc
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -34,7 +34,7 @@  PACKAGES = "\
     g++ g++-symlinks \
     cpp cpp-symlinks \
     g77 g77-symlinks \
-    gfortran gfortran-symlinks \
+    ${@bb.utils.contains('FORTRAN', ',fortran', 'gfortran gfortran-symlinks', '', d)} \
     gcov gcov-symlinks \
     ${PN}-doc \
     ${PN}-dev \
@@ -61,7 +61,7 @@  RRECOMMENDS:${PN} += "\
     libssp \
     libssp-dev \
 "
-RDEPENDS:${PN} += "cpp"
+RDEPENDS:${PN} += "binutils cpp"
 
 FILES:${PN}-dev = "\
     ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
@@ -94,10 +94,15 @@  RRECOMMENDS:g77 = "\
     libg2c-dev \
 "
 
+INSANE_SKIP:gfortran += "dev-deps"
 FILES:gfortran = "\
     ${bindir}/${TARGET_PREFIX}gfortran \
     ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
 "
+RDEPENDS:gfortran = "\
+    gcc \
+    libgfortran-dev \
+"
 RRECOMMENDS:gfortran = "\
     libquadmath \
     libquadmath-dev \