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



Donate

Rockbox Technical Forums


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

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Ingenic MIPS GCC 7.2.0 Toolchain to compile m3k native port
« previous next »
  • Print
Pages: 1 [2]

Author Topic: Ingenic MIPS GCC 7.2.0 Toolchain to compile m3k native port  (Read 2454 times)

Offline korvin

  • Member
  • *
  • Posts: 9
Re: Ingenic MIPS GCC 7.2.0 Toolchain to compile m3k native port
« Reply #15 on: June 30, 2022, 01:49:10 PM »
Quote from: vitt13 on June 28, 2022, 02:26:39 PM
I confirm that the toolchain mips-linux-gnu-ingenic-gcc7.2.0-glibc2.29-fp32-r5.0.4 does not automatically generate code with specific xburst SIMD instructions and optimizations. You need to change source code of codecs and decoders with using specific SIMD assembly instructions (MXU).
I reffer to this  https://www.rockbox.org/wiki/IngenicJz47xx , "Ingenic Media Extension Instruction Set" and "MXU User Guide" ftp://ftp.ingenic.com/SOC/X1000/X1000_M200_MXU-User-Guide.pdf

I have applied your patches to latest source code from git. (I hope I have done it in a right way  :)) And now I should try to find to to configure a latest toolchain and learn how to build with it, update rockboxdev.sh or build with manuals steps...
I don't know exactly how, but I will try and read docs and learn something new for me  )
Below is a link to the current sources (30.06.22) with patches (thanks to Vitt13) for the ingenic GCC 7.2.0
rockbox patched sources for ingenic GCC 7.2.0
« Last Edit: June 30, 2022, 01:51:51 PM by korvin »
Logged

Offline korvin

  • Member
  • *
  • Posts: 9
Re: Ingenic MIPS GCC 7.2.0 Toolchain to compile m3k native port
« Reply #16 on: June 30, 2022, 04:35:41 PM »
I have succesefully compiled main binary (rockbox.m3k ), but now I have troubles compiling codecs, someting wrong with linking -msoft-float library. This option is activated via CFLAGs

Quote
some codecs build failed so I just changed "-lgcc" in link command to
mips-linux-gnu-ingenic-gcc7.2.0/lib/gcc/mips-linux-gnu/7.2.0/libgcc.a (for two particular compiling failed situation)
and
mips-linux-gnu-ingenic-gcc7.2.0/lib/gcc/mips-linux-gnu/7.2.0/soft-float/libgcc.a (for other files)
for added $(LDGCC720)

I think I haven't understand how (and where) should I initialize this variable(constant) "$LDGCC720" and wich value should I set instead of "-gcc" ?
Sorry, I am a NOOB in Linux, GCC, C world... So sorry for my stupid questions )

* CodecsCompilingError.png (29.21 kB, 1450x573 - viewed 34 times.)
« Last Edit: June 30, 2022, 05:10:39 PM by korvin »
Logged

Offline vitt13

  • Member
  • *
  • Posts: 60
Re: Ingenic MIPS GCC 7.2.0 Toolchain to compile m3k native port
« Reply #17 on: July 01, 2022, 06:09:58 AM »
Quote from: korvin on June 30, 2022, 04:35:41 PM
I think I haven't understand how (and where) should I initialize this variable(constant) "$LDGCC720" and wich value should I set instead of "-gcc" ?
I don't remember... since december 2021.
In Makefile I defined "-DGCC720" as GCCOPTS so it must be C preprocessor directive somewhere.
Probably it was obsolete with "nasy hack" in ' rockbox_/apps/debug_menu.c ' and "LDGCC720" renamed to "LGCC520"
#ifdef __linux__1

---
Also attached MXU code example with nothing related to rockbox. (zip archive, rename to mxu_test.zip)
* Makefile.txt (4.2 kB - downloaded 39 times.)
* mxu_test.zip.txt (11.59 kB - downloaded 20 times.)
« Last Edit: July 01, 2022, 06:21:25 AM by vitt13 »
Logged

Offline korvin

  • Member
  • *
  • Posts: 9
Re: Ingenic MIPS GCC 7.2.0 Toolchain to compile m3k native port
« Reply #18 on: July 01, 2022, 07:47:27 AM »
Quote from: vitt13 on July 01, 2022, 06:09:58 AM
I don't remember... since december 2021.
In Makefile I defined "-DGCC720" as GCCOPTS so it must be C preprocessor directive somewhere.
Probably it was obsolete with "nasy hack" in ' rockbox_/apps/debug_menu.c ' and "LDGCC720" renamed to "LGCC520"
#ifdef __linux__1

---
Also attached MXU code example with nothing related to rockbox. (zip archive, rename to mxu_test.zip)

Thanks a lot ! This should help me, I'll try today, after work  :)
Logged

Offline amachronic

  • Developer
  • Member
  • *
  • Posts: 269
Re: Ingenic MIPS GCC 7.2.0 Toolchain to compile m3k native port
« Reply #19 on: July 01, 2022, 12:13:42 PM »
Using the Ingenic toolchain is probably a bad idea for several reasons--

- it's a hosted linux toolchain, as opposed to the OS-agnostic "mips-elf" toolchain. That can cause issues, see OSDev wiki Why do I need a cross compiler?
- it's doubtful that Ingenic made many changes or improvements to GCC (but I haven't bothered checking)
- it's old (GCC 12 is now latest, GCC 7.2 was released in mid 2017)

Why not just build a normal GCC 12 cross compiler? It's not that difficult to modify rockboxdev.sh or do it by hand, and then you don't need to patch linker scripts and add special flags.

All the MXU instructions are handled by filtering assembly output through the mxu_as script, and you can do that with any toolchain.
Logged

Offline korvin

  • Member
  • *
  • Posts: 9
Re: Ingenic MIPS GCC 7.2.0 Toolchain to compile m3k native port
« Reply #20 on: July 01, 2022, 08:57:10 PM »
Quote from: amachronic on July 01, 2022, 12:13:42 PM
Using the Ingenic toolchain is probably a bad idea for several reasons--

- it's a hosted linux toolchain, as opposed to the OS-agnostic "mips-elf" toolchain. That can cause issues, see OSDev wiki Why do I need a cross compiler?
- it's doubtful that Ingenic made many changes or improvements to GCC (but I haven't bothered checking)
- it's old (GCC 12 is now latest, GCC 7.2 was released in mid 2017)

Why not just build a normal GCC 12 cross compiler? It's not that difficult to modify rockboxdev.sh or do it by hand, and then you don't need to patch linker scripts and add special flags.

All the MXU instructions are handled by filtering assembly output through the mxu_as script, and you can do that with any toolchain.

May be orr even better to say most likely you're right. But from my NOOB vision GCC 7.2.0 version still better as GCC 4.9.4 version used to build current official builds. If 7.2.0 is old and 4.9.4 is ancient, like the pyramid of Cheops. I had never heard of any Ingenic and Xburst architecture until I bought my M3K player about a month ago, so I was happy to find how to build it with GCC 4.9.4 (it was not easy, despite the ready-made scripts and documentation) and now I am happy to try to build it with slightly newer GCC version. I can guess as an programmer, the greater the difference/distance between versions, the more incompatibilities there are between them, so and effort / time to fix them too. It's not my world anyway.

But as a rest for my soul I am trying to compile rockbox with old-new toolchain   :-)
« Last Edit: July 01, 2022, 09:14:03 PM by korvin »
Logged

Offline korvin

  • Member
  • *
  • Posts: 9
Re: Ingenic MIPS GCC 7.2.0 Toolchain to compile m3k native port
« Reply #21 on: July 02, 2022, 02:23:59 PM »
So, this is a like to FiiO M3K build with GCC 7.2.0 toolchain, if someone will try it
rockbox-fiiom3k-20220702-gcc720.zip
it's getestet and IMHO has better battery life.
« Last Edit: July 13, 2022, 05:25:35 PM by korvin »
Logged

  • Print
Pages: 1 [2]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Ingenic MIPS GCC 7.2.0 Toolchain to compile m3k native port
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.033 seconds with 18 queries.