Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#131 Example makefiles fail on mac,

unconfirmed
open
nobody
None
3
2014-07-11
2013-07-12
A Wiebe
No

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

Discussion

  • Dave Murphy
    Dave Murphy
    2013-09-06

    • Group: confirmed --> unconfirmed
     
  • A Wiebe
    A Wiebe
    2014-07-06

    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
  • Dave Murphy
    Dave Murphy
    2014-07-06

    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
  • A Wiebe
    A Wiebe
    2014-07-11

    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.