Skip to content

Build failure with latest devkitPro (devkitARM r68 / libctru 2.7.0) #41

Description

@danielecuomo

Description

I'm trying to build emus3ds from a completely clean clone using the latest devkitPro toolchain.

Environment

  • macOS
  • devkitARM r68
  • GCC 16.1.0
  • libctru 2.7.0
  • latest citro3d

Build

git clone --recursive https://github.com/bubble2k16/emus3ds.git
cd emus3ds
git submodule update --init --recursive
make -f picodrive-make

API incompatibilities found

I already fixed two incompatibilities with current libctru:

  • WAIT_NONE conflicts with the new PXIDEV_WaitType::WAIT_NONE
  • GSPGPU_FramebufferFormats was renamed to GSPGPU_FramebufferFormat

After those fixes, compilation proceeds further.

Current failure

Compilation now always stops while compiling:

src/3ds/3dsexit.cpp

The file is simply:

#include <stdlib.h>
#include <3ds.h>

#include "3dsexit.h"

aptHookCookie hookCookie;
int appExiting = 0;

void setExitFlag(APT_HookType hook, void* param)
{
    if (hook == APTHOOK_ONEXIT)
        appExiting = 1;
}

void enableExitHook()
{
    aptHook(&hookCookie, setExitFlag, NULL);
}

3dsexit.h only contains:

#include <3ds.h>

extern aptHookCookie hookCookie;
extern int appExiting;

void setExitFlag(APT_HookType hook, void* param);
void enableExitHook();

The compiler then fails inside the standard library:

In file included from /opt/devkitpro/devkitARM/bin/../lib/gcc/arm-none-eabi/16.1.0/include/c++/cstdlib:75,
                 from src/3ds/3dsexit.cpp:2:
/opt/devkitpro/devkitARM/arm-none-eabi/include/stdlib.h:98:30: error: expected initializer before 'throw'

followed by many errors like:

'calloc' has not been declared in '::'
'malloc' has not been declared in '::'
'realloc' has not been declared in '::'
'aligned_alloc' has not been declared in '::'

The failure originates inside <stdlib.h> / <cstdlib>, before any project code is compiled.

Additional information

  • Clean clone
  • Original Makefile
  • Submodules initialized
  • Same error reproduced from scratch

Questions

  • Has anyone successfully built emus3ds with devkitARM r68 / GCC 16 / libctru 2.7.x?
  • Is this a known incompatibility with modern devkitPro?
  • Is there an updated branch or patch that supports the current toolchain?
  • Or is the project expected to build only with the historical devkitARM/libctru versions?

Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions