Magic Lantern Forum

Developing Magic Lantern => General Development => Topic started by: names_are_hard on July 11, 2019, 04:06:29 AM

Title: How to add .o dependency for disp_direct.c?
Post by: names_are_hard on July 11, 2019, 04:06:29 AM
I have an ML build problem in a port in progress.  My simple brain can write 10 line makefiles.  I have added #include vram.h (and bmp.h) to disp_direct.c, and my build gets an error of:

arm-none-eabi-ld: disp_direct.o: in function `disp_set_pixel':
disp_direct.c:(.text+0x158): undefined reference to `bmp_vram_info'

I believe the cause is that the linker isn't trying to link vram.o into disp_direct.o.  How do I add this dependency?  I've tried src/Makefile.src, several variants along the line of:
disp_direct.o: $(PLATFORM_DIR)/vram.o

but no luck.  Anyone got any ideas?  There's a lot of possible makefiles to add things to, and I'm not even sure of the right way of adding this.
Title: Re: How to add .o dependency for disp_direct.c?
Post by: sombree on July 11, 2019, 12:39:13 PM
Have you tried adding it to ML_SRC_EXTRA_OBJS in platform/200D.101/Makefile.platform.default? I mean something like this:

ML_SRC_EXTRA_OBJS = \
        log-d678.o \
        function_overrides.o \
        vram.o


Or you can try adding vram.o to ML_SRC_REBOOT_OBJ in src/Makefile.src:

ifndef ML_SRC_REBOOT_OBJ
ML_SRC_REBOOT_OBJ = reboot.o \
disp_direct.o font_direct.o vram.o \
strlen.o strcmp.o gcc-libgcc.a \
cache.o \
footer.o
endif
Title: Re: How to add .o dependency for disp_direct.c?
Post by: names_are_hard on July 13, 2019, 02:55:49 AM
Sadly those didn't help.  Adding vram.o to ML_SRC_EXTRA_OBJS does nothing, which makes sense to me; they've already been compiled.  Was still worth a try.  Adding to ML_SRC_REBOOT_OBJ makes it get many additional undefined reference errors in vram.o.