Skip to content

Commit 6a62d30

Browse files
committed
improve FreeBSD / generic posix support
1 parent 50f30f4 commit 6a62d30

File tree

16 files changed

+58
-17
lines changed

16 files changed

+58
-17
lines changed

Make.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,11 @@ endif
340340

341341
STDLIBCPP_FLAG :=
342342

343+
ifeq ($(OS), FreeBSD)
344+
USEGCC := 0
345+
USECLANG := 1
346+
endif
347+
343348
ifeq ($(OS), Darwin)
344349
DARWINVER := $(shell uname -r | cut -b 1-2)
345350
DARWINVER_GTE13 := $(shell expr `uname -r | cut -b 1-2` \>= 13)

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ developers may find the notes in [CONTRIBUTING](https://github.com/JuliaLang/jul
5353
- **FreeBSD**
5454
- **Windows**
5555

56-
All systems are supported with both x86/64 (64-bit) and x86 (32-bit) architectures. Experimental and early support for [ARM](https://github.com/JuliaLang/julia/blob/master/README.arm.md) is available too.
56+
All systems are supported with both x86/64 (64-bit) and x86 (32-bit) architectures. Experimental and early support for [ARM](https://github.com/JuliaLang/julia/blob/master/README.arm.md), AARCH64, and POWER (little-endian) is available too.
5757

5858
<a name="Source-Download-and-Compilation"/>
5959
## Source Download and Compilation
@@ -235,12 +235,22 @@ When building Julia, or its dependencies, libraries installed by third party pac
235235

236236
### FreeBSD
237237

238-
On *FreeBSD Release 9.0*, install the `gcc47`, `git`, and `gmake` packages/ports, and compile Julia with the command:
238+
On *FreeBSD Release 11.0*, install the gfortran, git, cmake, and gmake packages/ports (`pkg install gcc6 gmake git cmake`), and compile Julia with the command:
239239

240-
$ gmake FC=gfortran47
240+
$ echo 'FC=gfortran6' >> Make.user
241+
$ gmake
241242

242243
You must use the `gmake` command on FreeBSD instead of `make`.
243244

245+
Note that Julia is community-supported and we have little control over our upstream dependencies, you may still run into issues with its dependencies and YMMV. Current known issues includes:
246+
247+
- The x86 arch doesn't support threading due to lack of compiler runtime library support (set JULIA_THREADS=0).
248+
- libunwind needs a small patch to its tests to compile.
249+
- OpenBLAS patches in pkg haven't been upstreamed.
250+
- gfortran can't link binaries. Set `FFLAGS=-Wl,-rpath,/usr/local/lib/gcc6` to workaround this (upstream bug submitted to FreeBSD pkg maintainers).
251+
- System libraries installed by pkg are not on the compiler path by default. You may need to add `LDFLAGS=/usr/local/lib` and `CPPFLAGS=/usr/local/include` to your environment or Make.user file to build successfully.
252+
253+
244254
### Windows
245255

246256
In order to build Julia on Windows, see [README.windows](https://github.com/JuliaLang/julia/blob/master/README.windows.md).

deps/checksums/libuv-28743d6091531340cfe316de2b2d385fe1778ff5.tar.gz/md5

Lines changed: 0 additions & 1 deletion
This file was deleted.

deps/checksums/libuv-28743d6091531340cfe316de2b2d385fe1778ff5.tar.gz/sha512

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4c91d4c9161555c911630b0a70ddec03
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
c53513a5aea84405bf302b084a23f24f54148aac90a2bd666219ce14879723baab959942934d0d801a4572fffd07e60a7d574ade8d7eb57b6da8216063c20a48

deps/libgit2.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@ ifeq ($(OS),Linux)
4747
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-require-openssl.patch-applied $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-openssl-hang.patch-applied
4848
endif
4949
ifneq ($(OS),WINNT)
50+
ifeq ($(USE_SYSTEM_CURL), 0)
5051
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(CURL_OBJ_TARGET)
5152
endif
52-
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/CMakeLists.txt $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-ssh.patch-applied $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-agent-nonfatal.patch-applied $(LIBSSH2_OBJ_TARGET)
53+
endif
54+
ifeq ($(USE_SYSTEM_LIBSSH2), 0)
55+
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(LIBSSH2_OBJ_TARGET)
56+
endif
57+
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/CMakeLists.txt $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-ssh.patch-applied $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-agent-nonfatal.patch-applied
5358
mkdir -p $(dir $@)
5459
cd $(dir $@) && \
5560
$(CMAKE) $(dir $<) $(LIBGIT2_OPTS)

deps/libuv.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
LIBUV_BRANCH=julia-uv1.9.0
2-
LIBUV_SHA1=28743d6091531340cfe316de2b2d385fe1778ff5
2+
LIBUV_SHA1=8d5131b6c1595920dd30644cd1435b4f344b46c8

src/cgmemmgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static void *map_anon_page(size_t size)
4747
mem = (char*)LLT_ALIGN(uintptr_t(mem), jl_page_size);
4848
#else // _OS_WINDOWS_
4949
void *mem = mmap(nullptr, size, PROT_READ | PROT_WRITE,
50-
MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
50+
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
5151
assert(mem != MAP_FAILED && "Cannot allocate RW memory");
5252
#endif // _OS_WINDOWS_
5353
return mem;

src/flisp/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ CCLD := $(LD)
7777
endif
7878

7979
$(BUILDDIR)/$(EXENAME)-debug: $(DOBJS) $(LIBFILES_debug) $(BUILDDIR)/$(LIBTARGET)-debug.a $(BUILDDIR)/flmain.dbg.obj | $(BUILDDIR)/flisp.boot
80-
@$(call PRINT_LINK, $(CCLD) $(DEBUGFLAGS) $(DOBJS) $(BUILDDIR)/flmain.dbg.obj -o $@ $(BUILDDIR)/$(LIBTARGET)-debug.a $(LIBFILES_debug) $(LIBS) $(OSLIBS))
80+
@$(call PRINT_LINK, $(CCLD) $(DEBUGFLAGS) $(LDFLAGS) $(DOBJS) $(BUILDDIR)/flmain.dbg.obj -o $@ $(BUILDDIR)/$(LIBTARGET)-debug.a $(LIBFILES_debug) $(LIBS) $(OSLIBS))
8181

8282
$(BUILDDIR)/$(EXENAME): $(OBJS) $(LIBFILES_release) $(BUILDDIR)/$(LIBTARGET).a $(BUILDDIR)/flmain.o | $(BUILDDIR)/flisp.boot
83-
@$(call PRINT_LINK, $(CCLD) $(SHIPFLAGS) $(OBJS) $(BUILDDIR)/flmain.o -o $@ $(BUILDDIR)/$(LIBTARGET).a $(LIBFILES_release) $(LIBS) $(OSLIBS))
83+
@$(call PRINT_LINK, $(CCLD) $(SHIPFLAGS) $(LDFLAGS) $(OBJS) $(BUILDDIR)/flmain.o -o $@ $(BUILDDIR)/$(LIBTARGET).a $(LIBFILES_release) $(LIBS) $(OSLIBS))
8484

8585
ifneq ($(BUILDDIR),.)
8686
$(BUILDDIR)/flisp.boot: flisp.boot

0 commit comments

Comments
 (0)