Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search




Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Building rockbox cross-toolchain with gcc 5.x: add -std=gnu89 to CFLAGS
« previous next »
  • Print
Pages: [1]

Author Topic: Building rockbox cross-toolchain with gcc 5.x: add -std=gnu89 to CFLAGS  (Read 2333 times)

Offline ivi

  • Member
  • *
  • Posts: 1
Building rockbox cross-toolchain with gcc 5.x: add -std=gnu89 to CFLAGS
« on: March 31, 2016, 04:43:33 PM »
Hi,

one of the changes in gcc 5 was in the way extern inline is handled with the new default GNU11 C standard (see https://gcc.gnu.org/gcc-5/porting_to.html), which in turn breaks the build of gcc 4.4.4.

In order to fix this, you can patch rockboxdev.sh in the following way to get back to the previously used GNU89 C standard, which will then allow you to successfully compile the cross gcc 4.4.4:

Code: [Select]
@@ -211,7 +211,7 @@
             ./configure --prefix=$prefix $configure_params
         ;;
         *)
-            CFLAGS=-U_FORTIFY_SOURCE ../$toolname-$version/configure --target=$target --prefix=$prefix --enable-languages=c --disable-libssp --disable-docs $configure_params
+            CFLAGS="-U_FORTIFY_SOURCE -std=gnu89" ../$toolname-$version/configure --target=$target --prefix=$prefix --enable-languages=c --disable-libssp --disable-docs $configure_params
         ;;
     esac

This should also not harm any older versions of gcc, so someone with commit rights could also apply this to git (I don't have a system available right now with older gcc's to test this, though).

Regards,
Ingmar
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Building rockbox cross-toolchain with gcc 5.x: add -std=gnu89 to CFLAGS
« Reply #1 on: April 01, 2016, 03:06:53 AM »
Yeah, I should add all this to our Gerrit instance I suppose.

I have a tonne of environment related commits sitting in my local tree that I should really get merged upstream.

You've actually made me feel overwhelmingly lazy, because apparently I figured this out in at least October of 2015 against gcc-4.9 (actually, lord only knows when I figured this out because at this point I apparently already had this in my local tree and knew it was an issue for modern gcc instances and what to do about it when another user hit the same issue - makes it somewhat worse I suppose...), we used slightly different approaches (-fgnu89-inline vs. -std=gnu89), but the end result is the same.


[Saint]
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline jawsdaws

  • Member
  • *
  • Posts: 1
Re: Building rockbox cross-toolchain with gcc 5.x: add -std=gnu89 to CFLAGS
« Reply #2 on: May 25, 2016, 10:03:28 AM »
Thanks for this, ivi!  I had this error this morning.
Logged

Offline Massa

  • Developer
  • Member
  • *
  • Posts: 201
  • ROCKbox for purchasable devices should be the goal
Re: Building rockbox cross-toolchain with gcc 5.x: add -std=gnu89 to CFLAGS
« Reply #3 on: October 31, 2016, 06:22:47 AM »
Has this been integrated in the sources meanwhile?
Or is this patch still needed?

If yes, which one of the two solutions is the better one?

[Edit]
I answer myself: the patch is still needed ???
(did no dev with commit access find time in the last six months to check this in? ::))
[/Edit]
« Last Edit: October 31, 2016, 08:26:26 AM by Massa »
Logged
iRiver H340 International with NON LCD-Remote
iPod Classic 160G (6.Gen)
iPod Video (Classic 5.5G) with iFlash-Quad Adapter and SDXC - currently 256G

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Building rockbox cross-toolchain with gcc 5.x: add -std=gnu89 to CFLAGS
« Reply #4 on: November 08, 2016, 08:41:41 PM »
I'm guessing you're just building armeabi?


[Saint]
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Massa

  • Developer
  • Member
  • *
  • Posts: 201
  • ROCKbox for purchasable devices should be the goal
Re: Building rockbox cross-toolchain with gcc 5.x: add -std=gnu89 to CFLAGS
« Reply #5 on: November 09, 2016, 06:17:23 AM »
Yes.

Why do you ask? Are there issues with this change for other platforms?
Logged
iRiver H340 International with NON LCD-Remote
iPod Classic 160G (6.Gen)
iPod Video (Classic 5.5G) with iFlash-Quad Adapter and SDXC - currently 256G

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Building rockbox cross-toolchain with gcc 5.x: add -std=gnu89 to CFLAGS
« Reply #6 on: November 09, 2016, 01:25:16 PM »
Quote from: Massa on November 09, 2016, 06:17:23 AM
Yes.

Why do you ask? Are there issues with this change for other platforms?


Yes.


[Saint]
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Building rockbox cross-toolchain with gcc 5.x: add -std=gnu89 to CFLAGS
 

  • SMF 2.0.6 | SMF © 2013, Simple Machines
  • XHTML
  • RSS
  • WAP2

Page created in 0.062 seconds with 45 queries.