Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to install unstripped binaries into rootfs and enable it for host-generic-pc #150

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile.host
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ CFLAGS += -fsanitize=address,undefined
LDFLAGS += -fsanitize=address,undefined
endif

# install unstripped binaries in rootfs
# (cruicial for tests binaries with debug info for meaningful sanitizers info)
ROOTFS_INSTALL_UNSTRIPPED := y

CXXFLAGS += $(filter-out -Wstrict-prototypes, $(CFLAGS))
12 changes: 11 additions & 1 deletion makes/binary.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# - LOCAL_LDFLAGS - additional LDFLAGS for current component linking
# - LOCAL_INSTALL_PATH - custom rootfs dir for the binary to be installed (if not provided - DEFAULT_INSTALL_PATH)

# Global variables (not reset by this script):
# - ROOTFS_INSTALL_UNSTRIPPED - if non-empty - install binaries into rootfs from PREFIX_PROG (instead of _STRIPPED)


# directory with current Makefile - relative to the repository root
# filter-out all Makefiles outside of TOPDIR
Expand Down Expand Up @@ -89,8 +92,15 @@ $(NAME)-clean:
# install into the root filesystem
LOCAL_INSTALL_PATH := $(or $(LOCAL_INSTALL_PATH),$(DEFAULT_INSTALL_PATH))

# add option to install unstripped binaries
ifeq ($(ROOTFS_INSTALL_UNSTRIPPED),)
ROOTFS_BIN_SRC := $(PREFIX_PROG_STRIPPED)$(NAME)
else
ROOTFS_BIN_SRC := $(PREFIX_PROG)$(NAME)
endif

$(NAME)-install: $(NAME) $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)/$(NAME)
$(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)/$(NAME): $(PREFIX_PROG_STRIPPED)$(NAME)
$(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)/$(NAME): $(ROOTFS_BIN_SRC)
$(INSTALL_FS)

# necessary for NAME variable to be correctly set in recepies
Expand Down
Loading