#2779 new defect

building rtems-4.10 using rsb 4.12 (git upstream) fails due to several erros

Reported by: Christian Spindeldreier Owned by:
Priority: normal Milestone: 4.10.3
Component: tool/rsb Version: 4.10
Severity: major Keywords: RSB, 4.10, GCC5
Cc: Blocked By:
Blocking:

Description

Building rtems-4.10 using the rtems-source-builder upstream version from git fails due to several bugs in the rsb script:

  • including rtems-version.bset in config/rtems-base.bset overwrites rtems_version variable set in rtems-4.10-base.bset
    • fix: remove remove config/version.bset and add "%define rtems_version 4.12" to config/4.12/rtems-default.bset
  • rsb tries to download the rtems kernel from repository instead from ftp server
    • fix: add "%define rsb_version 4.10.2" to config/tools/rtems-kernel-4.10.2.cfg
  • building gcc-4.4.7 using gcc-5.x fails (tested gcc-5.4 on ubuntu 16.04 x64)
    • fix: add attached gcc-4.4.7 patch gcc-core-4.4.7-rtems4.10-gcc5.diff to config/tools/rtems-gcc-4.4.7-newlib-1.18.0-1

gcc-core-4.4.7-rtems4.10-gcc5.diff

--- gcc-4.4.7-orig/gcc/cp/cfns.h.orig
+++ gcc-4.4.7/gcc/cp/cfns.h
@@ -36,6 +36,9 @@
 static unsigned int hash (const char *, unsigned int);
 #ifdef __GNUC__
 __inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
 #endif
 const char * libc_name_p (const char *, unsigned int);
 /* maximum key range = 391, duplicates = 0 */
@@ -79,7 +82,7 @@
       400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
       400, 400, 400, 400, 400, 400, 400
     };
-  register int hval = len;
+  register int hval = (int)len;
 
   switch (hval)
     {

--- gcc-4.4.7-orig/gcc/toplev.c
+++ gcc-4.4.7/gcc/toplev.c
@@ -527,7 +527,7 @@
    for floor_log2 and exact_log2; see toplev.h.  That construct, however,
    conflicts with the ISO C++ One Definition Rule.   */
 
-#if ((GCC_VERSION < 3004) || defined(__clang__)) || !defined (__cplusplus)
+#if (GCC_VERSION < 3004)
 
 /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
    If X is 0, return -1.  */
@@ -579,7 +579,7 @@
 #endif
 }
 
-#endif /*  GCC_VERSION < 3004 || !defined (__cplusplus)  */
+#endif /*  GCC_VERSION < 3004 */
 
 /* Handler for fatal signals, such as SIGSEGV.  These are transformed
    into ICE messages, which is much more user friendly.  In case the


--- gcc-4.4.7-orig/gcc/toplev.h
+++ gcc-4.4.7/gcc/toplev.h
@@ -167,6 +167,7 @@
 extern bool fast_math_flags_set_p	(void);
 extern bool fast_math_flags_struct_set_p (struct cl_optimization *);
 
+#if (GCC_VERSION < 3004)
 /* Return log2, or -1 if not exact.  */
 extern int exact_log2                  (unsigned HOST_WIDE_INT);
 
@@ -174,7 +175,7 @@
 extern int floor_log2                  (unsigned HOST_WIDE_INT);
 
 /* Inline versions of the above for speed.  */
-#if (GCC_VERSION >= 3004) && !defined(__clang__)
+#else /* (GCC_VERSION >= 3004) */
 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
 #  define CLZ_HWI __builtin_clzl
 #  define CTZ_HWI __builtin_ctzl
@@ -186,13 +187,13 @@
 #  define CTZ_HWI __builtin_ctz
 # endif
 
-extern inline int
+static inline int
 floor_log2 (unsigned HOST_WIDE_INT x)
 {
   return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1;
 }
 
-extern inline int
+static inline int
 exact_log2 (unsigned HOST_WIDE_INT x)
 {
   return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1;

Attachments (1)

gcc-core-4.4.7-rtems4.10-gcc5.diff (2.2 KB) - added by Christian Spindeldreier on Aug 23, 2016 at 8:52:08 AM.
GCC-4.4.7 patch enabling build with gcc-5.x

Download all attachments as: .zip

Change History (2)

Changed on Aug 23, 2016 at 8:52:08 AM by Christian Spindeldreier

GCC-4.4.7 patch enabling build with gcc-5.x

comment:1 Changed on Aug 14, 2017 at 12:51:46 AM by Chris Johns

Milestone: 4.10.3
Note: See TracTickets for help on using tickets.