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

Remove handling of STACK_CANARY #13

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
32 changes: 6 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,12 @@ else
ON_DEVICE_UNIT_TESTS=0
endif

ifeq ("$(NO_STACK_CANARY)","")
ifeq ($(RELEASE_BUILD),0)
DEFINES += HAVE_BOLOS_APP_STACK_CANARY
STACK_CANARY=1
else
STACK_CANARY=0
endif
else
STACK_CANARY=0
endif

# Make environmental flags consistent with DEFINES
ifneq ($(shell echo $(DEFINES) | grep -c HAVE_ON_DEVICE_UNIT_TESTS), 0)
ON_DEVICE_UNIT_TESTS=1
else
ON_DEVICE_UNIT_TESTS=0
endif
ifeq ($(shell echo $(DEFINES) | grep -c HAVE_BOLOS_APP_STACK_CANARY), 0)
NO_STACK_CANARY=0
else
NO_STACK_CANARY=1
endif

DEFINES += APPNAME=\"$(APPNAME)\"
DEFINES += LEDGER_BUILD
Expand Down Expand Up @@ -165,15 +149,11 @@ $(info TARGETS $(MAKECMDGOALS))
$(info RELEASE_BUILD $(RELEASE_BUILD))
$(info TARGET_NAME $(TARGET_NAME))
$(info ON_DEVICE_UNIT_TESTS $(ON_DEVICE_UNIT_TESTS))
$(info STACK_CANARY $(STACK_CANARY))
$(info )
endif
endif

ifeq ($(RELEASE_BUILD),1)
ifneq ($(shell echo $(DEFINES) | grep -c HAVE_BOLOS_APP_STACK_CANARY),0)
$(error HAVE_BOLOS_APP_STACK_CANARY should not be used for release builds);
endif
ifneq ($(shell echo $(DEFINES) | grep -c HAVE_ON_DEVICE_UNIT_TESTS),0)
$(error HAVE_ON_DEVICE_UNIT_TESTS should not be used for release builds);
endif
Expand Down Expand Up @@ -259,18 +239,18 @@ side_release: all
@echo
$(MAKE) clean

@# Make sure unit tests are run with stack canary
@# Build unit tests
@echo
@echo "SIDE RELEASE BUILD: Building with HAVE_BOLOS_APP_STACK_CANARY"
@echo "SIDE RELEASE BUILD"
@echo
@RELEASE_BUILD=0 NO_STACK_CANARY= $(MAKE) all
@RELEASE_BUILD=0 $(MAKE) all

@# Build release without stack canary
@# Build release
@$(MAKE) clean
@echo
@echo "SIDE RELEASE BUILD: Building without HAVE_BOLOS_APP_STACK_CANARY"
@echo "SIDE RELEASE BUILD"
@echo
@NO_STACK_CANARY=1 $(MAKE) all
@$(MAKE) all

@echo "Packaging release... ledger-app-mina-$(VERSION_TAG).tar.gz"

Expand Down