xboxscene.org forums

Author Topic: Openxdk Compiling Errors  (Read 451 times)

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Openxdk Compiling Errors
« on: July 30, 2010, 03:05:00 AM »

I've made a couple of additions to the OpenXDK xboxkrnl headers and source files, and modified the xboxkrnl.exe.def file to reflect this, so I wanted to recompile it so I could see if I did things right.

Unfortunately, I had been using the precompiled OpenXDK.
No matter, I thought. Just download the OpenXDK from CVS, follow the steps highlighted at Installing OpenXDK, and it'd work.
WRONG!
When it gets to compiling newlib, I get this:
CODE
i386-pc-xbox-gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.


So, I thought, it doesn't work from CVS (Maybe an error in the makefiles or something)... So then I'll try the Packaged source.
Unfortunately, it does the exact same thing when compiling newlib.
I'm at a loss here. I can't get past this error, so OpenXDK won't compile.

FYI I'm running Windows 7 Ultimate, and use Cygwin to compile everything OpenXDK related.
Logged

ldotsfan

  • Archived User
  • Hero Member
  • *
  • Posts: 2072
Openxdk Compiling Errors
« Reply #1 on: July 30, 2010, 07:09:00 AM »

In my LBA48/OpenXDK thread, I hit compilation error for newlib as well but it has been a while so I cannot recall the exact error and whether it is exactly the same error as yours.

However I simply worked around the problem  biggrin.gif My argument was my changes (on xboxkrnl as well). did not impact newlib and my changes were only to libxboxkrnl.a which is actually just stubs to fool the OpenXDK toolchain into thinking the library is there. newlib is not going to know about the new methods or call them. At run-time, the xbe actually calls the xbox kernel. I managed to compile just the libxboxkrnl.a and manually copied all the .a static libraries to a directory and edited my xbe Makefile to point to this directory instead. The make command happily produced the xbe  smile.gif

The only dependency I can recall that newlib has on xboxkrnl is in the file I/O stuff - did you change those?
Logged

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Openxdk Compiling Errors
« Reply #2 on: July 30, 2010, 07:30:00 AM »

I did not change any of the existing functions.
I actually added a couple of new ones that weren't defined until now.
Could you tell me how to compile the xboxkrnl.a separate from the rest of the OpenXDK?
I tried it, but couldn't find the right command.
Logged

ldotsfan

  • Archived User
  • Hero Member
  • *
  • Posts: 2072
Openxdk Compiling Errors
« Reply #3 on: July 30, 2010, 05:45:00 PM »

I hit the exact same error as you when I tried it again today  tongue.gif

CODE

The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.


Anyway I found the solution too  biggrin.gif , here's a log of my shell history, see if it make senses

CODE

which gcc
cd /usr/bin
ls -latr gcc*
cd /etc/alternatives/
ls -latr gcc
rm gcc
ln -s /usr/bin/gcc-3.exe gcc
gcc
cd ~
cd OpenXDK/
ls
cd src
ls
cd xboxkrnl/
ls
make

Basically I removed the soft link in /etc/alternatives/gcc pointing to gcc-4 and remapped it to gcc-3 which didn't complain on the no-cygwin flag and then ran the make command from the xboxkrnl folder which produced libxboxkrnl.a  pop.gif

Hence my conjecture my earlier compile error for newlib is a different one as I don't recall doing this step before.
Logged

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Openxdk Compiling Errors
« Reply #4 on: July 31, 2010, 03:59:00 PM »

Thank you very much. OpenXDK compiles again!
Now I can finally get to testing my additions to the XBOX kernel library.
Logged

ldotsfan

  • Archived User
  • Hero Member
  • *
  • Posts: 2072
Openxdk Compiling Errors
« Reply #5 on: July 31, 2010, 09:06:00 PM »

QUOTE(halofreak1990 @ Aug 1 2010, 05:59 AM) View Post

Now I can finally get to testing my additions to the XBOX kernel library.

Great, is this for the XNA library or something new?
Logged

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Openxdk Compiling Errors
« Reply #6 on: August 02, 2010, 03:51:00 PM »

QUOTE(ldotsfan @ Aug 1 2010, 05:06 AM) View Post

Great, is this for the XNA library or something new?

For the OpenXDK in general. Completion of the XBOX kernel library is overdue for several years.

Also, to get the xboxkrnl.h compiling under g++, which is what my XNA implementation uses, I needed to remove the 'typedef int bool' on line 26 in types.h because it gave me a redefinition error.
Logged

Hyper_Eye

  • Recovered User
  • Sr. Member
  • *
  • Posts: 366
Openxdk Compiling Errors
« Reply #7 on: August 02, 2010, 04:04:00 PM »

QUOTE(halofreak1990 @ Aug 2 2010, 04:51 PM) View Post

For the OpenXDK in general. Completion of the XBOX kernel library is overdue for several years.

Also, to get the xboxkrnl.h compiling under g++, which is what my XNA implementation uses, I needed to remove the 'typedef int bool' on line 26 in types.h because it gave me a redefinition error.


You might consider:

CODE
#ifndef bool
typedef int bool
#endif


or

CODE
#ifndef __cplusplus
typedef int bool
#endif
Logged

ldotsfan

  • Archived User
  • Hero Member
  • *
  • Posts: 2072
Openxdk Compiling Errors
« Reply #8 on: August 04, 2010, 07:52:00 AM »

QUOTE(halofreak1990 @ Aug 3 2010, 05:51 AM) View Post

For the OpenXDK in general. Completion of the XBOX kernel library is overdue for several years.

Will you be releasing the source?
Logged

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Openxdk Compiling Errors
« Reply #9 on: August 05, 2010, 01:21:00 PM »

Sure, why not? I'll add it to the XFX downloads at SourceForge.net
If you have the OpenXDK sources, just stick it in and run a "make install".

However, many of the additions still need to be tested; they're basicly copied from 'undocumented.h', the MS XDK (as far as I could translate the naming differences), and the MSDN docs.

I assume DbgPrint(), and DbgBreakPoint() can only be tested on a debug kit, which I don't have. (I've got a softmodded V1.6 XBOX)
Logged