[8/9] gcc-7.2: Fix libgfortran build

Message ID 20171212172317.601-8-raj.khem@gmail.com
State New
Headers show
Series
  • [1/9] binutils: update to 2.29.1
Related show

Commit Message

Khem Raj Dec. 12, 2017, 5:23 p.m.
From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>


Without this patch libbacktrace cannot be included/link during
libgfortran build.

libbtool: link: cannot find the library
`../libbacktrace/libbacktrace.la'
or unhandled argument `../libbacktrace/libbacktrace.la

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 meta/recipes-devtools/gcc/gcc-7.2.inc              |  1 +
 .../gcc/gcc-7.2/0051-Fix-gfortran-build.patch      | 53 ++++++++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-gfortran-build.patch

-- 
2.15.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Richard Purdie Dec. 19, 2017, 11:08 a.m. | #1
On Tue, 2017-12-12 at 09:23 -0800, Khem Raj wrote:
> From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> 
> Without this patch libbacktrace cannot be included/link during
> libgfortran build.
> 
> libbtool: link: cannot find the library
> `../libbacktrace/libbacktrace.la'
> or unhandled argument `../libbacktrace/libbacktrace.la
> 
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/recipes-devtools/gcc/gcc-7.2.inc              |  1 +
>  .../gcc/gcc-7.2/0051-Fix-gfortran-build.patch      | 53
> ++++++++++++++++++++++
>  2 files changed, 54 insertions(+)
>  create mode 100644 meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-
> gfortran-build.patch
> 
> diff --git a/meta/recipes-devtools/gcc/gcc-7.2.inc b/meta/recipes-
> devtools/gcc/gcc-7.2.inc
> index 1d40cba731..baf98aeba8 100644
> --- a/meta/recipes-devtools/gcc/gcc-7.2.inc
> +++ b/meta/recipes-devtools/gcc/gcc-7.2.inc
> @@ -75,6 +75,7 @@ SRC_URI = "\
>             file://0048-gcc-Enable-static-PIE.patch \
>             file://fix-segmentation-fault-precompiled-hdr.patch \
>             file://0050-RISC-V-Handle-non-legitimate-address-in-
> riscv_legiti.patch \
> +           file://0051-Fix-gfortran-build.patch \
>             ${BACKPORTS} \
>  "
>  BACKPORTS = "\
> diff --git a/meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-gfortran-
> build.patch b/meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-gfortran-
> build.patch
> new file mode 100644
> index 0000000000..a71b6b0bee
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-gfortran-build.patch
> @@ -0,0 +1,53 @@
> +Without this patch libbacktrace cannot be included/link during
> +libgfortran build.
> +
> +libbtool: link: cannot find the library
> `../libbacktrace/libbacktrace.la'
> +or unhandled argument `../libbacktrace/libbacktrace.la'
> +
> +Upstream-Status: Inappropriate [OE specific]
> +Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> +
> +diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
> +index 2857af5943f9..e07760069a3c 100644
> +--- a/libgfortran/Makefile.am
> ++++ b/libgfortran/Makefile.am
> +@@ -37,7 +37,7 @@ toolexeclib_LTLIBRARIES = libgfortran.la
> + 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
> +@@ -64,7 +64,7 @@ AM_CPPFLAGS = -iquote$(srcdir)/io
> -I$(srcdir)/$(MULTISRCTOP)../gcc \
> + 	      -I$(MULTIBUILDTOP)../libgcc \
> + 	      -I$(srcdir)/$(MULTISRCTOP)../libbacktrace \
> + 	      -I$(MULTIBUILDTOP)../libbacktrace \
> +-	      -I../libbacktrace
> ++	      -I../../libbacktrace
> + 
> + # Fortran rules for complex multiplication and division
> + AM_CFLAGS += -fcx-fortran-rules
> +diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
> +index 05b183dcadb0..c9e0280e412c 100644
> +--- a/libgfortran/Makefile.in
> ++++ b/libgfortran/Makefile.in
> +@@ -581,7 +581,7 @@ toolexeclib_LTLIBRARIES = libgfortran.la
> + 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
> +@@ -602,7 +602,7 @@ AM_CPPFLAGS = -iquote$(srcdir)/io
> -I$(srcdir)/$(MULTISRCTOP)../gcc \
> + 	      -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 = \

Did you try this for something other than x86_64? I think this won't
work when cross compiling and host != target.

I do have a better fix which might work in mind...

Cheers,

Richard
Ricardo Ribalda Delgado Dec. 19, 2017, 2:19 p.m. | #2
Hi Richard

My target is a X86_64 camera, and I have only tried with it.

On Tue, Dec 19, 2017 at 12:08 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Tue, 2017-12-12 at 09:23 -0800, Khem Raj wrote:

>> From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

>>

>> Without this patch libbacktrace cannot be included/link during

>> libgfortran build.

>>

>> libbtool: link: cannot find the library

>> `../libbacktrace/libbacktrace.la'

>> or unhandled argument `../libbacktrace/libbacktrace.la

>>

>> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

>> Signed-off-by: Khem Raj <raj.khem@gmail.com>

>> ---

>>  meta/recipes-devtools/gcc/gcc-7.2.inc              |  1 +

>>  .../gcc/gcc-7.2/0051-Fix-gfortran-build.patch      | 53

>> ++++++++++++++++++++++

>>  2 files changed, 54 insertions(+)

>>  create mode 100644 meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-

>> gfortran-build.patch

>>

>> diff --git a/meta/recipes-devtools/gcc/gcc-7.2.inc b/meta/recipes-

>> devtools/gcc/gcc-7.2.inc

>> index 1d40cba731..baf98aeba8 100644

>> --- a/meta/recipes-devtools/gcc/gcc-7.2.inc

>> +++ b/meta/recipes-devtools/gcc/gcc-7.2.inc

>> @@ -75,6 +75,7 @@ SRC_URI = "\

>>             file://0048-gcc-Enable-static-PIE.patch \

>>             file://fix-segmentation-fault-precompiled-hdr.patch \

>>             file://0050-RISC-V-Handle-non-legitimate-address-in-

>> riscv_legiti.patch \

>> +           file://0051-Fix-gfortran-build.patch \

>>             ${BACKPORTS} \

>>  "

>>  BACKPORTS = "\

>> diff --git a/meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-gfortran-

>> build.patch b/meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-gfortran-

>> build.patch

>> new file mode 100644

>> index 0000000000..a71b6b0bee

>> --- /dev/null

>> +++ b/meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-gfortran-build.patch

>> @@ -0,0 +1,53 @@

>> +Without this patch libbacktrace cannot be included/link during

>> +libgfortran build.

>> +

>> +libbtool: link: cannot find the library

>> `../libbacktrace/libbacktrace.la'

>> +or unhandled argument `../libbacktrace/libbacktrace.la'

>> +

>> +Upstream-Status: Inappropriate [OE specific]

>> +Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

>> +

>> +diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am

>> +index 2857af5943f9..e07760069a3c 100644

>> +--- a/libgfortran/Makefile.am

>> ++++ b/libgfortran/Makefile.am

>> +@@ -37,7 +37,7 @@ toolexeclib_LTLIBRARIES = libgfortran.la

>> + 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

>> +@@ -64,7 +64,7 @@ AM_CPPFLAGS = -iquote$(srcdir)/io

>> -I$(srcdir)/$(MULTISRCTOP)../gcc \

>> +           -I$(MULTIBUILDTOP)../libgcc \

>> +           -I$(srcdir)/$(MULTISRCTOP)../libbacktrace \

>> +           -I$(MULTIBUILDTOP)../libbacktrace \

>> +-          -I../libbacktrace

>> ++          -I../../libbacktrace

>> +

>> + # Fortran rules for complex multiplication and division

>> + AM_CFLAGS += -fcx-fortran-rules

>> +diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in

>> +index 05b183dcadb0..c9e0280e412c 100644

>> +--- a/libgfortran/Makefile.in

>> ++++ b/libgfortran/Makefile.in

>> +@@ -581,7 +581,7 @@ toolexeclib_LTLIBRARIES = libgfortran.la

>> + 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

>> +@@ -602,7 +602,7 @@ AM_CPPFLAGS = -iquote$(srcdir)/io

>> -I$(srcdir)/$(MULTISRCTOP)../gcc \

>> +           -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 = \

>

> Did you try this for something other than x86_64? I think this won't

> work when cross compiling and host != target.

>

> I do have a better fix which might work in mind...

>

> Cheers,

>

> Richard

>




-- 
Ricardo Ribalda
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-7.2.inc b/meta/recipes-devtools/gcc/gcc-7.2.inc
index 1d40cba731..baf98aeba8 100644
--- a/meta/recipes-devtools/gcc/gcc-7.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-7.2.inc
@@ -75,6 +75,7 @@  SRC_URI = "\
            file://0048-gcc-Enable-static-PIE.patch \
            file://fix-segmentation-fault-precompiled-hdr.patch \
            file://0050-RISC-V-Handle-non-legitimate-address-in-riscv_legiti.patch \
+           file://0051-Fix-gfortran-build.patch \
            ${BACKPORTS} \
 "
 BACKPORTS = "\
diff --git a/meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-gfortran-build.patch b/meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-gfortran-build.patch
new file mode 100644
index 0000000000..a71b6b0bee
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-7.2/0051-Fix-gfortran-build.patch
@@ -0,0 +1,53 @@ 
+Without this patch libbacktrace cannot be included/link during
+libgfortran build.
+
+libbtool: link: cannot find the library `../libbacktrace/libbacktrace.la'
+or unhandled argument `../libbacktrace/libbacktrace.la'
+
+Upstream-Status: Inappropriate [OE specific]
+Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+
+diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
+index 2857af5943f9..e07760069a3c 100644
+--- a/libgfortran/Makefile.am
++++ b/libgfortran/Makefile.am
+@@ -37,7 +37,7 @@ toolexeclib_LTLIBRARIES = libgfortran.la
+ 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
+@@ -64,7 +64,7 @@ AM_CPPFLAGS = -iquote$(srcdir)/io -I$(srcdir)/$(MULTISRCTOP)../gcc \
+ 	      -I$(MULTIBUILDTOP)../libgcc \
+ 	      -I$(srcdir)/$(MULTISRCTOP)../libbacktrace \
+ 	      -I$(MULTIBUILDTOP)../libbacktrace \
+-	      -I../libbacktrace
++	      -I../../libbacktrace
+ 
+ # Fortran rules for complex multiplication and division
+ AM_CFLAGS += -fcx-fortran-rules
+diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
+index 05b183dcadb0..c9e0280e412c 100644
+--- a/libgfortran/Makefile.in
++++ b/libgfortran/Makefile.in
+@@ -581,7 +581,7 @@ toolexeclib_LTLIBRARIES = libgfortran.la
+ 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
+@@ -602,7 +602,7 @@ AM_CPPFLAGS = -iquote$(srcdir)/io -I$(srcdir)/$(MULTISRCTOP)../gcc \
+ 	      -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 = \