Skip to content

Variables in options.mk not set when included in tool Makefiles #537

@MulattoKid

Description

@MulattoKid

Hi,

We've seen an issue where one of our developers is attempting to build wolfBoot in a Docker container built for a aarch64 host. When doing so the build fails (specifically for the bin-assemble tool) with the stabs debug format not being supported. We did some digging, and found that it's due to this check in options.mk:

# allow elf inclusion of debug symbols even with optimizations enabled
# make DEBUG_SYMBOLS=1
ifeq ($(DEBUG_SYMBOLS),1)
  CFLAGS+=-g
  ifeq ($(USE_GCC),1)
    CFLAGS+=-ggdb3
  else
    CFLAGS+=-gstabs
  endif
endif

When compiling the actual bootloader this works fine as this line is at the top of the Makefile: USE_GCC?=1. However, when compiling the tools the options.mk file is included without USE_GCC being set to 1.

Is there a reason the stabs format is used specifically, or could it be replaced by -g, to use the default format on the host platform? Or should USE_GCC be set to 1, because the Makefile explicitly uses GCC.
Just to note that this works fine in Docker containers built for a amd64 host.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions