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

Plumbing to allow crosscompiles of Ubuntu to ARM variants #534

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion platforms/ubuntu/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ APP_EXTRA_FW_PARTS ?=

ASAN ?= 0
PROF ?= 0
# COMPILER_TOOLKIT, valid options:
# aarch64-linux-gnu
# arm-linux-gnueabi
# arm-linux-gnueabihf
# x86_64-linux-gnu (the default)
COMPILER_TOOLKIT ?= x86_64-linux-gnu

# Explicitly disable updater, it's not supported on POSIX build yet.
MGOS_ENABLE_DEBUG_UDP = 0
Expand Down Expand Up @@ -62,6 +68,12 @@ C_CXX_FLAGS = -ggdb -MD -Wall -Wextra -Werror -pipe \
$(MONGOOSE_FEATURES)
LDFLAGS ?=

# Select compiler toolkit
CC = $(COMPILER_TOOLKIT)-gcc
CXX = $(COMPILER_TOOLKIT)-g++
AR = $(COMPILER_TOOLKIT)-ar
LD = $(COMPILER_TOOLKIT)-ld

ifeq "$(ASAN)" "1"
CC = clang
CXX = clang++
Expand All @@ -86,7 +98,6 @@ CXXFLAGS = -std=gnu++11 -fno-exceptions $(C_CXX_FLAGS) $(APP_CXXFLAGS)
LDFLAGS += -lstdc++

INCDIRS = $(addprefix -I,$(INCLUDES))
AR ?= ar
APP_BIN_LIBS ?=
LIBS ?= pthread cap
LDLIBS = $(addprefix -l,$(LIBS))
Expand Down
4 changes: 2 additions & 2 deletions platforms/ubuntu/src/ubuntu_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ enum mgos_init_result mongoose_init(void) {
cpu_freq = (int) (mgos_get_cpu_freq() / 1000000);
heap_size = mgos_get_heap_size();
free_heap_size = mgos_get_free_heap_size();
LOG(LL_INFO, ("CPU: %d MHz, heap: %lu total, %lu free", cpu_freq, heap_size,
free_heap_size));
LOG(LL_INFO, ("CPU: %d MHz, heap: %lu total, %lu free", cpu_freq,
(unsigned long) heap_size, (unsigned long) free_heap_size));

mgos_invoke_cb(ubuntu_net_up, NULL, false /* from_isr */);

Expand Down
5 changes: 4 additions & 1 deletion tools/docker/ubuntu/Dockerfile-ubuntu-build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
libexpat-dev libncurses5-dev libtool-bin \
python python-dev python-git python-pyelftools python-serial python-six python-yaml \
python3 python3-dev python3-git python3-pyelftools python3-serial python3-six python3-yaml \
software-properties-common texinfo unzip wget zip && \
software-properties-common texinfo unzip wget zip \
gcc-multilib-arm-linux-gnueabi g++-arm-linux-gnueabi \
gcc-multilib-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu && \
apt-get clean

RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
Expand Down