Skip to content

Commit

Permalink
Makefile changes to build on ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
ihnorton committed Sep 6, 2014
1 parent ac590bc commit 93709b0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
20 changes: 13 additions & 7 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,6 @@ DEBUGFLAGS = -O0 -ggdb3 -DJL_DEBUG_BUILD -fstack-protector-all
SHIPFLAGS = -O3 -g -falign-functions
endif

ifneq ($(USEICC),1)
JCFLAGS += -m$(BINARY)
JCXXFLAGS += -m$(BINARY)
JFFLAGS += -m$(BINARY)
endif

ifeq ($(LLVM_VER),svn)
JCXXFLAGS += -std=c++11
endif
Expand Down Expand Up @@ -417,6 +411,15 @@ AS += -q
endif
endif

# Set some ARCH-specific flags
ifneq ($(USEICC),1)
ifneq ($(ARCH), arm)
JCFLAGS += -m$(BINARY)
JCXXFLAGS += -m$(BINARY)
JFFLAGS += -m$(BINARY)
endif
endif

JULIA_CPU_TARGET ?= native
JCPPFLAGS += -DJULIA_TARGET_ARCH=$(JULIA_CPU_TARGET)

Expand All @@ -437,12 +440,15 @@ else ifeq ($(ARCH),i686)
BINARY=32
else ifeq ($(ARCH),x86_64)
BINARY=64
else ifeq ($(ARCH),arm)
BINARY=32
else
$(error "unknown word-size for arch: $(ARCH)")
endif

ifeq ($(USEGCC),1)
ifneq ($(ARCH), ppc64)
ifeq ($(ARCH), arm)
else ifneq ($(ARCH), ppc64)
SHIPFLAGS += -momit-leaf-frame-pointer
endif
endif
Expand Down
6 changes: 3 additions & 3 deletions base/constants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ macro math_const(sym, val, def)
$bigconvert
Base.convert(::Type{Float64}, ::MathConst{$qsym}) = $val
Base.convert(::Type{Float32}, ::MathConst{$qsym}) = $(float32(val))
@assert isa(big($esym), BigFloat)
@assert float64($esym) == float64(big($esym))
@assert float32($esym) == float32(big($esym))
#@assert isa(big($esym), BigFloat)
#@assert float64($esym) == float64(big($esym))
#@assert float32($esym) == float32(big($esym))
end
end

Expand Down
5 changes: 3 additions & 2 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,6 @@ endif
ifneq ($(BUILD_OS),$(OS))
OPENBLAS_BUILD_OPTS += OSNAME=$(OS) CROSS=1 HOSTCC=$(HOSTCC)
endif

ifeq ($(OS),WINNT)
ifneq ($(ARCH),x86_64)
OPENBLAS_BUILD_OPTS += CFLAGS="$(CFLAGS) -mincoming-stack-boundary=2"
Expand Down Expand Up @@ -1109,7 +1108,9 @@ FFTW_SINGLE_OBJ_TARGET = $(build_shlibdir)/libfftw3f.$(SHLIB_EXT)
FFTW_DOUBLE_OBJ_TARGET = $(build_shlibdir)/libfftw3.$(SHLIB_EXT)

FFTW_CONFIG = --enable-shared --disable-fortran --disable-mpi --enable-fma --enable-threads
ifneq ($(ARCH), ppc64)
ifeq ($(ARCH), arm)
FFTW_CONFIG += --enable-neon
else ifneq ($(ARCH), ppc)
FFTW_CONFIG += --enable-sse2
endif
ifeq ($(OS),WINNT)
Expand Down
2 changes: 2 additions & 0 deletions src/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ DLLEXPORT void jl_cpuid(int32_t CPUInfo[4], int32_t InfoType)
{
#if defined _MSC_VER
__cpuid(CPUInfo, InfoType);
#elif defined(__arm__)
printf("jl_cpuid not implemented on arm\n");
#else
__asm__ __volatile__ (
#if defined(__i386__) && defined(__PIC__)
Expand Down
4 changes: 4 additions & 0 deletions src/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ DLLEXPORT size_t rec_backtrace(ptrint_t *data, size_t maxsize)
}
DLLEXPORT size_t rec_backtrace_ctx(ptrint_t *data, size_t maxsize, unw_context_t *uc)
{
#ifndef __arm__
unw_cursor_t cursor;
unw_word_t ip;
size_t n=0;
Expand All @@ -619,6 +620,9 @@ DLLEXPORT size_t rec_backtrace_ctx(ptrint_t *data, size_t maxsize, unw_context_t
data[n++] = ip;
} while (unw_step(&cursor) > 0);
return n;
#else
return 0;
#endif
}
#ifdef LIBOSXUNWIND
size_t rec_backtrace_ctx_dwarf(ptrint_t *data, size_t maxsize, unw_context_t *uc)
Expand Down

0 comments on commit 93709b0

Please sign in to comment.