Skip to contentSkip to conversation

gcc: make sure we don't have a copy of libiberty.a in host library dir

PATCH New Anthony Viallard 2 participants 5 messages Jul 16, 2015 – Aug 4, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gcc: make sure we don't have a copy of libiberty.a in host library dir

With old gcc version (like with 4.7.4), libiberty.a is copied to library directory and it's not the behavior we want.

According to Arnout Vandecappelle, newer version of gcc have fixed the problem. But if you choose gcc 4.7.X, the problem is there. Therefore, I send this little patch which remove the bad file after the build is finished.

---
 package/gcc/gcc-final/gcc-final.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/gcc/gcc-final/gcc-final.mk +6 -0
index 16bf4ee..2cce860 100644
@@ -185,6 +185,12 @@ endef
 HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_USR_LIBS
 endif
 
+define HOST_GCC_FINAL_RM_LIBIBERTY_A
+	rm -f $(HOST_DIR)/usr/lib/libiberty.a
+endef
+
+HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_RM_LIBIBERTY_A
+
 ifeq ($(BR2_xtensa),y)
 HOST_GCC_FINAL_CONF_OPTS += --enable-cxx-flags="$(TARGET_ABI)"
 endif
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 gcc: make sure we don't have a copy of libiberty.a in host library dir

Hi Anthony,

Le 16/07/2015 11:39, Anthony Viallard a ?crit :

Quoted 10 lines

With old gcc version (like with 4.7.4), libiberty.a is copied to library directory and it's not the behavior we want.

According to Arnout Vandecappelle, newer version of gcc have fixed the problem. But if you choose gcc 4.7.X, the problem is there. Therefore, I send this little patch which remove the bad file after the build is finished.

---

Thanks for your patch!

I had the same issue with gcc-4.8 and I tried to fix it with the following patches (which was rejected):

http://patchwork.ozlabs.org/patch/460494/
http://patchwork.ozlabs.org/patch/449686/

However, after some investigation, here is the right fix from upstream:
http://patchwork.ozlabs.org/patch/470531/

The --disable-install-libiberty option was broken, that's why the internal libiberty.a was installed in HOST_DIR.

Hopefully, the same patch apply on gcc-4.7:
http://patchwork.ozlabs.org/patch/500445/

Care to test it ?

Best regards,
Romain Naour

Quoted 21 lines
 package/gcc/gcc-final/gcc-final.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/gcc/gcc-final/gcc-final.mk +6 -0
index 16bf4ee..2cce860 100644
@@ -185,6 +185,12 @@ endef
 HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_USR_LIBS
 endif
 
+define HOST_GCC_FINAL_RM_LIBIBERTY_A
+	rm -f $(HOST_DIR)/usr/lib/libiberty.a
+endef
+
+HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_RM_LIBIBERTY_A
+
 ifeq ($(BR2_xtensa),y)
 HOST_GCC_FINAL_CONF_OPTS += --enable-cxx-flags="$(TARGET_ABI)"
 endif
#2 lore raw

PATCH 1/1 gcc: make sure we don't have a copy of libiberty.a in host library dir

Quoted 9 lines · Romain Naour

The --disable-install-libiberty option was broken, that's why the internal libiberty.a was installed in HOST_DIR.

Hopefully, the same patch apply on gcc-4.7:
http://patchwork.ozlabs.org/patch/500445/

Care to test it ?

Hi Romain,

I tested the above patch but it doesn't work. The library 'libiberty.a' is copied in 'output/host/usr/lib/'.

Maybe I missed somethings ?

I put the patch in the file 'package/gcc/4.7.4/920-fix-disable-install-libiberty-option.patch' and add --disable-install-libiberty flag in HOST_GCC_COMMON_CONF_OPTS variable of the gcc package.

----

package/gcc/gcc.mk +2 -1
index be242cb..c23fe40 100644
@@ -93,7 +93,8 @@ HOST_GCC_COMMON_CONF_OPTS = \
         --with-gmp=$(HOST_DIR)/usr \
         --with-mpfr=$(HOST_DIR)/usr \
         --with-pkgversion="Buildroot $(BR2_VERSION_FULL)" \
-       --with-bugurl="http://bugs.buildroot.net/"
+       --with-bugurl="http://bugs.buildroot.net/" \
+       --disable-install-libiberty
 
  # Don't build documentation. It takes up extra space / build time,
  # and sometimes needs specific makeinfo versions to work

----

and did the following command:

$ rm -rf output && make

I see the flag --disable-install-libiberty in my log so it seems to be applied but the problem is always there.

Have you tried the patch on your side ?

Regards,
Anthony.

#3 lore raw

PATCH 1/1 gcc: make sure we don't have a copy of libiberty.a in host library dir

Hi Anthony,

----- Mail original -----

Quoted 17 lines

De: "Viallard Anthony" <[email protected]>
?: "Romain Naour" <[email protected]>, buildroot at buildroot.org
Envoy?: Mardi 4 Ao?t 2015 11:42:58
Objet: Re: [Buildroot] [PATCH 1/1] gcc: make sure we don't have a copy of libiberty.a in host library dir

Quoted 10 lines · Romain Naour

The --disable-install-libiberty option was broken, that's why the internal
libiberty.a was installed in HOST_DIR.

Hopefully, the same patch apply on gcc-4.7:
http://patchwork.ozlabs.org/patch/500445/

Care to test it ?

Quoted 7 lines

Hi Romain,

I tested the above patch but it doesn't work. The library 'libiberty.a'
is copied in 'output/host/usr/lib/'.

Maybe I missed somethings ?

Weird...

Quoted 24 lines

I put the patch in the file 'package/gcc/4.7.4/920-fix-disable-install-libiberty-option.patch' and
add --disable-install-libiberty flag in HOST_GCC_COMMON_CONF_OPTS variable of the gcc package.

----

package/gcc/gcc.mk +2 -2
index be242cb..c23fe40 100644
@@ -93,7 +93,8 @@ HOST_GCC_COMMON_CONF_OPTS = \
         --with-gmp=$(HOST_DIR)/usr \
         --with-mpfr=$(HOST_DIR)/usr \
         --with-pkgversion="Buildroot $(BR2_VERSION_FULL)" \
-       --with-bugurl="http://bugs.buildroot.net/"
+       --with-bugurl="http://bugs.buildroot.net/" \
+       --disable-install-libiberty
 
  # Don't build documentation. It takes up extra space / build time,
  # and sometimes needs specific makeinfo versions to work
----
Quoted 8 lines

and did the following command:

$ rm -rf output && make

I see the flag --disable-install-libiberty in my log so it seems to be
applied but the problem is always there.

Have you tried the patch on your side ?

Yes, I tried the patch and I had another issue with my host gcc (gcc5) which was fixed by :
http://git.buildroot.net/buildroot/commit/?id=c63d2b977adf545ab733447a532cff05cb155e95

Let me give another try.
Also, can you test against latest master ?

Best regards,
Romain

Quoted 5 lines

Regards,
Anthony.

#4 lore raw

PATCH 1/1 gcc: make sure we don't have a copy of libiberty.a in host library dir

Hi Anthony,

----- Mail original -----

Quoted 77 lines

De: "Romain Naour" <[email protected]>
?: "Viallard Anthony" <[email protected]>
Cc: buildroot at buildroot.org
Envoy?: Mardi 4 Ao?t 2015 11:54:51
Objet: Re: [Buildroot] [PATCH 1/1] gcc: make sure we don't have a copy of libiberty.a in host library dir

Hi Anthony,

----- Mail original -----

Quoted 19 lines

De: "Viallard Anthony" <[email protected]> ?: "Romain Naour" <[email protected]>,
buildroot at buildroot.org
Envoy?: Mardi 4 Ao?t 2015 11:42:58
Objet: Re: [Buildroot] [PATCH 1/1] gcc: make sure we don't have a copy of libiberty.a in host library dir

Quoted 10 lines · Romain Naour

The --disable-install-libiberty option was broken, that's why the internal
libiberty.a was installed in HOST_DIR.

Hopefully, the same patch apply on gcc-4.7:
http://patchwork.ozlabs.org/patch/500445/

Care to test it ?

Quoted 7 lines

Hi Romain,

I tested the above patch but it doesn't work. The library 'libiberty.a'
is copied in 'output/host/usr/lib/'.

Maybe I missed somethings ?

Weird...

Quoted 25 lines

I put the patch in the file 'package/gcc/4.7.4/920-fix-disable-install-libiberty-option.patch' and
add --disable-install-libiberty flag in HOST_GCC_COMMON_CONF_OPTS variable of the gcc package.

----

package/gcc/gcc.mk +2 -1
index be242cb..c23fe40 100644
@@ -93,7 +93,8 @@ HOST_GCC_COMMON_CONF_OPTS = \
         --with-gmp=$(HOST_DIR)/usr \
         --with-mpfr=$(HOST_DIR)/usr \
         --with-pkgversion="Buildroot $(BR2_VERSION_FULL)" \
-       --with-bugurl="http://bugs.buildroot.net/"
+       --with-bugurl="http://bugs.buildroot.net/" \
+       --disable-install-libiberty
 
  # Don't build documentation. It takes up extra space / build
  time,
  # and sometimes needs specific makeinfo versions to work
----
Quoted 8 lines

and did the following command:

$ rm -rf output && make

I see the flag --disable-install-libiberty in my log so it seems to be
applied but the problem is always there.

Have you tried the patch on your side ?

Yes, I tried the patch and I had another issue with my host gcc (gcc5)
which was fixed by :
http://git.buildroot.net/buildroot/commit/?id=c63d2b977adf545ab733447a532cff05cb155e95

Quoted 2 lines

Let me give another try.
Also, can you test against latest master ?

The gcc issue is fixed, but I tried with binutils-2.24 which is used by default. Do you use binutils-2.23.2 or a previous version ?

Probably, the issue is not fixed with this version...
can you copy package/binutils/arc-2015.06/0001-PR-other-56780.patch into package/binutils/2.23.2/0001-PR-other-56780.patch ?

Best regards,
Romain

Quoted 13 lines

Best regards,
Romain

Quoted 5 lines

Regards,
Anthony.

_______________________________________________
buildroot mailing list buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot