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:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  m68k cross compiler // stdio.h missing
« previous next »
  • Print
Pages: [1]

Author Topic: m68k cross compiler // stdio.h missing  (Read 4812 times)

Offline Dermiste

  • Member
  • *
  • Posts: 6
m68k cross compiler // stdio.h missing
« on: October 27, 2014, 01:34:33 PM »
Hi there,

Using the utility in tools I create a cross compiler targeted for m68k family processors.
When I try to compile a simple hello world exemple I get the following:
helloworld.c:1:19: fatal error: stdio.h: No such file or directory

I guess it's missing all the basic libraries. Is there any way I can recompile the cross compiler so it includes them? Or maybe I need to add something to that command:
/usr/local/bin/m68k-elf-gcc -Wall helloworld.c -o hello


To make it work properly?

Thanks in advance
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 9140
Re: m68k cross compiler // stdio.h missing
« Reply #1 on: October 27, 2014, 03:03:40 PM »
I don't know if you can use our compilers to build for something other than Rockbox.

Logged

Offline Dermiste

  • Member
  • *
  • Posts: 6
Re: m68k cross compiler // stdio.h missing
« Reply #2 on: October 27, 2014, 03:12:50 PM »
But this utility, rockboxdev.sh, allows to create a cross compiler right?
I am not yet at the point where I need to check the relevance of the target, first the compiler is missing the basics lib stdio.h.
When I compile using gcc (I am on osx) it works fine, so it means I have to add params or sth.

Any idea?
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 9140
Re: m68k cross compiler // stdio.h missing
« Reply #3 on: October 27, 2014, 03:40:20 PM »
Its not missing those; we just don't use many of them.

Edit: take a look at the make file for an m68k target. It should list the actual headers iirc.
« Last Edit: October 27, 2014, 03:46:39 PM by saratoga »
Logged

Offline Dermiste

  • Member
  • *
  • Posts: 6
Re: m68k cross compiler // stdio.h missing
« Reply #4 on: October 27, 2014, 03:59:08 PM »
Ok so there is a way a can modify the way the cross compiler is made to include those?
When you say the make file for a m68k target you mean a makefile for an existing project of mine? Or the makefile used in RockBox, in which case I don't know where to find it
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 9140
Re: m68k cross compiler // stdio.h missing
« Reply #5 on: October 27, 2014, 04:01:54 PM »
To be honest I don't even know what you expect that command to do. Compile your program for a 68k build of osx? Or compile it for a Rockbox command line interface that doesn't exist? Something else?
Logged

Offline Dermiste

  • Member
  • *
  • Posts: 6
Re: m68k cross compiler // stdio.h missing
« Reply #6 on: October 27, 2014, 04:06:52 PM »
Yeh actually I'm sorry I didn't even specify what I was hoping to do with that.

I've put my hand on a source code for a Coldfire 5272 processor. It's an electronic project and this will make a Quadricopter fly :)
Only thing is, the actual source code can be compiled only on a linux computer at my university, because everything is setup over there to do so.
As I am on osx, I want to be able to build for my computer too. My teacher told me that I had to download binutils and gcc and create a cross compiler to compile for a m68k target, from OSX. I believe the rockboxdev.sh script does create this cross compiler for the right target.

So, If I am right, if I find the missing libraries I will be able to compile my project.
Right?
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 9140
Re: m68k cross compiler // stdio.h missing
« Reply #7 on: October 27, 2014, 04:09:45 PM »
That's definitely not going to work. You might be able to modify our build script to work but its probably easier to start with a compiler targeting m68k Linux.
Logged

Offline Dermiste

  • Member
  • *
  • Posts: 6
Re: m68k cross compiler // stdio.h missing
« Reply #8 on: October 27, 2014, 04:13:06 PM »
Why not ? In a few words :D I am quite new to this C world, although I am a web developer
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 9140
Re: m68k cross compiler // stdio.h missing
« Reply #9 on: October 27, 2014, 09:45:54 PM »
the output of a given compiler target a specific system. This is the reason you can't use a windows compiler to build Mac programs. You will need to setup a compiler that targets whatever your device runs.

I think you should ask your teacher for help.
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: m68k cross compiler // stdio.h missing
« Reply #10 on: October 27, 2014, 10:59:05 PM »
Quote from: saratoga on October 27, 2014, 09:45:54 PM
the output of a given compiler target a specific system. This is the reason you can't use a windows compiler to build Mac programs. You will need to setup a compiler that targets whatever your device runs.

OP seems to be at least partially aware of this fact, and appears to be attempting to do exactly this, hence the mention of cross compilation of the toolchain that targets his specific architecture.

But, then again, its quite possible I'm getting it wrong too.

I believe it is clear what OP is trying to achieve, but there is a clear disconnect between what OP wants to achieve and the roadmap s/he believes will allow him/her to arrive at this destination.

Quote from: saratoga on October 27, 2014, 09:45:54 PM
I think you should ask your teacher for help.

This.

Support for compiling generic non-Rockbox things is quite firmly out of the scope of this support channel. Even if one is attempting to use our tool set to do so.

Your teacher/instructor/spirit guide/whatever is much better suited to answer this question for you, and at the same time you can ask him or her why they seem to have completely failed you in assisting you with your assigned task and supplying you with a firm grounding of understanding of which to work from.


[Saint]

« Last Edit: October 27, 2014, 11:00:46 PM by [Saint] »
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Dermiste

  • Member
  • *
  • Posts: 6
Re: m68k cross compiler // stdio.h missing
« Reply #11 on: December 28, 2014, 01:59:33 PM »
Hi all,

Just for the record, I did manage to fix my issues which were only related to the way I was including libs.
Turns out that using rockboxdev.sh it is possible to create a cross compiler to target a coldfire uController on a quadricopter :D
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  m68k cross compiler // stdio.h missing
 

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

Page created in 0.058 seconds with 22 queries.