#3262 assigned defect

GCC-4 Build failure with GCC-4.3+

Reported by: Gedare Bloom Owned by: Chris Johns
Priority: normal Milestone: 4.10.3
Component: tool/rsb Version: 4.10
Severity: normal Keywords:
Cc: Blocked By: #2439

Description (last modified by Gedare Bloom)

While building 4.10 tools (gcc-4.4.7) with gcc 5.4, I stumbled on the issue discussed at https://bugzilla.redhat.com/show_bug.cgi?id=476370

The gcc build apparently needs -fgnu89-inline

I hacked the following fix locally in my 4.10 RSB branch, but am not sure of the appropriate long-term solution:

diff --git a/source-builder/config/gcc-common-1.cfg b/source-builder/config/gcc-common-1.cfg
index 941e15c..d2608ec 100644
--- a/source-builder/config/gcc-common-1.cfg
+++ b/source-builder/config/gcc-common-1.cfg
@@ -167,7 +167,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
     cp ../${source_dir_gcc}/gcc/gsyslimits.h gcc/include/syslimits.h
-  %{__make} %{?_smp_mflags} all
+  %{__make} %{?_smp_mflags} CFLAGS="-fgnu89-inline" all
   cd ${build_top}

Change History (10)

comment:1 Changed on Dec 19, 2017 at 1:56:02 PM by Gedare Bloom

Owner: set to Chris Johns
Status: newassigned

comment:2 Changed on Dec 19, 2017 at 1:56:59 PM by Gedare Bloom

Description: modified (diff)

comment:3 Changed on Dec 21, 2017 at 4:27:17 AM by Chris Johns

I am also not sure if it is an issue on other host OSes or distros. Is this specific to RedHat?? We would need to check Windows, MacOS and FreeBSD to know.

I am sorry I have no unfunded time for 4.10 issues. Maybe the Milestone should be indefinite.

comment:4 Changed on Jan 5, 2018 at 4:51:03 PM by Joel Sherrill

This is needed on the 4.10 branch to build tools with GCC >= 4.3 but the option does not exist on older GCC's. Given that 4.3 is quite old, any recent distribution should be OK. But if someone updated on an old distribution with a gcc < 4.3, this option should not be present.

Is there a clean way to make this CFLAGS="-fgnu89-inline" default to on but let someone disable it if they are still on an old distribution? They would be using a host OS which is completely unsupported since even CentOS 6 had a gcc new enough.

Chris? What would be the cleanest way to achieve this? We need to be able to build 4.10 on recent environments.

comment:5 in reply to:  4 Changed on Jan 15, 2018 at 11:26:14 PM by Chris Johns

Replying to Joel Sherrill:

Chris? What would be the cleanest way to achieve this? We need to be able to build 4.10 on recent environments.

Test on the hosts this release must support. I have not been able to find that list?

comment:6 Changed on Jan 16, 2018 at 7:02:43 AM by Chris Johns

The change posted in the description is not suitable. The flags cannot be set on make's command line this way as it overrides any RSB derived flag updates. A better solution is to use:

 %global _gcclibdir %{_prefix}/lib

+# Update the build flags need to build the older gcc with newer compilers.
+%define build_cflags %{build_cflags} -fgnu89-inline

The -fgnu89-inline is not needed on FreeBSD, adding it does not harm the build.

The FreeBSD builds all fail with the same problem reported in #3027 on the 4.11 branch, building makeinfo. Adding the patch from that ticket lets the ARM architecture build but it then fails with a number of these error messages:

../../../../gcc-4.4.7/libgcc/../gcc/config/arm/ieee754-sf.S: Assembler messages:
../../../../gcc-4.4.7/libgcc/../gcc/config/arm/ieee754-sf.S:452: Error: invalid constant (ff) after fixup
../../../../gcc-4.4.7/libgcc/../gcc/config/arm/ieee754-sf.S:518: Error: invalid constant (7f) after fixup

comment:7 Changed on Jan 16, 2018 at 7:12:30 AM by Chris Johns

The ARM build issue is the same as #2439. Using binutils-2.26 fixes the issue.

comment:8 Changed on Jan 16, 2018 at 9:49:47 AM by Chris Johns

All but SPARC and AVR build with this version of binutils. The SPARC builds with the current binutils-2.20 and the AVR looks like something unrelated and I wonder if it built before now on FreeBSD.

As a result ARM needs to change it's binutils version.

comment:9 Changed on Jan 22, 2018 at 10:52:01 PM by Chris Johns <chrisj@…>

In f7ecb55/rtems-source-builder:

gcc: Update the MPC part of gcc to 1.0.3 as it is available on GNU's FTP.

Update #3262

comment:10 Changed on Jan 23, 2018 at 3:03:54 AM by Chris Johns

Blocked By: 2439 added
Note: See TracTickets for help on using tickets.