Example makefiles fail on mac,
Homebrew toolchains for wii, gamecube, 3ds, ds, gba, gp32 and psp
Brought to you by:
wntrmute
Broken
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
Change to this and it works( a global replace probably inadvertantly altered this it worked in previous versions)
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=ds_arm9.specs $(ARCH) -Wl,-Map,$(notdir $*.map)
/opt/devkitPro/devkitARM/bin/../lib/gcc/arm-none-eabi/4.7.1/../../../../arm-none-eabi/bin/ld: cannot find -lg
collect2: error: ld returned 1 exit status
make[1]: *** [/opt/devkitPro/examples/nds/Graphics/3D/nehe/lesson04/lesson04.elf] Error 1
make: *** [build] Error 2
base_rules does not EXPORT a linker, so the I think a native ld is used. The Darwin ld does not recognize the -g flag, but removing it seems to work
tried exporting LD=$(prefix)ld
The armeabi-ld doesn't seem to know how to link arm-thumb
$make
[ -d build ] || mkdir -p build
make --no-print-directory -C build -f /opt/devkitPro/examples/nds/Graphics/3D/3D_Both_Screens/Makefile
linking 3D_Both_Screens.elf
arm-none-eabi-ld: unrecognised emulation mode: thumb-interwork
Supported emulations: armelf
make[4]: *** [/opt/devkitPro/examples/nds/Graphics/3D/3D_Both_Screens/3D_Both_Screens.elf] Error 1
make[3]: *** [build] Error 2
make[2]: *** [all] Error 1
make[1]: *** [all] Error 1
make: *** [examples] Error 1
Last edit: A Wiebe 2014-07-07
This makes no sense.
The linker changes between g++ & gcc depending on the existence of C++ files in the project
ifeq ($(strip $(CPPFILES)),)
export LD := $(CC)
else
export LD := $(CXX)
endif
I test the examples regularly on OSX, they work for me. Obviously there's some difference between your installation and mine.
Usually these things turn out to be pollution of the environment with variables intended for native compilers.
Last edit: Dave Murphy 2014-07-06
Seems to have been an artifact of when DEVKITPRO was in /opt/devkitpro
Indeed, environment variables were conflicting.
Very strange resulting behaviour, would never have guessed that was the issue.
Thanks, issue resolved.