Skip to content

Commit

Permalink
Merge branch 'master' into patch-16
Browse files Browse the repository at this point in the history
  • Loading branch information
musm authored May 6, 2019
2 parents 6677406 + 9b5fea5 commit a0cee0b
Show file tree
Hide file tree
Showing 42 changed files with 4,313 additions and 109 deletions.
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ ifeq ($(DARWIN_FRAMEWORK),1)
endif

distclean:
-rm -fr $(BUILDROOT)/julia-*.tar.gz $(BUILDROOT)/julia*.exe $(BUILDROOT)/julia-$(JULIA_COMMIT)
-rm -fr $(BUILDROOT)/julia-*.tar.gz $(BUILDROOT)/julia*.exe $(BUILDROOT)/julia-*.7z $(BUILDROOT)/julia-$(JULIA_COMMIT)

binary-dist: distclean
ifeq ($(USE_SYSTEM_BLAS),0)
Expand Down Expand Up @@ -463,8 +463,13 @@ ifeq ($(OS), WINNT)

# build nsis package
cd $(BUILDROOT) && $(call spawn,$(JULIAHOME)/dist-extras/nsis/makensis.exe) -NOCD -DVersion=$(JULIA_VERSION) -DArch=$(ARCH) -DCommit=$(JULIA_COMMIT) -DMUI_ICON="$(call cygpath_w,$(JULIAHOME)/contrib/windows/julia.ico)" $(call cygpath_w,$(JULIAHOME)/contrib/windows/build-installer.nsi) | iconv -f latin1
mv "$(BUILDROOT)/julia-installer.exe" "$(BUILDROOT)/$(JULIA_BINARYDIST_FILENAME).exe"

# compress nsis installer and combine with 7zip self-extracting header
cd $(BUILDROOT) && $(JULIAHOME)/dist-extras/7z a -mx9 "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" julia-installer.exe
cd $(BUILDROOT) && cat $(JULIAHOME)/contrib/windows/7zS.sfx $(JULIAHOME)/contrib/windows/7zSFX-config.txt "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" > "$(JULIA_BINARYDIST_FILENAME).exe"
chmod a+x "$(BUILDROOT)/$(JULIA_BINARYDIST_FILENAME).exe"
-rm -f $(BUILDROOT)/julia-install-$(JULIA_COMMIT)-$(ARCH).7z
-rm -f $(BUILDROOT)/julia-installer.exe
else
cd $(BUILDROOT) && $(TAR) zcvf $(JULIA_BINARYDIST_FILENAME).tar.gz julia-$(JULIA_COMMIT)
endif
Expand Down Expand Up @@ -606,10 +611,10 @@ else
$(error no win-extras target for ARCH=$(ARCH))
endif
cd $(JULIAHOME)/dist-extras && \
$(JLDOWNLOAD) https://sourceforge.net/projects/nsis/files/NSIS%203/3.04/nsis-3.04-setup.exe && \
$(JLDOWNLOAD) https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/unsis/nsis-2.46.5-Unicode-setup.exe && \
chmod a+x 7z.exe && \
chmod a+x 7z.dll && \
$(call spawn,./7z.exe) x -y -onsis nsis-3.04-setup.exe && \
$(call spawn,./7z.exe) x -y -onsis nsis-2.46.5-Unicode-setup.exe && \
chmod a+x ./nsis/makensis.exe

# various statistics about the build that may interest the user
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ helpful to start contributing to the Julia codebase.
- [**Twitter**](https://twitter.com/JuliaLanguage)
- [**Meetup**](https://julia.meetup.com/)

## Binary Installation

If you would rather not compile the latest Julia from source,
platform-specific tarballs with pre-compiled binaries are also
[available for download](https://julialang.org/downloads/).

If everything works correctly, you will see a Julia banner and an
interactive prompt into which you can enter expressions for
evaluation. You can read about [getting
started](https://julialang.org/manual/getting-started) in the manual.

**Note**: Although some system package managers provide Julia, such
installations are neither maintained nor endorsed by the Julia
project. They may be outdated, broken and/or unmaintained. We
recommend you use the official Julia binaries instead.

## Currently Supported Platforms

| Operating System | Architecture | CI | Binaries | Support Level |
Expand Down Expand Up @@ -132,22 +148,6 @@ into. Julia can be completely uninstalled by deleting this
directory. Julia packages are installed in `~/.julia` by default, and
can be uninstalled by deleting `~/.julia`.

## Binary Installation

If you would rather not compile the latest Julia from source,
platform-specific tarballs with pre-compiled binaries are also
[available for download](https://julialang.org/downloads/).

If everything works correctly, you will see a Julia banner and an
interactive prompt into which you can enter expressions for
evaluation. You can read about [getting
started](https://julialang.org/manual/getting-started) in the manual.

**Note**: Although some system package managers provide Julia, such
installations are neither maintained nor endorsed by the Julia
project. They may be outdated and/or unmaintained. We recommend you
use the official Julia binaries instead.

## Source Code Organization

The Julia source code is organized as follows:
Expand Down
2 changes: 1 addition & 1 deletion base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ function empty!(a::Vector)
return a
end

_memcmp(a, b, len) = ccall(:memcmp, Int32, (Ptr{Cvoid}, Ptr{Cvoid}, Csize_t), a, b, len) % Int
_memcmp(a, b, len) = ccall(:memcmp, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Csize_t), a, b, len % Csize_t) % Int

# use memcmp for cmp on byte arrays
function cmp(a::Array{UInt8,1}, b::Array{UInt8,1})
Expand Down
2 changes: 1 addition & 1 deletion base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ eval(Core, :(NamedTuple{names,T}(args::T) where {names, T <: Tuple} =

import .Intrinsics: eq_int, trunc_int, lshr_int, sub_int, shl_int, bitcast, sext_int, zext_int, and_int

throw_inexacterror(f::Symbol, @nospecialize(T), val) = (@_noinline_meta; throw(InexactError(f, T, val)))
throw_inexacterror(f::Symbol, ::Type{T}, val) where {T} = (@_noinline_meta; throw(InexactError(f, T, val)))

function is_top_bit_set(x)
@_inline_meta
Expand Down
7 changes: 7 additions & 0 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2178,4 +2178,11 @@ The base library of Julia. `Base` is a module that contains basic functionality
"""
Base.Base

"""
QuoteNode
A quoted piece of code, that does not support interpolation. See the [manual section about QuoteNodes](@ref man-quote-node) for details.
"""
QuoteNode

end
57 changes: 56 additions & 1 deletion base/meta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,70 @@ export quot,
show_sexpr,
@dump

"""
quot(ex)::Expr
Quote expression `ex` to produce an expression with head `quote`. This can for instance be used to represent objects of type `Expr` in the AST.
See also the manual section about [QuoteNode](@ref man-quote-node).
# Examples
```jldoctest
julia> eval(quot(:x))
:x
julia> dump(quot(:x))
Expr
head: Symbol quote
args: Array{Any}((1,))
1: Symbol x
julia> eval(quot(:(1+2)))
:(1 + 2)
```
"""
quot(ex) = Expr(:quote, ex)

"""
isexpr(ex, head[, n])::Bool
Check if `ex` is an expression with head `head` and `n` arguments.
# Examples
```jldoctest
julia> ex = :(f(x))
:(f(x))
julia> isexpr(ex, :block)
false
julia> isexpr(ex, :call)
true
julia> isexpr(ex, [:block, :call]) # multiple possible heads
true
julia> isexpr(ex, :call, 1)
false
julia> isexpr(ex, :call, 2)
true
```
"""
isexpr(@nospecialize(ex), head::Symbol) = isa(ex, Expr) && ex.head === head
isexpr(@nospecialize(ex), heads::Union{Set,Vector,Tuple}) = isa(ex, Expr) && in(ex.head, heads)
isexpr(@nospecialize(ex), heads, n::Int) = isexpr(ex, heads) && length(ex.args) == n

"""
show_sexpr([io::IO,], ex)
# ---- show_sexpr: print an AST as an S-expression ----
Show expression `ex` as a lisp style S-expression.
# Examples
```jldoctest
julia> show_sexpr(:(f(x, g(y,z))))
(:call, :f, :x, (:call, :g, :y, :z))
```
"""
show_sexpr(ex) = show_sexpr(stdout, ex)
show_sexpr(io::IO, ex) = show_sexpr(io, ex, 0)
show_sexpr(io::IO, ex, indent::Int) = show(io, ex)
Expand Down
2 changes: 1 addition & 1 deletion base/number.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function getindex(x::Number, i::Integer)
end
function getindex(x::Number, I::Integer...)
@_inline_meta
@boundscheck all([i == 1 for i in I]) || throw(BoundsError())
@boundscheck all(isone, I) || throw(BoundsError())
x
end
first(x::Number) = x
Expand Down
6 changes: 2 additions & 4 deletions base/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,8 @@ function tryparse_internal(::Type{Bool}, sbuff::Union{String,SubString{String}},
len = endpos - startpos + 1
p = pointer(sbuff) + startpos - 1
GC.@preserve sbuff begin
(len == 4) && (0 == ccall(:memcmp, Int32, (Ptr{UInt8}, Ptr{UInt8}, UInt),
p, "true", 4)) && (return true)
(len == 5) && (0 == ccall(:memcmp, Int32, (Ptr{UInt8}, Ptr{UInt8}, UInt),
p, "false", 5)) && (return false)
(len == 4) && (0 == _memcmp(p, "true", 4)) && (return true)
(len == 5) && (0 == _memcmp(p, "false", 5)) && (return false)
end

if raise
Expand Down
8 changes: 5 additions & 3 deletions base/strings/string.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,19 @@ end

## comparison ##

_memcmp(a::Union{Ptr{UInt8},AbstractString}, b::Union{Ptr{UInt8},AbstractString}, len) =
ccall(:memcmp, Cint, (Ptr{UInt8}, Ptr{UInt8}, Csize_t), a, b, len % Csize_t) % Int

function cmp(a::String, b::String)
al, bl = sizeof(a), sizeof(b)
c = ccall(:memcmp, Int32, (Ptr{UInt8}, Ptr{UInt8}, UInt),
a, b, min(al,bl))
c = _memcmp(a, b, min(al,bl))
return c < 0 ? -1 : c > 0 ? +1 : cmp(al,bl)
end

function ==(a::String, b::String)
pointer_from_objref(a) == pointer_from_objref(b) && return true
al = sizeof(a)
return al == sizeof(b) && 0 == ccall(:memcmp, Int32, (Ptr{UInt8}, Ptr{UInt8}, UInt), a, b, al % UInt)
return al == sizeof(b) && 0 == _memcmp(a, b, al)
end

typemin(::Type{String}) = ""
Expand Down
3 changes: 1 addition & 2 deletions base/strings/substring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ nextind(s::SubString{String}, i::Int) = _nextind_str(s, i)
function cmp(a::SubString{String}, b::SubString{String})
na = sizeof(a)
nb = sizeof(b)
c = ccall(:memcmp, Int32, (Ptr{UInt8}, Ptr{UInt8}, UInt),
pointer(a), pointer(b), min(na, nb))
c = _memcmp(a, b, min(na, nb))
return c < 0 ? -1 : c > 0 ? +1 : cmp(na, nb)
end

Expand Down
6 changes: 2 additions & 4 deletions base/strings/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ function startswith(a::Union{String, SubString{String}},
cub = ncodeunits(b)
if ncodeunits(a) < cub
false
elseif ccall(:memcmp, Int32, (Ptr{UInt8}, Ptr{UInt8}, UInt),
pointer(a), pointer(b), sizeof(b)) == 0
elseif _memcmp(a, b, sizeof(b)) == 0
nextind(a, cub) == cub + 1
else
false
Expand All @@ -64,8 +63,7 @@ function endswith(a::Union{String, SubString{String}},
astart = ncodeunits(a) - ncodeunits(b) + 1
if astart < 1
false
elseif ccall(:memcmp, Int32, (Ptr{UInt8}, Ptr{UInt8}, UInt),
pointer(a, astart), pointer(b), sizeof(b)) == 0
elseif GC.@preserve(a, _memcmp(pointer(a, astart), b, sizeof(b))) == 0
thisind(a, astart) == astart
else
false
Expand Down
Binary file added contrib/windows/7zS.sfx
Binary file not shown.
4 changes: 4 additions & 0 deletions contrib/windows/7zSFX-config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
;!@Install@!UTF-8!
Title="The Julia Language"
RunProgram="julia-installer.exe"
;!@InstallEnd@!
27 changes: 27 additions & 0 deletions contrib/windows/7zSFX-manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--Windows 8.1 and Windows Server 2012 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
</application>
</compatibility>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
5 changes: 3 additions & 2 deletions contrib/windows/build-installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

Name "The Julia Language"
OutFile "julia-installer.exe"
SetCompressor /SOLID lzma
SetCompressorDictSize 64
SetCompress off
CRCCheck on
SetDataBlockOptimize on
ShowInstDetails show
Expand Down Expand Up @@ -154,3 +153,5 @@ FunctionEnd
Function ShowInstallFolder
ExecShell "open" $INSTDIR
FunctionEnd


1 change: 1 addition & 0 deletions deps/checksums/llvm-8.0.0.src.tar.xz/md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
74818f431563603515a62be1ee69a142
1 change: 1 addition & 0 deletions deps/checksums/llvm-8.0.0.src.tar.xz/sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1602343b451b964f5d8c2d6b0654d89384c80d45883498c5f0e2f4196168dd4a1ed2a4dadb752076020243df42ffe46cb31d82ffc145d8e5874163cbb9686a1f
28 changes: 27 additions & 1 deletion deps/llvm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,33 @@ endif
$(eval $(call LLVM_PATCH,llvm-D51842-win64-byval-cc))
$(eval $(call LLVM_PATCH,llvm-D57118-powerpc))
$(eval $(call LLVM_PATCH,llvm-r355582-avxminmax)) # remove for 8.0
endif # LLVM_VER
endif # LLVM_VER 6.0

ifeq ($(LLVM_VER_SHORT),7.0)
$(eval $(call LLVM_PATCH,llvm-D27629-AArch64-large_model_6.0.1))
$(eval $(call LLVM_PATCH,llvm-D34078-vectorize-fdiv))
$(eval $(call LLVM_PATCH,llvm-6.0-NVPTX-addrspaces)) # NVPTX -- warning: this fails check-llvm-codegen-nvptx
$(eval $(call LLVM_PATCH,llvm-7.0-D44650)) # mingw32 build fix
$(eval $(call LLVM_PATCH,llvm-D46460))
$(eval $(call LLVM_PATCH,llvm-6.0-DISABLE_ABI_CHECKS))
$(eval $(call LLVM_PATCH,llvm7-D50010-VNCoercion-ni))
$(eval $(call LLVM_PATCH,llvm-7.0-D50167-scev-umin))
$(eval $(call LLVM_PATCH,llvm7-windows-race))
$(eval $(call LLVM_PATCH,llvm7-D51842-win64-byval-cc)) # remove for 8.0
$(eval $(call LLVM_PATCH,llvm-D57118-powerpc))
endif # LLVM_VER 7.0

ifeq ($(LLVM_VER_SHORT),8.0)
$(eval $(call LLVM_PATCH,llvm-D27629-AArch64-large_model_6.0.1))
$(eval $(call LLVM_PATCH,llvm8-D34078-vectorize-fdiv))
$(eval $(call LLVM_PATCH,llvm-6.0-NVPTX-addrspaces)) # NVPTX -- warning: this fails check-llvm-codegen-nvptx
$(eval $(call LLVM_PATCH,llvm-7.0-D44650)) # mingw32 build fix
$(eval $(call LLVM_PATCH,llvm-6.0-DISABLE_ABI_CHECKS))
$(eval $(call LLVM_PATCH,llvm7-D50010-VNCoercion-ni))
$(eval $(call LLVM_PATCH,llvm-8.0-D50167-scev-umin))
$(eval $(call LLVM_PATCH,llvm7-windows-race))
$(eval $(call LLVM_PATCH,llvm-D57118-powerpc)) # remove for 9.0
endif # LLVM_VER 8.0

# Add a JL prefix to the version map. DO NOT REMOVE
ifeq ($(LLVM_VER_SHORT), 6.0)
Expand Down
13 changes: 13 additions & 0 deletions deps/patches/llvm-7.0-D44650.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/tools/llvm-cfi-verify/CMakeLists.txt b/tools/llvm-cfi-verify/CMakeLists.txt
index ae12bec5e80..9ffbe4e070d 100644
--- a/tools/llvm-cfi-verify/CMakeLists.txt
+++ b/tools/llvm-cfi-verify/CMakeLists.txt
@@ -11,7 +11,7 @@ set(LLVM_LINK_COMPONENTS
Symbolize
)

-add_llvm_tool(llvm-cfi-verify
+add_llvm_tool(llvm-cfi-verify DISABLE_LLVM_LINK_LLVM_DYLIB
llvm-cfi-verify.cpp
)

Loading

0 comments on commit a0cee0b

Please sign in to comment.