Index: head/devel/flang/Makefile =================================================================== --- head/devel/flang/Makefile (revision 452496) +++ head/devel/flang/Makefile (revision 452497) @@ -1,61 +1,60 @@ # Created by: Johannes M Dieterich # $FreeBSD$ PORTNAME= flang -DISTVERSION= 4.0-20170812 +DISTVERSION= 4.0-20171019 PORTREVISION= 1 CATEGORIES= devel MAINTAINER= jmd@FreeBSD.org COMMENT= Fortran compiler targeting LLVM LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE.txt BUILD_DEPENDS= llvm40>=0:devel/llvm40 \ - openmp>=0:devel/openmp \ flang-clang>=0:devel/flang-clang RUN_DEPENDS= llvm40>=0:devel/llvm40 \ - openmp>=0:devel/openmp \ flang-clang>=0:devel/flang-clang ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON_amd64= for now only builds and is supported on amd64 OPTIONS_DEFINE= TESTS TESTS_DESC= build unit tests for flang USE_LDCONFIG= ${PREFIX}/flang/lib USES= cmake:outsource,noninja compiler:c++11-lib libedit perl5 tar:xz \ shebangfix _USES_PYTHON?= python:build USES+= ${_USES_PYTHON} USE_GITHUB= yes GH_ACCOUNT= flang-compiler -GH_TAGNAME= f7af78c +GH_TAGNAME= e68c31f CMAKE_ARGS+= -DLLVM_CONFIG=${LOCALBASE}/bin/llvm-config40 \ -DCMAKE_CXX_COMPILER=${LOCALBASE}flang/bin/clang++ \ -DCMAKE_C_COMPILER=${LOCALBASE}/flang/bin/clang \ - -DCMAKE_Fortran_COMPILER=${LOCALBASE}/flang/bin/flang + -DCMAKE_Fortran_COMPILER=${LOCALBASE}/flang/bin/flang \ + -DFLANG_LIBOMP=${LOCALBASE}/llvm40/lib/libomp.so CMAKE_INSTALL_PREFIX= ${PREFIX}/flang .include .if ${PORT_OPTIONS:MTESTS} CMAKE_ARGS+= -DFLANG_INCLUDE_TESTS=ON .endif MAKE_JOBS_UNSAFE= yes post-patch: @${CP} -r ${WRKSRC}/tools/flang2/flang2exe/x86_64-Linux ${WRKSRC}/tools/flang2/flang2exe/x86_64-FreeBSD post-install: @${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \ < ${FILESDIR}/flang.in > \ ${WRKDIR}/flang ${INSTALL_SCRIPT} ${WRKDIR}/flang ${STAGEDIR}/${PREFIX}/bin/flang .include Index: head/devel/flang/distinfo =================================================================== --- head/devel/flang/distinfo (revision 452496) +++ head/devel/flang/distinfo (revision 452497) @@ -1,3 +1,3 @@ -TIMESTAMP = 1502586565 -SHA256 (flang-compiler-flang-4.0-20170812-f7af78c_GH0.tar.gz) = 96c38c73f1ed5b3ba45e04232ec4b6ad4fb25a3cc0b1fa48a0036d51ecee1329 -SIZE (flang-compiler-flang-4.0-20170812-f7af78c_GH0.tar.gz) = 3587549 +TIMESTAMP = 1508451863 +SHA256 (flang-compiler-flang-4.0-20171019-e68c31f_GH0.tar.gz) = 5797b5ea4f97f80428c3e918ed4579044a42a94550af5d3ab6603020ed3b9499 +SIZE (flang-compiler-flang-4.0-20171019-e68c31f_GH0.tar.gz) = 3926694 Index: head/devel/flang/files/patch-runtime_flangrti_erfc__scaled.c =================================================================== --- head/devel/flang/files/patch-runtime_flangrti_erfc__scaled.c (revision 452496) +++ head/devel/flang/files/patch-runtime_flangrti_erfc__scaled.c (nonexistent) @@ -1,11 +0,0 @@ ---- runtime/flangrti/erfc_scaled.c.orig 2017-05-17 00:40:01 UTC -+++ runtime/flangrti/erfc_scaled.c -@@ -19,7 +19,7 @@ - #pragma global - Mx, 6, 0x100 - - #include "mthdecls.h" --#if defined(TARGET_WIN) || defined(win32) || defined(TARGET_OSX) -+#if defined(TARGET_WIN) || defined(win32) || defined(TARGET_OSX) || defined(__FreeBSD__) - #include - #else - #include Property changes on: head/devel/flang/files/patch-runtime_flangrti_erfc__scaled.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/flang/files/patch-runtime_flang_cexp.c =================================================================== --- head/devel/flang/files/patch-runtime_flang_cexp.c (revision 452496) +++ head/devel/flang/files/patch-runtime_flang_cexp.c (nonexistent) @@ -1,12 +0,0 @@ ---- runtime/flang/cexp.c.orig 2017-05-17 00:40:01 UTC -+++ runtime/flang/cexp.c -@@ -22,7 +22,8 @@ __mth_i_cexp(cmplx_t *cmplx, float real, - { - float x, y, z; - x = exp(real); -- sincosf(imag, &z, &y); -+ z = sinf(imag); -+ y = cosf(imag); - y *= x; - z *= x; - r_dummy(y, z); /* should leave y & z in appropriate Property changes on: head/devel/flang/files/patch-runtime_flang_cexp.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/flang/files/patch-runtime_flangrti_erfc__scaledf.c =================================================================== --- head/devel/flang/files/patch-runtime_flangrti_erfc__scaledf.c (revision 452496) +++ head/devel/flang/files/patch-runtime_flangrti_erfc__scaledf.c (nonexistent) @@ -1,11 +0,0 @@ ---- runtime/flangrti/erfc_scaledf.c.orig 2017-05-17 00:40:01 UTC -+++ runtime/flangrti/erfc_scaledf.c -@@ -19,7 +19,7 @@ - #pragma global - Mx, 6, 0x100 - - #include "mthdecls.h" --#if defined(TARGET_WIN) || defined(win32) || defined(TARGET_OSX) -+#if defined(TARGET_WIN) || defined(win32) || defined(TARGET_OSX) || defined(__FreeBSD__) - #include - #else - #include Property changes on: head/devel/flang/files/patch-runtime_flangrti_erfc__scaledf.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/flang/files/patch-runtime_flang_cdexp.c =================================================================== --- head/devel/flang/files/patch-runtime_flang_cdexp.c (revision 452496) +++ head/devel/flang/files/patch-runtime_flang_cdexp.c (nonexistent) @@ -1,12 +0,0 @@ ---- runtime/flang/cdexp.c.orig 2017-05-17 00:40:01 UTC -+++ runtime/flang/cdexp.c -@@ -22,7 +22,8 @@ __mth_i_cdexp(dcmplx_t *dcmplx, double r - { - double x, y, z; - x = exp(real); -- sincos(imag, &z, &y); -+ z = sin(imag); -+ y = cos(imag); - y *= x; - z *= x; - d_dummy(y, z); /* should leave y & z in appropriate Property changes on: head/devel/flang/files/patch-runtime_flang_cdexp.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/flang/files/patch-CMakeLists.txt =================================================================== --- head/devel/flang/files/patch-CMakeLists.txt (revision 452496) +++ head/devel/flang/files/patch-CMakeLists.txt (revision 452497) @@ -1,41 +1,41 @@ ---- CMakeLists.txt.orig 2017-07-17 19:12:06 UTC +--- CMakeLists.txt.orig 2017-10-19 11:03:03 UTC +++ CMakeLists.txt -@@ -48,6 +48,19 @@ if( ${TARGET_OS} STREQUAL "Linux" ) +@@ -51,6 +51,19 @@ if( ${TARGET_OS} STREQUAL "Linux" ) message("Unsupported architecture: ${TARGET_ARCHITECTURE}" ) return() endif() +elseif( ${TARGET_OS} STREQUAL "FreeBSD" ) + set(OS "FREEBSD") + set(OSNAME "FreeBSD") + # this is very hacky! + if( ${TARGET_ARCHITECTURE} STREQUAL "amd64" ) + set(ARCHNAME x86-64) + set(ARCH X86) + set(WRDSZ 64) + set(TARGET_ARCHITECTURE x86_64) + else() + message("Unsupported architecture: ${TARGET_ARCHITECTURE}" ) + return() + endif() else() message("Unsupported OS: ${TARGET_OS}" ) return() -@@ -56,7 +69,8 @@ endif() +@@ -59,7 +72,8 @@ endif() # The cmake documentation states that these are set. They are not so we # set them here set(CMAKE_HOST_SYSTEM_NAME ${TARGET_OS}) -set(CMAKE_HOST_SYSTEM_PROCESSOR ${TARGET_ARCHITECTURE}) +# also a hack +set(CMAKE_HOST_SYSTEM_PROCESSOR "x86-64") # If we are not building as a part of LLVM, build Flang as an # standalone project, using LLVM as an external library: -@@ -292,7 +306,7 @@ endif() +@@ -296,7 +310,7 @@ endif() # Add appropriate flags for GCC if (LLVM_COMPILER_IS_GCC_COMPATIBLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings") -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-macro-redefined -Wno-logical-not-parentheses -Wno-unknown-warning-option") - endif () - - if (APPLE) +- option(WITH_WERROR "Compile with '-Werror' C compiler flag" ON) ++ option(WITH_WERROR "Compile with '-Werror' C compiler flag" OFF) + if (WITH_WERROR) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + endif () Index: head/devel/flang/files/patch-runtime_flang_async.c =================================================================== --- head/devel/flang/files/patch-runtime_flang_async.c (revision 452496) +++ head/devel/flang/files/patch-runtime_flang_async.c (revision 452497) @@ -1,37 +1,14 @@ ---- runtime/flang/async.c.orig 2017-05-17 00:40:01 UTC +--- runtime/flang/async.c.orig 2017-10-19 11:03:03 UTC +++ runtime/flang/async.c -@@ -27,6 +27,8 @@ - * Fio_asy_close - called from close - */ +@@ -39,9 +39,10 @@ + #include + #endif +#include + - #if !defined(INTERIX86) && !defined(TARGET_INTERIX) && !defined(TARGET_OSX) && !defined(CRAY) && !defined(TARGET_WIN_X8632) - - #if !defined(TARGET_WIN_X8664) -@@ -44,7 +46,6 @@ #include "stdioInterf.h" #include "async.h" - - + #define FIO_MAX_ASYNC_TRANSACTIONS 16 - /* one struct per file */ -@@ -320,7 +321,7 @@ Fio_asy_read(struct asy *asy, void *adr, - asy->aiocb[tn].aio_reqprio = 0; - asy->aiocb[tn].aio_buf = adr; - asy->aiocb[tn].aio_nbytes = len; -- memset(&(asy->aiocb[tn].aio_sigevent), 0, sizeof(sigevent_t)); -+ memset(&(asy->aiocb[tn].aio_sigevent), 0, sizeof(struct sigevent)); - asy->aiocb[tn].aio_offset = asy->atd[tn].off; - n = aio_read(&(asy->aiocb[tn])); - #endif -@@ -374,7 +375,7 @@ Fio_asy_write(struct asy *asy, void *adr - asy->aiocb[tn].aio_reqprio = 0; - asy->aiocb[tn].aio_buf = adr; - asy->aiocb[tn].aio_nbytes = len; -- memset(&(asy->aiocb[tn].aio_sigevent), 0, sizeof(sigevent_t)); -+ memset(&(asy->aiocb[tn].aio_sigevent), 0, sizeof(struct sigevent)); - asy->aiocb[tn].aio_offset = asy->atd[tn].off; - n = aio_write(&(asy->aiocb[tn])); - #endif Index: head/devel/flang/files/patch-runtime_flang_stime3f.c =================================================================== --- head/devel/flang/files/patch-runtime_flang_stime3f.c (revision 452496) +++ head/devel/flang/files/patch-runtime_flang_stime3f.c (revision 452497) @@ -1,17 +1,17 @@ ---- runtime/flang/stime3f.c.orig 2017-05-17 00:40:01 UTC +--- runtime/flang/stime3f.c.orig 2017-10-19 11:03:03 UTC +++ runtime/flang/stime3f.c @@ -27,13 +27,7 @@ int ENT3F(STIME, stime)(int *tp) { - int i; - time_t t = *tp; - - if ((i = stime(&t))) - i = __io_errno(); - - return i; + return EPERM; } #endif /* !WINNT */ Index: head/devel/flang/files/patch-runtime_flangrti_dumpregs.h =================================================================== --- head/devel/flang/files/patch-runtime_flangrti_dumpregs.h (revision 452496) +++ head/devel/flang/files/patch-runtime_flangrti_dumpregs.h (revision 452497) @@ -1,11 +1,11 @@ ---- runtime/flangrti/dumpregs.h.orig 2017-05-17 00:40:01 UTC +--- runtime/flangrti/dumpregs.h.orig 2017-10-19 11:03:03 UTC +++ runtime/flangrti/dumpregs.h @@ -21,6 +21,6 @@ * Declare routines that access the machine registers */ -void dumpregs(gregset_t *regs); -gregset_t *getRegs(ucontext_t *u); +void dumpregs(void *regs); +void *getRegs(ucontext_t *u); Index: head/devel/flang/files/patch-runtime_flangrti_iostdinit.c =================================================================== --- head/devel/flang/files/patch-runtime_flangrti_iostdinit.c (revision 452496) +++ head/devel/flang/files/patch-runtime_flangrti_iostdinit.c (revision 452497) @@ -1,28 +1,28 @@ ---- runtime/flangrti/iostdinit.c.orig 2017-05-17 00:40:01 UTC +--- runtime/flangrti/iostdinit.c.orig 2017-10-19 11:03:03 UTC +++ runtime/flangrti/iostdinit.c @@ -160,7 +160,7 @@ __io_ferror(void *p) int __io_getfd(void *fp) { - return (((FILE *)fp)->_fileno); + return (((FILE *)fp)->_file); } /* is a tty? */ -@@ -270,14 +270,14 @@ extern long *_imp___timezone_dll; /* for +@@ -270,14 +270,14 @@ extern long *_imp___timezone_dll; /* for crtdll.dll */ #define timezone _timezone /* cygnus, timezone is usually a function */ #endif -#elif !defined(DEC) && !defined(IBM) && !defined(ST100_V1_2) && !defined(OSX86) /* !defined(WINNT) */ +#elif !defined(DEC) && !defined(IBM) && !defined(ST100_V1_2) && !defined(OSX86) && !defined(__FreeBSD__) /* !defined(WINNT) */ extern time_t timezone; /* for the rest */ #endif int __io_timezone(void *tm) { -#if defined(SUN4) || defined(PPC) || defined(OSX86) +#if defined(SUN4) || defined(PPC) || defined(OSX86) || defined(__FreeBSD__) return ((struct tm *)tm)->tm_gmtoff; #elif defined(WINNT) || defined(WIN64) || defined(WIN32) return (0); Index: head/devel/flang/files/patch-runtime_flangrti_trace__lin.c =================================================================== --- head/devel/flang/files/patch-runtime_flangrti_trace__lin.c (revision 452496) +++ head/devel/flang/files/patch-runtime_flangrti_trace__lin.c (revision 452497) @@ -1,20 +1,20 @@ ---- runtime/flangrti/trace_lin.c.orig 2017-05-17 00:40:01 UTC +--- runtime/flangrti/trace_lin.c.orig 2017-10-19 11:03:03 UTC +++ runtime/flangrti/trace_lin.c @@ -85,7 +85,7 @@ static struct sigs sigs[] = { {0, CODNULL, NULL} /* end of list */ }; -static gregset_t *regs; /* pointer to regs at signal */ +static void *regs; /* pointer to regs at signal */ /* walk the stack back */ @@ -99,7 +99,7 @@ __abort_trace(int skip) char **strings; - size_t i, n; + size_t i; - if (regs != (gregset_t *)0) { + if (regs != (void *)0) { dumpregs(regs); } Index: head/devel/flang/files/patch-runtime_flangrti_x86__64-Linux_dumpregs.c =================================================================== --- head/devel/flang/files/patch-runtime_flangrti_x86__64-Linux_dumpregs.c (revision 452496) +++ head/devel/flang/files/patch-runtime_flangrti_x86__64-Linux_dumpregs.c (revision 452497) @@ -1,11 +1,11 @@ ---- runtime/flangrti/x86_64-Linux/dumpregs.c.orig 2017-05-17 00:40:01 UTC +--- runtime/flangrti/x86_64-Linux/dumpregs.c.orig 2017-10-19 11:03:03 UTC +++ runtime/flangrti/x86_64-Linux/dumpregs.c @@ -40,7 +40,7 @@ #define RSP 15 #define RIP 16 -#if defined(TARGET_OSX) || defined(TARGET_WIN) +#if defined(TARGET_OSX) || defined(TARGET_WIN) || defined(__FreeBSD__) /* no gregs and/or ucontext defined in for OSX or Windows */ void * getRegs(void *u) Index: head/devel/flang-clang/Makefile =================================================================== --- head/devel/flang-clang/Makefile (revision 452496) +++ head/devel/flang-clang/Makefile (revision 452497) @@ -1,46 +1,44 @@ # Created by: Johannes M Dieterich # $FreeBSD$ PORTNAME= flang-clang -DISTVERSION= 4.0-20170812 +DISTVERSION= 4.0-20171019 PORTREVISION= 1 CATEGORIES= devel lang MAINTAINER= jmd@FreeBSD.org COMMENT= Fortran compiler targeting LLVM (modified clang part) LICENSE= LLVM LICENSE_NAME= LLVM Release License LICENSE_FILE= ${WRKSRC}/LICENSE.TXT LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept -BUILD_DEPENDS= llvm40>=0:devel/llvm40 \ - openmp>=0:devel/openmp -RUN_DEPENDS= llvm40>=0:devel/llvm40 \ - openmp>=0:devel/openmp +BUILD_DEPENDS= llvm40>=0:devel/llvm40 +RUN_DEPENDS= llvm40>=0:devel/llvm40 ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON_amd64= for now only builds and is supported on amd64 USE_LDCONFIG= ${PREFIX}/flang/lib USES= cmake:outsource compiler:c++11-lib libedit tar:xz perl5 \ python shebangfix USE_GNOME+= libxml2 SHEBANG_FILES= tools/scan-view/bin/scan-view \ tools/clang-format/git-clang-format \ tools/clang-format/clang-format-diff.py USE_GITHUB= yes GH_ACCOUNT= flang-compiler GH_PROJECT= clang -GH_TAGNAME= 79d1970 +GH_TAGNAME= 70938ea CMAKE_ARGS+= -DLLVM_CONFIG=${LOCALBASE}/bin/llvm-config40 CMAKE_INSTALL_PREFIX= ${PREFIX}/flang post-install: @${GZIP_CMD} ${STAGEDIR}/${PREFIX}/flang/man/man1/scan-build.1 .include Index: head/devel/flang-clang/distinfo =================================================================== --- head/devel/flang-clang/distinfo (revision 452496) +++ head/devel/flang-clang/distinfo (revision 452497) @@ -1,3 +1,3 @@ -TIMESTAMP = 1502586432 -SHA256 (flang-compiler-clang-4.0-20170812-79d1970_GH0.tar.gz) = e1b3442b6ccfc9574e0e4479e55b66baf57d957ac1b4652a38e29ae221e51d4f -SIZE (flang-compiler-clang-4.0-20170812-79d1970_GH0.tar.gz) = 15210102 +TIMESTAMP = 1508451770 +SHA256 (flang-compiler-clang-4.0-20171019-70938ea_GH0.tar.gz) = 6b462819323e3dcd0a34a844582adbfd47936d108be66850bb2e75853c66e354 +SIZE (flang-compiler-clang-4.0-20171019-70938ea_GH0.tar.gz) = 15209610