diff --git a/.travis.yml b/.travis.yml index 043df379cc610..9f073f494552b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,7 @@ before_install: sudo add-apt-repository ppa:staticfloat/julia-deps -y; sudo apt-get update -qq -y; if [ "$ARCH" = "i686" ]; then + export BUILDOPTS="$BUILDOPTS MARCH=pentium4"; sudo apt-get remove libblas3gf liblapack3gf libarmadillo2 -y; sudo apt-get install binutils:i386 -y; sudo apt-get install gcc:i386 g++:i386 make:i386 cpp:i386 g++-4.6:i386 gcc-4.6:i386 libssl-dev:i386 patchelf:i386 gfortran:i386 llvm-3.3-dev:i386 libsuitesparse-dev:i386 libopenblas-dev:i386 libopenblas-base:i386 libblas-dev:i386 liblapack-dev:i386 liblapack3:i386 libarpack2-dev:i386 libarpack2:i386 libfftw3-dev:i386 libgmp-dev:i386 libpcre3-dev:i386 libunwind7-dev:i386 libopenlibm-dev:i386 libmpfr-dev:i386 -y; diff --git a/Make.inc b/Make.inc index 610ec5d91df3e..9e234c2ac1be1 100644 --- a/Make.inc +++ b/Make.inc @@ -379,6 +379,8 @@ DEBUGFLAGS := -O0 -g -DJL_DEBUG_BUILD -fstack-protector-all SHIPFLAGS := -O3 -g -falign-functions endif +JCPPFLAGS += -ftls-model=global-dynamic + ifeq ($(USECCACHE), 1) # expand CC and CXX at declaration time because we will redefine them CC_ARG := $(CC) # Expand CC and CXX here already because we want @@ -497,6 +499,8 @@ else ifneq ($(XC_HOST),) XC_HOST := $(ARCH)$(shell echo $(XC_HOST) | sed "s/[^-]*\(.*\)$$/\1/") MARCH := $(subst _,-,$(ARCH)) +else # insert ARCH into HOST +XC_HOST := $(ARCH)$(shell echo $(BUILD_MACHINE) | sed "s/[^-]*\(.*\)$$/\1/") endif endif @@ -528,6 +532,18 @@ ARCH := $(BUILD_OS) endif endif +# Detect common pre-SSE2 JULIA_CPU_TARGET values known not to work (#7185) +ifeq ($(MARCH),) +ifneq ($(findstring $(ARCH),i386 i486 i586 i686),) +MARCH := pentium4 +endif +endif + +ifneq ($(findstring $(MARCH),i386 i486 i586 i686 pentium pentium2 pentium3),) +$(error Pre-SSE2 CPU targets not supported. To create a generic 32-bit x86 binary, \ +pass 'MARCH=pentium4'.) +endif + ifneq ($(MARCH),) CC += -march=$(MARCH) CXX += -march=$(MARCH) @@ -551,12 +567,6 @@ endif JULIA_CPU_TARGET ?= native -# Detect common pre-SSE2 JULIA_CPU_TARGET values known not to work (#7185) -ifneq ($(findstring $(JULIA_CPU_TARGET),i386 i486 i586 i686 pentium pentium2 pentium3),) -$(error Pre-SSE2 CPU targets not supported. To create a generic 32-bit x86 binary, \ -pass 'MARCH=i686 JULIA_CPU_TARGET=pentium4', or 'MARCH=pentium4' if not building any dependencies.) -endif - # We map amd64 to x86_64 for compatibility with systems that identify 64-bit systems as such ifeq ($(ARCH),amd64) override ARCH := x86_64 diff --git a/contrib/windows/msys_build.sh b/contrib/windows/msys_build.sh index 64db00243f3df..87cc53c4c22e3 100755 --- a/contrib/windows/msys_build.sh +++ b/contrib/windows/msys_build.sh @@ -62,8 +62,7 @@ else bits=32 archsuffix=86 exc=sjlj - echo "override MARCH = i686" >> Make.user - echo "override JULIA_CPU_TARGET = pentium4" >> Make.user + echo "override MARCH = pentium4" >> Make.user echo 'LIBBLAS = -L$(JULIAHOME)/usr/bin -lopenblas' >> Make.user echo 'LIBBLASNAME = libopenblas' >> Make.user fi diff --git a/src/codegen.cpp b/src/codegen.cpp index e3a99d67f2a80..3e88bdfc56bf0 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -6014,8 +6014,8 @@ extern "C" void jl_init_codegen(void) .setMCJITMemoryManager(std::move(std::unique_ptr{new SectionMemoryManager()})) #endif .setTargetOptions(options) - .setRelocationModel(Reloc::PIC_) - .setCodeModel(CodeModel::Small) + .setRelocationModel(Reloc::Default) + .setCodeModel(CodeModel::JITDefault) #ifdef DISABLE_OPT .setOptLevel(CodeGenOpt::None) #else