diff options
author | Lev A. Serebryakov <lev@FreeBSD.org> | 2014-07-09 12:29:08 +0000 |
---|---|---|
committer | Lev A. Serebryakov <lev@FreeBSD.org> | 2014-07-09 12:29:08 +0000 |
commit | 5484b014554d70f0d12cc537845e3e3123346fca (patch) | |
tree | 656d15a4ba718a1bf8c5bedc3f9a6d6aaa66ae02 /devel | |
parent | fc90aae4c661418c1e2edad14653fc2371d20797 (diff) | |
download | ports-5484b014554d70f0d12cc537845e3e3123346fca.tar.gz ports-5484b014554d70f0d12cc537845e3e3123346fca.zip |
Notes
Diffstat (limited to 'devel')
-rw-r--r-- | devel/gcc-arm-embedded/Makefile | 55 | ||||
-rw-r--r-- | devel/gcc-arm-embedded/files/Makefile | 205 | ||||
-rw-r--r-- | devel/gcc-arm-embedded/files/extra-patch-gcc-isl-0.13-compatibility | 457 |
3 files changed, 679 insertions, 38 deletions
diff --git a/devel/gcc-arm-embedded/Makefile b/devel/gcc-arm-embedded/Makefile index 0c7c43541d93..42de8572939a 100644 --- a/devel/gcc-arm-embedded/Makefile +++ b/devel/gcc-arm-embedded/Makefile @@ -13,17 +13,22 @@ COMMENT= Complete gcc-based toolcahin for embedded ARM development LICENSE= GPLv2 LGPL20 LGPL21 GPLv3 LGPL3 LICENSE_COMB= multi -LIB_DEPENDS= libgmp.so:${PORTSDIR}/math/gmp \ - libmpfr.so:${PORTSDIR}/math/mpfr \ - libmpc.so:${PORTSDIR}/math/mpc \ - libcloog-isl.so:${PORTSDIR}/math/cloog \ - libelf.so:${PORTSDIR}/devel/libelf - -OPTIONS_DEFINE= EXAMPLES HTML PDF +OPTIONS_DEFINE= PURE EXAMPLES HTML PDF OPTIONS_DEFAULT=EXAMPLES +PURE_DESC= Use all libraries from bundle, do not depend on anything HTML_DESC= Install HTML documentation PDF_DESC= Install PDF documentation (requires TeX, it is huge) +PURE_EXTRA_PATCHES_OFF= ${PATCHDIR}/extra-patch-gcc-isl-0.13-compatibility +PURE_LIB_DEPENDS_OFF= \ + libexpat.so:${PORTSDIR}/textproc/expat2 \ + libgmp.so:${PORTSDIR}/math/gmp \ + libmpfr.so:${PORTSDIR}/math/mpfr \ + libmpc.so:${PORTSDIR}/math/mpc \ + libisl.so:${PORTSDIR}/devel/isl \ + libcloog-isl.so:${PORTSDIR}/math/cloog \ + libelf.so:${PORTSDIR}/devel/libelf + PDF_USE= TEX=base:build,tex:build PDF_BUILD_DEPENDS= texi2dvi:${PORTSDIR}/print/texinfo OPTIONS_SUB= yes @@ -31,6 +36,8 @@ OPTIONS_SUB= yes USES= bison compiler gmake iconv makeinfo tar:bzip2 GNU_CONFIGURE= yes +PATCH_WRKSRC= ${WRKDIR}/${ORIGINAL_PACKAGE_NAME} + BUILD_WRKSRC= ${WRKDIR} FULL_VERSION= 4_8-2014q2-20140609 @@ -50,21 +57,41 @@ PLIST_SUB+= TARGET=${TARGET} FULL_VERSION=${FULL_VERSION} DOCS_SUFFIX= share/doc/gcc-${TARGET} SRC_DIR= ${WRKDIR}/${ORIGINAL_PACKAGE_NAME}/src BUILD_DIR= ${WRKDIR}/build -INTERIM_PREFIX= ${WRKDIR}/install/${PORTNAME}-${FULL_VERSION} +INTERIM_WORLD= ${WRKDIR}/install +INTERIM_PREFIX= ${INTERIM_WORLD}/${PORTNAME}-${FULL_VERSION} + +BUNDLED_LIBS= EXPAT:gz ZLIB:bz2 LIBELF:gz \ + GMP:bz2 MPFR:bz2 MPC:gz ISL:bz2 CLOOG:gz +BUNDLED_VERSION_EXPAT= 2.0.1 +BUNDLED_VERSION_ZLIB= 1.2.5 +BUNDLED_VERSION_LIBELF= 0.8.13 +BUNDLED_VERSION_GMP= 4.3.2 +BUNDLED_VERSION_MPFR= 2.4.2 +BUNDLED_VERSION_MPC= 0.8.1 +BUNDLED_VERSION_ISL= 0.11.1 +BUNDLED_VERSION_CLOOG= 0.18.0 + VAR_TO_SUBMAKE= BUILD_DIR CC CFLAGS CHOSEN_COMPILER_TYPE CONFIG_SITE \ CONFIGURE_MAX_CMD_LEN CP CPP CPPFLAGS CXX CXXFLAGS \ DOCS_SUFFIX ECHO_MSG EXAMPLESDIR FILE FIND GMAKE GREP \ - MAKE_CMD \ - INSTALL_MACROS INTERIM_PREFIX LD LDFLAGS LIBDIR LN LOCALBASE \ - MAKE_JOBS_NUMBER MKDIR ORIGINAL_PACKAGE_NAME PORT_OPTIONS \ - PREFIX RM SED SH SRC_DIR STRIP_CMD TAR TARGET WRKDIR + MAKE_CMD PATCH \ + INSTALL_MACROS INTERIM_PREFIX INTERIM_WORLD LD LDFLAGS LIBDIR \ + LN LOCALBASE MAKE_JOBS_NUMBER MKDIR ORIGINAL_PACKAGE_NAME \ + PORT_OPTIONS PREFIX RM SED SH SRC_DIR STRIP_CMD TAR TARGET \ + WRKDIR VAR_TO_SUBMAKE_NOEXPAND= CONFIGURE_ENV MAKE_ENV .include <bsd.port.pre.mk> post-extract: +.if ${PORT_OPTIONS:MPURE} +.for L in ${BUNDLED_LIBS} + @${ECHO_MSG} "====> Extracting bundled ${L:C/[:].+//:tl}" + @${TAR} -xf ${SRC_DIR}/${L:C/[:].+//:tl}-${BUNDLED_VERSION_${L:C/[:].+//}}.tar.${L:C/.+[:]//} -C ${SRC_DIR} +.endfor +.endif @${ECHO_MSG} "====> Extracting bundled binutils" @${TAR} -xf ${SRC_DIR}/binutils.tar.bz2 -C ${SRC_DIR} @${ECHO_MSG} "====> Extracting bundled gcc" @@ -88,6 +115,10 @@ do-configure: .for VAR in ${VAR_TO_SUBMAKE} @${ECHO} '${VAR}=${${VAR}}' >> ${WRKDIR}/Makefile.inc .endfor +.for L in ${BUNDLED_LIBS} + @${ECHO} -n 'BUNDLED_VERSION_${L:C/[:].+//}=' >> ${WRKDIR}/Makefile.inc + @${ECHO} '${BUNDLED_VERSION_${L:C/[:].+//}}' >> ${WRKDIR}/Makefile.inc +.endfor .for VAR in ${VAR_TO_SUBMAKE_NOEXPAND} @${ECHO} -n '${VAR}=' >> ${WRKDIR}/Makefile.inc @${MAKE} .MAKE.EXPAND_VARIABLES=0 -X -V ${VAR} >> ${WRKDIR}/Makefile.inc diff --git a/devel/gcc-arm-embedded/files/Makefile b/devel/gcc-arm-embedded/files/Makefile index c7dcb2d33f61..dfcad89bf10e 100644 --- a/devel/gcc-arm-embedded/files/Makefile +++ b/devel/gcc-arm-embedded/files/Makefile @@ -8,7 +8,13 @@ PKGVERSION= GNU Tools for ARM Embedded Processors BUILD_PREFIX= ${WRKDIR}/build DOC_PREFIX= ${INTERIM_PREFIX}/${DOCS_SUFFIX} -LDFLAGS+= -L${LOCALBASE}/lib +.if ${PORT_OPTIONS:MPURE} +WORLD_LIB=${INTERIM_WORLD} +.else +WORLD_LIB=${LOCALBASE} +.endif + +LDFLAGS+= -L${WORLD_LIB}/lib .if ${CHOSEN_COMPILER_TYPE} == clang CFLAGS+= -Wno-error @@ -17,6 +23,21 @@ CXXFLAGS+= -Wno-error MISC_DOCS= license.txt readme.txt release.txt +.if ${PORT_OPTIONS:MPURE} +PREREQUISITES= expat \ + zlib \ + libelf \ + gmp \ + mpfr \ + mpc \ + isl \ + cloog +ISL_CHECK_VERSION= +.else +PREREQUISITES= +ISL_CHECK_VERSION= --disable-isl-version-check +.endif + ALL_BUILD= build-binutils \ build-gcc-first \ build-newlib \ @@ -30,9 +51,141 @@ ALL_BUILD= build-binutils \ strip-binaries \ strip-target-libraries -.PHONY: ${ALL_BUILD} +.PHONY: ${PREREQUISITES} ${ALL_BUILD} + +all: ${PREREQUISITES} ${ALL_BUILD} + +expat: + @${ECHO_MSG} "====> Build expat (log file: ${WRKDIR}/expat.log)" + @${RM} -rf ${BUILD_PREFIX}/expat > ${WRKDIR}/expat.log 2>&1 + @${MKDIR} ${BUILD_PREFIX}/expat >> ${WRKDIR}/expat.log 2>&1 + @${ECHO_MSG} "=====> Configure" + @cd ${BUILD_PREFIX}/expat && \ + ${MAKE_ENV} ${CONFIGURE_ENV} ${SRC_DIR}/expat-${BUNDLED_VERSION_EXPAT}/configure \ + --prefix=${INTERIM_WORLD} \ + --disable-shared \ + --disable-nls >> ${WRKDIR}/expat.log 2>&1 + @${ECHO_MSG} "=====> Build" + @${MAKE_ENV} ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${BUILD_PREFIX}/expat all >> ${WRKDIR}/expat.log 2>&1 + @${ECHO_MSG} "=====> Install into intermediate directory" + @${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_PREFIX}/expat install >> ${WRKDIR}/expat.log 2>&1 -all: ${ALL_BUILD} +zlib: + @${ECHO_MSG} "====> Build zlib (log file: ${WRKDIR}/zlib.log)" + @${RM} -rf ${BUILD_PREFIX}/zlib > ${WRKDIR}/zlib.log 2>&1 + @${MKDIR} ${BUILD_PREFIX}/zlib >> ${WRKDIR}/zlib.log 2>&1 + @${ECHO_MSG} "=====> Copy to build dir" + @${TAR} -cf - -C ${SRC_DIR}/zlib-${BUNDLED_VERSION_ZLIB} . | ${TAR} -xf - -C ${BUILD_PREFIX}/zlib >> ${WRKDIR}/zlib.log 2>&1 + @${ECHO_MSG} "=====> Patch" + @cd ${BUILD_PREFIX}/zlib && \ + ${PATCH} -p1 < ${SRC_DIR}/zlib-${BUNDLED_VERSION_ZLIB}.patch >> ${WRKDIR}/zlib.log 2>&1 + @${ECHO_MSG} "=====> Configure" + @cd ${BUILD_PREFIX}/zlib && \ + ${MAKE_ENV} ${CONFIGURE_ENV} ./configure \ + --static \ + --prefix=${INTERIM_WORLD} >> ${WRKDIR}/zlib.log 2>&1 + @${ECHO_MSG} "=====> Build" + @${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_PREFIX}/zlib >> ${WRKDIR}/zlib.log 2>&1 + @${ECHO_MSG} "=====> Install into intermediate directory" + @${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_PREFIX}/zlib install >> ${WRKDIR}/zlib.log 2>&1 + +libelf: + @${ECHO_MSG} "====> Build libelf (log file: ${WRKDIR}/libelf.log)" + @${RM} -rf ${BUILD_PREFIX}/libelf > ${WRKDIR}/libelf.log 2>&1 + @${MKDIR} ${BUILD_PREFIX}/libelf >> ${WRKDIR}/libelf.log 2>&1 + @${ECHO_MSG} "=====> Configure" + @cd ${BUILD_PREFIX}/libelf && \ + ${MAKE_ENV} ${CONFIGURE_ENV} ${SRC_DIR}/libelf-${BUNDLED_VERSION_LIBELF}/configure \ + --prefix=${INTERIM_WORLD} \ + --disable-shared \ + --disable-nls >> ${WRKDIR}/libelf.log 2>&1 + @${ECHO_MSG} "=====> Build" + @${MAKE_ENV} ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${BUILD_PREFIX}/libelf all >> ${WRKDIR}/libelf.log 2>&1 + @${ECHO_MSG} "=====> Install into intermediate directory" + @${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_PREFIX}/libelf install >> ${WRKDIR}/libelf.log 2>&1 + +gmp: + @${ECHO_MSG} "====> Build gmp (log file: ${WRKDIR}/gmp.log)" + @${RM} -rf ${BUILD_PREFIX}/gmp > ${WRKDIR}/gmp.log 2>&1 + @${MKDIR} ${BUILD_PREFIX}/gmp >> ${WRKDIR}/gmp.log 2>&1 + @${ECHO_MSG} "=====> Configure" + @cd ${BUILD_PREFIX}/gmp && \ + ${MAKE_ENV} ${CONFIGURE_ENV} ${SRC_DIR}/gmp-${BUNDLED_VERSION_GMP}/configure \ + --prefix=${INTERIM_WORLD} \ + --enable-cxx \ + --disable-shared \ + --disable-nls >> ${WRKDIR}/gmp.log 2>&1 + @${ECHO_MSG} "=====> Build" + @${MAKE_ENV} ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${BUILD_PREFIX}/gmp all >> ${WRKDIR}/gmp.log 2>&1 + @${ECHO_MSG} "=====> Install into intermediate directory" + @${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_PREFIX}/gmp install >> ${WRKDIR}/gmp.log 2>&1 + +mpfr: + @${ECHO_MSG} "====> Build mpfr (log file: ${WRKDIR}/mpfr.log)" + @${RM} -rf ${BUILD_PREFIX}/mpfr > ${WRKDIR}/mpfr.log 2>&1 + @${MKDIR} ${BUILD_PREFIX}/mpfr >> ${WRKDIR}/mpfr.log 2>&1 + @${ECHO_MSG} "=====> Configure" + @cd ${BUILD_PREFIX}/mpfr && \ + ${MAKE_ENV} ${CONFIGURE_ENV} ${SRC_DIR}/mpfr-${BUNDLED_VERSION_MPFR}/configure \ + --prefix=${INTERIM_WORLD} \ + --with-gmp=${INTERIM_WORLD} \ + --disable-shared \ + --disable-nls >> ${WRKDIR}/mpfr.log 2>&1 + @${ECHO_MSG} "=====> Build" + @${MAKE_ENV} ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${BUILD_PREFIX}/mpfr all >> ${WRKDIR}/mpfr.log 2>&1 + @${ECHO_MSG} "=====> Install into intermediate directory" + @${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_PREFIX}/mpfr install >> ${WRKDIR}/mpfr.log 2>&1 + +mpc: + @${ECHO_MSG} "====> Build mpc (log file: ${WRKDIR}/mpc.log)" + @${RM} -rf ${BUILD_PREFIX}/mpc > ${WRKDIR}/mpc.log 2>&1 + @${MKDIR} ${BUILD_PREFIX}/mpc >> ${WRKDIR}/mpc.log 2>&1 + @${ECHO_MSG} "=====> Configure" + @cd ${BUILD_PREFIX}/mpc && \ + ${MAKE_ENV} ${CONFIGURE_ENV} ${SRC_DIR}/mpc-${BUNDLED_VERSION_MPC}/configure \ + --prefix=${INTERIM_WORLD} \ + --with-gmp=${INTERIM_WORLD} \ + --with-mpfr=${INTERIM_WORLD} \ + --disable-shared \ + --disable-nls >> ${WRKDIR}/mpc.log 2>&1 + @${ECHO_MSG} "=====> Build" + @${MAKE_ENV} ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${BUILD_PREFIX}/mpc all >> ${WRKDIR}/mpc.log 2>&1 + @${ECHO_MSG} "=====> Install into intermediate directory" + @${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_PREFIX}/mpc install >> ${WRKDIR}/mpc.log 2>&1 + +isl: + @${ECHO_MSG} "====> Build isl (log file: ${WRKDIR}/isl.log)" + @${RM} -rf ${BUILD_PREFIX}/isl > ${WRKDIR}/isl.log 2>&1 + @${MKDIR} ${BUILD_PREFIX}/isl >> ${WRKDIR}/isl.log 2>&1 + @${ECHO_MSG} "=====> Configure" + @cd ${BUILD_PREFIX}/isl && \ + ${MAKE_ENV} ${CONFIGURE_ENV} ${SRC_DIR}/isl-${BUNDLED_VERSION_ISL}/configure \ + --prefix=${INTERIM_WORLD} \ + --with-gmp-prefix=${INTERIM_WORLD} \ + --disable-shared \ + --disable-nls >> ${WRKDIR}/isl.log 2>&1 + @${ECHO_MSG} "=====> Build" + @${MAKE_ENV} ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${BUILD_PREFIX}/isl all >> ${WRKDIR}/isl.log 2>&1 + @${ECHO_MSG} "=====> Install into intermediate directory" + @${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_PREFIX}/isl install >> ${WRKDIR}/isl.log 2>&1 + +cloog: + @${ECHO_MSG} "====> Build cloog (log file: ${WRKDIR}/cloog.log)" + @${RM} -rf ${BUILD_PREFIX}/cloog > ${WRKDIR}/cloog.log 2>&1 + @${MKDIR} ${BUILD_PREFIX}/cloog >> ${WRKDIR}/cloog.log 2>&1 + @${ECHO_MSG} "=====> Configure" + @cd ${BUILD_PREFIX}/cloog && \ + ${MAKE_ENV} ${CONFIGURE_ENV} ${SRC_DIR}/cloog-${BUNDLED_VERSION_CLOOG}/configure \ + --prefix=${INTERIM_WORLD} \ + --with-bits=gmp \ + --with-gmp-prefix=${INTERIM_WORLD} \ + --with-isl-prefix=${INTERIM_WORLD} \ + --disable-shared \ + --disable-nls >> ${WRKDIR}/cloog.log 2>&1 + @${ECHO_MSG} "=====> Build" + @${MAKE_ENV} ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${BUILD_PREFIX}/cloog all >> ${WRKDIR}/cloog.log 2>&1 + @${ECHO_MSG} "=====> Install into intermediate directory" + @${MAKE_ENV} ${MAKE_CMD} -C ${BUILD_PREFIX}/cloog install >> ${WRKDIR}/cloog.log 2>&1 build-binutils: @${ECHO_MSG} "====> Build binutils (log file: ${WRKDIR}/binutils.log)" @@ -87,13 +240,13 @@ build-gcc-first: --htmldir=${DOC_PREFIX}/html \ --pdfdir=${DOC_PREFIX}/pdf \ --libexecdir=${INTERIM_PREFIX}/lib \ - --with-gmp=${LOCALBASE} \ - --with-mpfr=${LOCALBASE} \ - --with-mpc=${LOCALBASE} \ - --with-isl=${LOCALBASE} \ - --disable-isl-version-check \ - --with-cloog=${LOCALBASE} \ - --with-libelf=${LOCALBASE} \ + --with-gmp=${WORLD_LIB} \ + --with-mpfr=${WORLD_LIB} \ + --with-mpc=${WORLD_LIB} \ + --with-isl=${WORLD_LIB} \ + ${ISL_CHECK_VERSION} \ + --with-cloog=${WORLD_LIB} \ + --with-libelf=${WORLD_LIB} \ --enable-languages=c \ --disable-decimal-float \ --disable-libffi \ @@ -207,13 +360,13 @@ build-gcc-final: --htmldir=${DOC_PREFIX}/html \ --pdfdir=${DOC_PREFIX}/pdf \ --libexecdir=${INTERIM_PREFIX}/lib \ - --with-gmp=${LOCALBASE} \ - --with-mpfr=${LOCALBASE} \ - --with-mpc=${LOCALBASE} \ - --with-isl=${LOCALBASE} \ - --disable-isl-version-check \ - --with-cloog=${LOCALBASE} \ - --with-libelf=${LOCALBASE} \ + --with-gmp=${WORLD_LIB} \ + --with-mpfr=${WORLD_LIB} \ + --with-mpc=${WORLD_LIB} \ + --with-isl=${WORLD_LIB} \ + ${ISL_CHECK_VERSION} \ + --with-cloog=${WORLD_LIB} \ + --with-libelf=${WORLD_LIB} \ --enable-languages=c,c++ \ --enable-plugins \ --disable-decimal-float \ @@ -268,7 +421,7 @@ build-gcc-plugins: src_files=$$(${FIND} $${plugin_dir} -name \*.c -or -name \*.cc) && \ ${ECHO_MSG} "=====> Build plugin $${plugin_name} from $${src_files}" && \ ${ECHO_MSG} "Build plugin $${plugin_name} from $${src_files}" >> ${WRKDIR}/gcc-plugins.log && \ - ${CXX} ${CXXFLAGS} ${CPPFLAGS} -fPIC -fno-rtti -O2 -shared -I$${plugin_target_dir}/include -I${LOCALBASE}/include $${src_files} \ + ${CXX} ${CXXFLAGS} ${CPPFLAGS} -fPIC -fno-rtti -O2 -shared -I$${plugin_target_dir}/include -I${WORLD_LIB}/include $${src_files} \ -o $${plugin_target_dir}/$${plugin_name}.so >> ${WRKDIR}/gcc-plugins.log 2>&1 ; \ done @@ -287,13 +440,13 @@ build-libstdcxx: --mandir=${DOC_PREFIX}/man \ --htmldir=${DOC_PREFIX}/html \ --pdfdir=${DOC_PREFIX}/pdf \ - --with-gmp=${LOCALBASE} \ - --with-mpfr=${LOCALBASE} \ - --with-mpc=${LOCALBASE} \ - --with-isl=${LOCALBASE} \ - --disable-isl-version-check \ - --with-cloog=${LOCALBASE} \ - --with-libelf=${LOCALBASE} \ + --with-gmp=${WORLD_LIB} \ + --with-mpfr=${WORLD_LIB} \ + --with-mpc=${WORLD_LIB} \ + --with-isl=${WORLD_LIB} \ + ${ISL_CHECK_VERSION} \ + --with-cloog=${WORLD_LIB} \ + --with-libelf=${WORLD_LIB} \ --enable-languages=c,c++ \ --disable-decimal-float \ --disable-libffi \ @@ -345,7 +498,7 @@ build-gdb: --disable-nls \ --disable-sim \ --with-libexpat \ - --with-libexpat-prefix=${LOCALBASE} \ + --with-libexpat-prefix=${WORLD_LIB} \ --with-python=no \ --with-system-gdbinit=${INTERIM_PREFIX}/xxxx/${TARGET}/lib/gdbinit \ --with-lzma=no \ diff --git a/devel/gcc-arm-embedded/files/extra-patch-gcc-isl-0.13-compatibility b/devel/gcc-arm-embedded/files/extra-patch-gcc-isl-0.13-compatibility new file mode 100644 index 000000000000..144f7f107ba2 --- /dev/null +++ b/devel/gcc-arm-embedded/files/extra-patch-gcc-isl-0.13-compatibility @@ -0,0 +1,457 @@ +diff -ruN src/gcc.orig/gcc/graphite-clast-to-gimple.c src/gcc/gcc/graphite-clast-to-gimple.c +--- src/gcc.orig/gcc/graphite-clast-to-gimple.c 2014-07-08 14:47:19.000000000 +0400 ++++ src/gcc/gcc/graphite-clast-to-gimple.c 2014-07-08 14:49:57.000000000 +0400 +@@ -28,6 +28,8 @@ + #include <isl/constraint.h> + #include <isl/ilp.h> + #include <isl/aff.h> ++#include <isl/val.h> ++#include <isl/val_gmp.h> + #include <cloog/cloog.h> + #include <cloog/isl/domain.h> + #endif +@@ -851,18 +853,18 @@ + static void + compute_bounds_for_param (scop_p scop, int param, mpz_t low, mpz_t up) + { +- isl_int v; ++ isl_val *v; + isl_aff *aff = isl_aff_zero_on_domain + (isl_local_space_from_space (isl_set_get_space (scop->context))); + + aff = isl_aff_add_coefficient_si (aff, isl_dim_param, param, 1); + +- isl_int_init (v); +- isl_set_min (scop->context, aff, &v); +- isl_int_get_gmp (v, low); +- isl_set_max (scop->context, aff, &v); +- isl_int_get_gmp (v, up); +- isl_int_clear (v); ++ v = isl_set_min_val (scop->context, aff); ++ isl_val_get_num_gmp (v, low); ++ isl_val_free (v); ++ v = isl_set_max_val (scop->context, aff); ++ isl_val_get_num_gmp (v, up); ++ isl_val_free (v); + isl_aff_free (aff); + } + +@@ -881,8 +883,7 @@ + isl_set *domain; + isl_aff *dimension; + isl_local_space *local_space; +- isl_int isl_value; +- enum isl_lp_result lp_result; ++ isl_val *isl_value; + + domain = isl_set_copy (isl_set_from_cloog_domain (loop->domain)); + local_space = isl_local_space_from_space (isl_set_get_space (domain)); +@@ -891,17 +892,12 @@ + isl_set_dim (domain, isl_dim_set) - 1, + 1); + +- isl_int_init (isl_value); +- +- lp_result = isl_set_min (domain, dimension, &isl_value); +- assert (lp_result == isl_lp_ok); +- isl_int_get_gmp (isl_value, low); +- +- lp_result = isl_set_max (domain, dimension, &isl_value); +- assert (lp_result == isl_lp_ok); +- isl_int_get_gmp (isl_value, up); +- +- isl_int_clear (isl_value); ++ isl_value = isl_set_min_val (domain, dimension); ++ isl_val_get_num_gmp (isl_value, low); ++ isl_val_free (isl_value); ++ isl_value = isl_set_max_val (domain, dimension); ++ isl_val_get_num_gmp (isl_value, up); ++ isl_val_free (isl_value); + isl_set_free (domain); + isl_aff_free (dimension); + } +diff -ruN src/gcc.orig/gcc/graphite-interchange.c src/gcc/gcc/graphite-interchange.c +--- src/gcc.orig/gcc/graphite-interchange.c 2014-07-08 14:47:20.000000000 +0400 ++++ src/gcc/gcc/graphite-interchange.c 2014-07-08 14:49:57.000000000 +0400 +@@ -29,6 +29,8 @@ + #include <isl/map.h> + #include <isl/union_map.h> + #include <isl/ilp.h> ++#include <isl/val.h> ++#include <isl/val_gmp.h> + #include <cloog/cloog.h> + #include <cloog/isl/domain.h> + #endif +@@ -71,13 +73,13 @@ + isl_local_space *ls = isl_local_space_from_space (isl_map_get_space (map)); + unsigned offset, nsubs; + int i; +- isl_int size, subsize; ++ isl_ctx *ct; ++ ++ isl_val *size, *subsize, *size1; + + res = isl_equality_alloc (ls); +- isl_int_init (size); +- isl_int_set_ui (size, 1); +- isl_int_init (subsize); +- isl_int_set_ui (subsize, 1); ++ ct = isl_local_space_get_ctx (ls); ++ size = isl_val_int_from_ui (ct, 1); + + nsubs = isl_set_dim (pdr->extent, isl_dim_set); + /* -1 for the already included L dimension. */ +@@ -90,18 +92,17 @@ + isl_space *dc; + isl_aff *aff; + +- res = isl_constraint_set_coefficient (res, isl_dim_out, offset + i, size); +- ++ size1 = isl_val_copy (size); ++ res = isl_constraint_set_coefficient_val (res, isl_dim_out, offset + i, size); + dc = isl_set_get_space (pdr->extent); + aff = isl_aff_zero_on_domain (isl_local_space_from_space (dc)); + aff = isl_aff_set_coefficient_si (aff, isl_dim_in, i, 1); +- isl_set_max (pdr->extent, aff, &subsize); ++ subsize = isl_set_max_val (pdr->extent, aff); + isl_aff_free (aff); +- isl_int_mul (size, size, subsize); ++ size = isl_val_mul (size1, subsize); + } + +- isl_int_clear (subsize); +- isl_int_clear (size); ++ isl_val_free (size); + + return res; + } +@@ -118,7 +119,7 @@ + isl_aff *aff; + isl_space *dc; + isl_constraint *lma, *c; +- isl_int islstride; ++ isl_val *islstride; + graphite_dim_t time_depth; + unsigned offset, nt; + unsigned i; +@@ -231,10 +232,9 @@ + aff = isl_aff_zero_on_domain (isl_local_space_from_space (dc)); + aff = isl_aff_set_coefficient_si (aff, isl_dim_in, offset - 1, -1); + aff = isl_aff_set_coefficient_si (aff, isl_dim_in, offset + offset - 1, 1); +- isl_int_init (islstride); +- isl_set_max (set, aff, &islstride); +- isl_int_get_gmp (islstride, stride); +- isl_int_clear (islstride); ++ islstride = isl_set_max_val (set, aff); ++ isl_val_get_num_gmp (islstride, stride); ++ isl_val_free (islstride); + isl_aff_free (aff); + isl_set_free (set); + +diff -ruN src/gcc.orig/gcc/graphite-optimize-isl.c src/gcc/gcc/graphite-optimize-isl.c +--- src/gcc.orig/gcc/graphite-optimize-isl.c 2014-07-08 14:47:20.000000000 +0400 ++++ src/gcc/gcc/graphite-optimize-isl.c 2014-07-08 14:49:57.000000000 +0400 +@@ -252,6 +252,7 @@ + DimToVectorize can be devided by VectorWidth. The default VectorWidth is + currently constant and not yet target specific. This function does not reason + about parallelism. */ ++ + static isl_map * + getPrevectorMap(isl_ctx *ctx, int DimToVectorize, + int ScheduleDimensions, +@@ -265,8 +266,9 @@ + isl_aff *Aff; + int PointDimension; /* ip */ + int TileDimension; /* it */ +- isl_int VectorWidthMP; ++ isl_val *VectorWidthMP; + int i; ++ isl_ctx *ct; + + /* assert (0 <= DimToVectorize && DimToVectorize < ScheduleDimensions);*/ + +@@ -296,10 +298,10 @@ + Aff = isl_aff_zero_on_domain(LocalSpaceRange); + Aff = isl_aff_set_constant_si(Aff, VectorWidth); + Aff = isl_aff_set_coefficient_si(Aff, isl_dim_in, TileDimension, 1); +- isl_int_init(VectorWidthMP); +- isl_int_set_si(VectorWidthMP, VectorWidth); +- Aff = isl_aff_mod(Aff, VectorWidthMP); +- isl_int_clear(VectorWidthMP); ++ ++ ct = isl_aff_get_ctx(Aff); ++ VectorWidthMP = isl_val_int_from_si(ct, VectorWidth); ++ Aff = isl_aff_mod_val(Aff, VectorWidthMP); + Modulo = isl_pw_aff_zero_set(isl_pw_aff_from_aff(Aff)); + TilingMap = isl_map_intersect_range(TilingMap, Modulo); + +@@ -365,7 +367,7 @@ + { + for (i = ScheduleDimensions - 1 ; i >= 0 ; i--) + { +- if (isl_band_member_is_zero_distance(Band, i)) ++ if (isl_band_member_is_coincident(Band, i)) + { + isl_map *TileMap; + isl_union_map *TileUMap; +@@ -436,6 +438,7 @@ + { + + isl_schedule *schedule; ++ isl_schedule_constraints *schedule_constraints; + isl_union_set *domain; + isl_union_map *validity, *proximity, *dependences; + isl_union_map *schedule_map; +@@ -454,7 +457,14 @@ + isl_options_set_schedule_maximize_band_depth(scop->ctx, 1); + isl_options_set_schedule_fuse(scop->ctx, ISL_SCHEDULE_FUSE_MIN); + isl_options_set_on_error(scop->ctx, ISL_ON_ERROR_CONTINUE); +- schedule = isl_union_set_compute_schedule (domain, validity, proximity); ++ schedule_constraints = isl_schedule_constraints_on_domain(domain); ++ schedule_constraints = ++ isl_schedule_constraints_set_proximity(schedule_constraints, proximity); ++ schedule_constraints = isl_schedule_constraints_set_validity( ++ schedule_constraints, isl_union_map_copy(validity)); ++ schedule_constraints = ++ isl_schedule_constraints_set_coincidence(schedule_constraints, validity); ++ schedule = isl_schedule_constraints_compute_schedule(schedule_constraints); + isl_options_set_on_error(scop->ctx, ISL_ON_ERROR_ABORT); + + if (!schedule) +diff -ruN src/gcc.orig/gcc/graphite-poly.c src/gcc/gcc/graphite-poly.c +--- src/gcc.orig/gcc/graphite-poly.c 2014-07-08 14:47:21.000000000 +0400 ++++ src/gcc/gcc/graphite-poly.c 2014-07-08 14:49:57.000000000 +0400 +@@ -28,6 +28,8 @@ + #include <isl/constraint.h> + #include <isl/ilp.h> + #include <isl/aff.h> ++#include <isl/val.h> ++#include <isl/val_gmp.h> + #include <cloog/cloog.h> + #include <cloog/isl/domain.h> + #endif +@@ -1021,10 +1023,7 @@ + isl_set *transdomain; + isl_space *dc; + isl_aff *aff; +- isl_int isllb, islub; +- +- isl_int_init (isllb); +- isl_int_init (islub); ++ isl_val *isllb, *islub; + + /* Map the iteration domain through the current scatter, and work + on the resulting set. */ +@@ -1038,15 +1037,14 @@ + + /* And find the min/max for that function. */ + /* XXX isl check results? */ +- isl_set_min (transdomain, aff, &isllb); +- isl_set_max (transdomain, aff, &islub); ++ isllb = isl_set_min_val (transdomain, aff); ++ islub = isl_set_max_val (transdomain, aff); + +- isl_int_sub (islub, islub, isllb); +- isl_int_add_ui (islub, islub, 1); +- isl_int_get_gmp (islub, res); ++ islub = isl_val_sub (islub, isllb); ++ islub = isl_val_add_ui (islub, 1); ++ isl_val_get_num_gmp (islub, res); + +- isl_int_clear (isllb); +- isl_int_clear (islub); ++ isl_val_free (islub); + isl_aff_free (aff); + isl_set_free (transdomain); + } +diff -ruN src/gcc.orig/gcc/graphite-sese-to-poly.c src/gcc/gcc/graphite-sese-to-poly.c +--- src/gcc.orig/gcc/graphite-sese-to-poly.c 2014-07-08 14:47:19.000000000 +0400 ++++ src/gcc/gcc/graphite-sese-to-poly.c 2014-07-08 14:49:57.000000000 +0400 +@@ -26,7 +26,8 @@ + #include <isl/union_map.h> + #include <isl/constraint.h> + #include <isl/aff.h> +-#include <cloog/cloog.h> ++#include <isl/val.h> ++#include <isl/val_gmp.h> + #include <cloog/cloog.h> + #include <cloog/isl/domain.h> + #endif +@@ -46,7 +47,6 @@ + #include "graphite-poly.h" + #include "graphite-sese-to-poly.h" + +- + /* Assigns to RES the value of the INTEGER_CST T. */ + + static inline void +@@ -461,13 +461,11 @@ + int i; + int nb_iterators = pbb_dim_iter_domain (pbb); + int used_scattering_dimensions = nb_iterators * 2 + 1; +- isl_int val; ++ isl_val *val; + isl_space *dc, *dm; + + gcc_assert (scattering_dimensions >= used_scattering_dimensions); + +- isl_int_init (val); +- + dc = isl_set_get_space (pbb->domain); + dm = isl_space_add_dims (isl_space_from_domain (dc), + isl_dim_out, scattering_dimensions); +@@ -481,12 +479,10 @@ + isl_constraint *c = isl_equality_alloc + (isl_local_space_from_space (isl_map_get_space (pbb->schedule))); + +- if (0 != isl_aff_get_coefficient (static_sched, isl_dim_in, +- i / 2, &val)) +- gcc_unreachable (); ++ val = isl_aff_get_coefficient_val (static_sched, isl_dim_in, i / 2); + +- isl_int_neg (val, val); +- c = isl_constraint_set_constant (c, val); ++ val = isl_val_neg (val); ++ c = isl_constraint_set_constant_val (c, val); + c = isl_constraint_set_coefficient_si (c, isl_dim_out, i, 1); + pbb->schedule = isl_map_add_constraint (pbb->schedule, c); + } +@@ -500,8 +496,6 @@ + } + } + +- isl_int_clear (val); +- + pbb->transformed = isl_map_copy (pbb->schedule); + } + +@@ -681,12 +675,12 @@ + isl_local_space *ls = isl_local_space_from_space (isl_space_copy (space)); + isl_aff *aff = isl_aff_zero_on_domain (ls); + isl_set *dom = isl_set_universe (space); +- isl_int v; ++ isl_val *v; ++ isl_ctx *ct; + +- isl_int_init (v); +- isl_int_set_gmp (v, g); +- aff = isl_aff_add_constant (aff, v); +- isl_int_clear (v); ++ ct = isl_aff_get_ctx (aff); ++ v = isl_val_int_from_gmp (ct, g); ++ aff = isl_aff_add_constant_val (aff, v); + + return isl_pw_aff_alloc (dom, aff); + } +@@ -709,18 +703,16 @@ + + /* Compute pwaff mod 2^width. */ + ++extern isl_ctx *the_isl_ctx; ++ + static isl_pw_aff * + wrap (isl_pw_aff *pwaff, unsigned width) + { +- isl_int mod; +- +- isl_int_init (mod); +- isl_int_set_si (mod, 1); +- isl_int_mul_2exp (mod, mod, width); +- +- pwaff = isl_pw_aff_mod (pwaff, mod); ++ isl_val *mod; + +- isl_int_clear (mod); ++ mod = isl_val_int_from_ui(the_isl_ctx, width); ++ mod = isl_val_2exp (mod); ++ pwaff = isl_pw_aff_mod_val (pwaff, mod); + + return pwaff; + } +@@ -976,11 +968,10 @@ + isl_space *space; + isl_constraint *c; + int pos = isl_set_dim (outer, isl_dim_set); +- isl_int v; ++ isl_val *v; + mpz_t g; + + mpz_init (g); +- isl_int_init (v); + + inner = isl_set_add_dims (inner, isl_dim_set, 1); + space = isl_set_get_space (inner); +@@ -998,8 +989,8 @@ + (isl_local_space_from_space(isl_space_copy (space))); + c = isl_constraint_set_coefficient_si (c, isl_dim_set, pos, -1); + tree_int_to_gmp (nb_iters, g); +- isl_int_set_gmp (v, g); +- c = isl_constraint_set_constant (c, v); ++ v = isl_val_int_from_gmp (the_isl_ctx, g); ++ c = isl_constraint_set_constant_val (c, v); + inner = isl_set_add_constraint (inner, c); + } + +@@ -1053,9 +1044,9 @@ + c = isl_inequality_alloc + (isl_local_space_from_space (isl_space_copy (space))); + c = isl_constraint_set_coefficient_si (c, isl_dim_set, pos, -1); +- isl_int_set_gmp (v, g); ++ v = isl_val_int_from_gmp (the_isl_ctx, g); + mpz_clear (g); +- c = isl_constraint_set_constant (c, v); ++ c = isl_constraint_set_constant_val (c, v); + inner = isl_set_add_constraint (inner, c); + } + else +@@ -1078,7 +1069,6 @@ + + isl_set_free (outer); + isl_space_free (space); +- isl_int_clear (v); + mpz_clear (g); + } + +@@ -1342,17 +1332,15 @@ + isl_space *space = isl_set_get_space (scop->context); + isl_constraint *c; + mpz_t g; +- isl_int v; ++ isl_val *v; + + c = isl_inequality_alloc (isl_local_space_from_space (space)); + mpz_init (g); +- isl_int_init (v); + tree_int_to_gmp (lb, g); +- isl_int_set_gmp (v, g); +- isl_int_neg (v, v); ++ v = isl_val_int_from_gmp (the_isl_ctx, g); ++ v = isl_val_neg (v); + mpz_clear (g); +- c = isl_constraint_set_constant (c, v); +- isl_int_clear (v); ++ c = isl_constraint_set_constant_val (c, v); + c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, 1); + + scop->context = isl_set_add_constraint (scop->context, c); +@@ -1363,17 +1351,15 @@ + isl_space *space = isl_set_get_space (scop->context); + isl_constraint *c; + mpz_t g; +- isl_int v; ++ isl_val *v; + + c = isl_inequality_alloc (isl_local_space_from_space (space)); + + mpz_init (g); +- isl_int_init (v); + tree_int_to_gmp (ub, g); +- isl_int_set_gmp (v, g); ++ v = isl_val_int_from_gmp (the_isl_ctx, g); + mpz_clear (g); +- c = isl_constraint_set_constant (c, v); +- isl_int_clear (v); ++ c = isl_constraint_set_constant_val (c, v); + c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, -1); + + scop->context = isl_set_add_constraint (scop->context, c); |