[Buildroot] [PATCH] gcc: apply PowerPC patch when needed

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri Jul 5 08:40:52 UTC 2013

When converting gcc to the package infrastructure, a specific thing
for PowerPC was forgotten: applying the conditional patch
powerpc-link-with-math-lib.patch.conditional. This breaks the build of
some PowerPC toolchains, with failures such as:

<http://jenkins.free-electrons.com/job/buildroot/./config=qemu_ppc_virtex_ml507_defconfig/ws/output/host/usr/lib/gcc/powerpc-buildroot-linux-uclibc/4.7.3/../../../../powerpc-buildroot-linux-uclibc/lib/libgcc_s.so.1>: undefined reference to `copysignl'

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Anyone knows why we have this conditional patch? Can't it be made a
normal patch, with the appropriate modifications? Why isn't that
upstream since all those years?
 package/gcc/gcc.mk | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index 790762d..968354b 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -38,8 +38,17 @@ endef
 # Apply patches
+ifeq ($(ARCH)-$(BR2_GCC_SHARED_LIBGCC),powerpc-y)
+ifneq ($(BR2_SOFT_FLOAT),)
+	support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional
 	support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) \*.patch

More information about the buildroot mailing list