Magic Lantern Forum

Developing Magic Lantern => General Development => Topic started by: stevefal on March 15, 2014, 02:19:30 AM

Title: can't build - "unrecognized command line option '-Map=location.map'"
Post by: stevefal on March 15, 2014, 02:19:30 AM
Any idea?

Quotefalconmacbook::steve [magic-lantern]$ make
make -C  /Users/steve/magic-lantern/platform/5D3.113
[ VERSION  ]   ../../platform/5D3.113/version.bin
[ VERSION  ]   ../../platform/5D3.113/version.c
[ CC       ]   version.o
make -C ../../tcc
make[2]: Nothing to be done for `all'.
[ LD       ]   magiclantern
arm-none-eabi-gcc-4.7.3: error: unrecognized command line option '-Map=location.map'
make[1]: *** [magiclantern] Error 1
make: *** [5D3] Error 2
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: a1ex on March 15, 2014, 02:26:18 AM
Works fine here with 4.7.3. Can you post the output of "make V=1" and your Makefile.user?

Here it says:
~/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-ld -o magiclantern -N -u strcasecmp  -T magiclantern.lds entry.o ../../platform/5D3.113/stubs.o version.o boot-hack.o fio-ml.o mem.o ico.o edmac.o menu.o debug.o rand.o posix.o util.o electronic_level.o cfn.o gui.o picstyle.o exmem.o bmp.o rbf_font.o config.o stdio.o bitrate-5d3.o lcdsensor.o tweaks.o tweaks-eyefi.o lens.o property.o propvalues.o gui-common.o chdk-gui_draw.o movtweaks.o menuhelp.o menuindex.o focus.o notify_box.o dialog_test.o vram.o aj_port.o fps-engio.o shoot.o hdr.o lv-img-engio.o state-object.o tasks.o vsync-lite.o tskmon.o battery.o imgconv.o histogram.o falsecolor.o audio-ak.o zebra.o vectorscope.o beep.o crop-mode-hack.o ph_info_disp.o flexinfo.o screenshot.o fileprefix.o lvinfo.o ml-cbr.o gdb.o console.o tcc-glue.o ../../tcc/libtccx.o module.o video_hacks.o misc.o afma.o raw.o chdk-dng.o edmac-memcpy.o asm.o dietlibc.a newlib-libc.a newlib-libm.a gcc-libgcc.a -Map=location.map

so it calls arm-none-eabi-ld instead of arm-none-eabi-gcc-4.7.3 for this step.
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: stevefal on March 15, 2014, 02:57:08 AM
Quotefalconmacbook::steve [magic-lantern]$ make V=1
make -C  /Users/steve/magic-lantern/platform/5D3.113
echo -e bbbbMagic Lantern v2.3.NEXT.2014Mar14.5D3113
echo "const char build_version[] = \"v2.3.NEXT.2014Mar14.5D3113\";"
~/mltools/gcc/bin/arm-none-eabi-gcc-4.7.3  -Os -mthumb-interwork -march=armv5te -D__ARM__ -Wp,-MMD,./version.d -Wp,-MT,version.o -nostdlib -fomit-frame-pointer -fno-strict-aliasing -I../../include  -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-implicit-function-declaration -Wno-missing-field-initializers -Wno-format -Wdouble-promotion -ffast-math -fsingle-precision-constant -fshort-double -fno-builtin-printf -std=gnu99 -Winline -I../../platform/5D3.113 -I../../platform/5D3.113/include -I../../src -I../../picoc  -DCONFIG_5D3_MINIMAL=1 -DCONFIG_NO_SNAP_SIM=1 -DCONFIG_MAGICLANTERN=1 -DCONFIG_5D3=1 -DRESTARTSTART=0x00069500 -DROMBASEADDR=0xFF0C0000 -DVERSION=\"v2.3.NEXT.2014Mar14.5D3113\" -DCAMERA_MODEL=\"5D3\" -DCONFIG_DEBUGMSG=0 -DCONFIG_FW_VERSION=113 -DCONFIG_CONSOLE -DCONFIG_TCC -DCONFIG_MODULES -DCONFIG_MODULES_MODEL_SYM=\"5D3_113.sym\" -c -o version.o ../../platform/5D3.113/version.c
make -C ../../tcc
make[2]: Nothing to be done for `all'.
~/mltools/gcc/bin/arm-none-eabi-gcc-4.7.3 -o magiclantern -N -u strcasecmp  -T magiclantern.lds entry.o ../../platform/5D3.113/stubs.o version.o boot-hack.o fio-ml.o mem.o ico.o edmac.o menu.o debug.o rand.o posix.o util.o electronic_level.o cfn.o gui.o picstyle.o exmem.o bmp.o rbf_font.o config.o stdio.o bitrate-5d3.o lcdsensor.o tweaks.o tweaks-eyefi.o lens.o property.o propvalues.o gui-common.o chdk-gui_draw.o movtweaks.o menuhelp.o menuindex.o focus.o notify_box.o dialog_test.o vram.o aj_port.o fps-engio.o shoot.o hdr.o lv-img-engio.o state-object.o tasks.o vsync-lite.o tskmon.o battery.o imgconv.o histogram.o falsecolor.o audio-ak.o zebra.o vectorscope.o beep.o crop-mode-hack.o ph_info_disp.o flexinfo.o screenshot.o fileprefix.o lvinfo.o ml-cbr.o console.o tcc-glue.o ../../tcc/libtccx.o module.o video_hacks.o misc.o afma.o raw.o chdk-dng.o edmac-memcpy.o asm.o dietlibc.a newlib-libc.a newlib-libm.a gcc-libgcc.a -Map=location.map
arm-none-eabi-gcc-4.7.3: error: unrecognized command line option '-Map=location.map'
make[1]: *** [magiclantern] Error 1
make: *** [5D3] Error 2

Quote#User-defined values for ML build system
#Copy me to Makefile.user, keeping ONLY the options that you want to customize

UNAME:=$(shell uname)

ifeq ($(UNAME), Darwin)
   # Variable declaration for Mac OS X
   UMOUNT=hdiutil unmount
   CF_CARD="/Volumes/EOS_DIGITAL"
   STAT_CMD=stat -f "%N: %z bytes"
else
   # Default settings for remaining operating systems
   UMOUNT=umount
   CF_CARD="/media/EOS_DIGITAL/"
   STAT_CMD=stat -c "%n: %s bytes"
endif

# Supported camera models
SUPPORTED_MODELS:=5D3

# GCC-related stuff
# for yagarto or the official ARM toolchain use ARM_ABI=none-eabi otherwise use ARM_ABI=elf
ARM_ABI=none-eabi
GCC_VERSION=-4.7.3
ARM_PATH=~/mltools/gcc
ARM_BINPATH=$(ARM_PATH)/bin

CROSS_COMPILE=$(ARM_BINPATH)/arm-$(ARM_ABI)-

ifeq ($(OS),Windows_NT)
CC=$(CROSS_COMPILE)gcc$(GCC_VERSION).exe
else
CC=$(CROSS_COMPILE)gcc$(GCC_VERSION)
endif

LD=$(CC)
OBJCOPY=$(CROSS_COMPILE)objcopy
OBJDUMP=$(CROSS_COMPILE)objdump
AR=$(CROSS_COMPILE)ar
RANLIB=$(CROSS_COMPILE)ranlib
READELF=$(CROSS_COMPILE)readelf
LD_REAL=$(CROSS_COMPILE)ld
STRIP=$(CROSS_COMPILE)strip

# You can customize CFLAG here
HOST_CFLAGS=-g -O3 -W -Wall
#CFLAG_USER = -march=armv5te -mcpu=arm946e-s -O2 -DCONFIG_RELEASE_BUILD \

# Additional binaries
HOST_CC=which gcc
CCACHE=ccache
GREP=grep
AWK=awk
PYTHON=python2
RST2LATEX=rst2latex.py

NIGHTLY_ROOT:=$(HOME)/public_html/nightly
NIGHTLY_ARCHIVE:=$(NIGHTLY_ROOT)/archive
NIGHTLY_DIR:=$(NIGHTLY_ARCHIVE)/$(shell date +'%Y-%m-%d')-$(shell hg id -i -r .)

# Naming convention for Magic Lantern builds:
# General rules:
# - Always specify the camera and its firmware version number in the build name (e.g. 550d.fw109)
# - For non-release builds, specify the build date and author's (nick)name.
# - For experimental builds, add a short keyword indicating the particular feature tested.

# Examples for experimental builds:
# magiclantern-2010dec07.550d.fw108.cropmarks.a1ex.zip
# magiclantern-2010nov23.550d.fw108.selectable-audio.piers.zip

# Example for pre-release builds:
# magiclantern-2010dec17.550d.fw109.PRERELEASE.alex.zip

# Release builds:
# magiclantern-0.2.0.rc1.550d.fw109.zip
#~ VERSION=0.2.0.rc1.550d.fw109
BUILDVER=$(shell whoami).$(shell hg id -i -r .)
VERSION:=v2.3.NEXT.$(shell LC_TIME=EN date +'%Y%b%d').$(MODEL)$(FW_VERSION)

# Build configuration - untested and debug stuff handy for devs
CONFIG_PYMITE       = n
ifndef CONFIG_RELOC
CONFIG_RELOC        = n
endif
CONFIG_TIMECODE     = n
CONFIG_PTP          = n
CONFIG_PTP_CHDK     = n
CONFIG_PTP_ML       = n
ifndef CONFIG_GDB
CONFIG_GDB          = n
endif
CONFIG_GDBSTUB      = n
ifndef CONFIG_CONSOLE
CONFIG_CONSOLE      = y
endif
CONFIG_DEBUGMSG     = 0
CONFIG_CCACHE       = n
ifndef CONFIG_PICOC
CONFIG_PICOC        = n
endif
CONFIG_TCC          = y
CONFIG_MEMCHECK     = n
CONFIG_MODULES      = y
CONFIG_TINYPY       = n

# Work in progress - would be nice to run the unmodified autoexec.bin in QEMU, but we are not there yet
# so, for now, we'll just hack the source code to work around the limitations of the emulator
CONFIG_QEMU         = n
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: 1% on March 15, 2014, 02:57:47 AM
I had the same error with 4.7.3, updating solved it.
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: stevefal on March 15, 2014, 03:20:23 AM
Updating gcc? Which version and how do I get it? Sorry, this build environment stuff is an utter mystery to me.
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: Audionut on March 15, 2014, 03:35:04 AM
https://launchpad.net/gcc-arm-embedded/+download

Overwrite the existing files, or, update the makefile.
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: stevefal on March 15, 2014, 03:37:15 AM
Thanks.
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: stevefal on March 15, 2014, 04:15:50 AM
I'm now running 4.8.3 and I get the same error:

Quotefalconmacbook::steve [magic-lantern]$ make
make -C  /Users/steve/magic-lantern/platform/5D3.113
[ VERSION  ]   ../../platform/5D3.113/version.bin
[ VERSION  ]   ../../platform/5D3.113/version.c
[ CC       ]   version.o
make -C ../../tcc
make[2]: Nothing to be done for `all'.
[ LD       ]   magiclantern
arm-none-eabi-gcc-4.8.3: error: unrecognized command line option '-Map=location.map'
make[1]: *** [magiclantern] Error 1
make: *** [5D3] Error 2
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: dmilligan on March 15, 2014, 04:20:49 AM
you probably have LD=$(CC) in your makefile.user, remove that line and you're good
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: stevefal on March 15, 2014, 06:07:59 AM
I did have that line, but removing it results in other errors:

Quotefalconmacbook::steve [magic-lantern]$ make
make -C  /Users/steve/magic-lantern/platform/5D3.113
[ VERSION  ]   ../../platform/5D3.113/version.bin
[ VERSION  ]   ../../platform/5D3.113/version.c
[ CC       ]   version.o
make -C ../../tcc
make[2]: Nothing to be done for `all'.
[ LD       ]   magiclantern
../../tcc/libtccx.o: In function `start':
crtstuff.c:(.text+0x180): undefined reference to `main'
crtstuff.c:(.text+0x198): undefined reference to `__bss_start__'
crtstuff.c:(.text+0x19c): undefined reference to `__bss_end__'
../../tcc/libtccx.o: In function `exit':
crtstuff.c:(.text.exit+0x2c): undefined reference to `_exit'
../../tcc/libtccx.o: In function `_fstat_r':
crtstuff.c:(.text._fstat_r+0x1c): undefined reference to `_fstat'
../../tcc/libtccx.o: In function `_open_r':
crtstuff.c:(.text._open_r+0x20): undefined reference to `_open'
../../tcc/libtccx.o: In function `_sbrk_r':
crtstuff.c:(.text._sbrk_r+0x18): undefined reference to `_sbrk'
../../tcc/libtccx.o: In function `_write_r':
crtstuff.c:(.text._write_r+0x20): undefined reference to `_write'
../../tcc/libtccx.o: In function `_close_r':
crtstuff.c:(.text._close_r+0x18): undefined reference to `_close'
../../tcc/libtccx.o: In function `_isatty_r':
crtstuff.c:(.text._isatty_r+0x18): undefined reference to `_isatty'
../../tcc/libtccx.o: In function `_lseek_r':
crtstuff.c:(.text._lseek_r+0x20): undefined reference to `_lseek'
../../tcc/libtccx.o: In function `_read_r':
crtstuff.c:(.text._read_r+0x20): undefined reference to `_read'
make[1]: *** [magiclantern] Error 1
make: *** [5D3] Error 2
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: dmilligan on March 15, 2014, 08:23:36 PM
make clean
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: stevefal on March 15, 2014, 08:32:54 PM
Yep, did that...
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: stevefal on March 15, 2014, 08:40:57 PM
I re-cloned the project and it works now. I don't know what was wrong.
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: Marsu42 on March 16, 2014, 08:46:55 AM
Quote from: stevefal on March 15, 2014, 08:40:57 PM
I re-cloned the project and it works now. I don't know what was wrong.

I can sympathize with that experience :-p as I also now and again have to re-clone the tree because I cannot figure out what in the world is going wrong with the build... one reason might be that the Makefile system isn't very elaborate or bulletproof yet.
Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: nanomad on March 20, 2014, 08:58:08 AM
The reason is most people don't read what is written  in the Makefile.user.default header... You are suppose to use a thin Makefile.user containing changed settings only (not everything)

Title: Re: can't build - "unrecognized command line option '-Map=location.map'"
Post by: stevefal on March 20, 2014, 02:53:17 PM
After my initial attempt, I used the latest Makefile.user.default (with my two changes) and still got the location.map error. It's only after I re-cloned could I build. But yes, I am now using a thin makefile.user.

It's a little dissonant because Makefile.user.default isn't really what the default would be according to this - empty.