summaryrefslogtreecommitdiff
path: root/libcilkrts
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-26 19:16:35 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-26 19:16:35 +0000
commit7b30040873a12b0455c0330712b1bdae4953b4e6 (patch)
tree223f64ccc65d033a347369720cfd2fb11f1d0dc2 /libcilkrts
parent737fef9c994b6a52b05f1abe4618b83b5284ad81 (diff)
downloadlinaro-gcc-7b30040873a12b0455c0330712b1bdae4953b4e6.tar.gz
linaro-gcc-7b30040873a12b0455c0330712b1bdae4953b4e6.tar.bz2
linaro-gcc-7b30040873a12b0455c0330712b1bdae4953b4e6.zip
gcc/
2014-03-26 Tobias Burnus <burnus@net-b.de> * gcc.c (LINK_COMMAND_SPEC): Use libcilkrts.spec for -fcilkplus. (CILK_SELF_SPECS): New define. (driver_self_specs): Use it. libcilkrts/ 2014-03-26 Tobias Burnus <burnus@net-b.de> * libcilkrts.spec.in: New. * Makefile.am: Handle libcilkrts.spec. * configure.ac: Determine link options for libcilkrts.spec. * Makefile.in: Regenerate. * configure: Regenerate. * aclocal.m4: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208847 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcilkrts')
-rw-r--r--libcilkrts/ChangeLog9
-rw-r--r--libcilkrts/Makefile.am3
-rw-r--r--libcilkrts/Makefile.in76
-rw-r--r--libcilkrts/aclocal.m42
-rw-r--r--libcilkrts/configure58
-rw-r--r--libcilkrts/configure.ac28
6 files changed, 143 insertions, 33 deletions
diff --git a/libcilkrts/ChangeLog b/libcilkrts/ChangeLog
index eb0d6ecea07..80b35c1405d 100644
--- a/libcilkrts/ChangeLog
+++ b/libcilkrts/ChangeLog
@@ -1,3 +1,12 @@
+2014-03-26 Tobias Burnus <burnus@net-b.de>
+
+ * libcilkrts.spec.in: New.
+ * Makefile.am: Handle libcilkrts.spec.
+ * configure.ac: Determine link options for libcilkrts.spec.
+ * Makefile.in: Regenerate.
+ * configure: Regenerate.
+ * aclocal.m4: Regenerate.
+
2014-03-20 Tobias Burnus <burnus@net-b.de>
PR other/60589
diff --git a/libcilkrts/Makefile.am b/libcilkrts/Makefile.am
index f2d13aabd88..84551c84227 100644
--- a/libcilkrts/Makefile.am
+++ b/libcilkrts/Makefile.am
@@ -51,6 +51,7 @@ AM_LDFLAGS = -lpthread
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
# Target list.
+nodist_toolexeclib_HEADERS = libcilkrts.spec
toolexeclib_LTLIBRARIES = libcilkrts.la
libcilkrts_la_SOURCES = \
@@ -110,7 +111,7 @@ libcilkrts_la_LDFLAGS += -no-undefined
# C/C++ header files for Cilk.
# cilkincludedir = $(includedir)/cilk
cilkincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include/cilk
-cilkinclude_HEADERS = \
+nodist_cilkinclude_HEADERS = \
include/cilk/cilk_api.h \
include/cilk/cilk_api_linux.h \
include/cilk/cilk.h \
diff --git a/libcilkrts/Makefile.in b/libcilkrts/Makefile.in
index 092e2f706ec..1ee4d8270e5 100644
--- a/libcilkrts/Makefile.in
+++ b/libcilkrts/Makefile.in
@@ -112,8 +112,8 @@ target_triplet = @target@
DIST_COMMON = $(srcdir)/include/internal/rev.mk README ChangeLog \
$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/../mkinstalldirs $(srcdir)/../depcomp \
- $(cilkinclude_HEADERS)
+ $(srcdir)/../mkinstalldirs $(srcdir)/libcilkrts.spec.in \
+ $(srcdir)/../depcomp
# If we're building on Linux, use the Linux version script
@LINUX_LINKER_SCRIPT_TRUE@am__append_1 = -Wl,--version-script,$(srcdir)/runtime/linux-symbols.ver
@@ -122,10 +122,8 @@ DIST_COMMON = $(srcdir)/include/internal/rev.mk README ChangeLog \
@MAC_LINKER_SCRIPT_TRUE@am__append_2 = -Wl,-exported_symbols_list,$(srcdir)/runtime/mac-symbols.txt
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
- $(top_srcdir)/../config/depstand.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
- $(top_srcdir)/../config/libstdc++-raw-cxx.m4 \
$(top_srcdir)/../config/multi.m4 \
$(top_srcdir)/../config/override.m4 \
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
@@ -136,7 +134,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = libcilkrts.spec
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
@@ -160,7 +158,7 @@ am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \
- "$(DESTDIR)$(cilkincludedir)"
+ "$(DESTDIR)$(cilkincludedir)" "$(DESTDIR)$(toolexeclibdir)"
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
libcilkrts_la_LIBADD =
am_libcilkrts_la_OBJECTS = cilk-abi-vla.lo os-unix-sysdep.lo bug.lo \
@@ -204,7 +202,7 @@ MULTIDIRS =
MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
-HEADERS = $(cilkinclude_HEADERS)
+HEADERS = $(nodist_cilkinclude_HEADERS) $(nodist_toolexeclib_HEADERS)
ETAGS = etags
CTAGS = ctags
ACLOCAL = @ACLOCAL@
@@ -245,8 +243,6 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
-LIBSTDCXX_RAW_CXX_CXXFLAGS = @LIBSTDCXX_RAW_CXX_CXXFLAGS@
-LIBSTDCXX_RAW_CXX_LDFLAGS = @LIBSTDCXX_RAW_CXX_LDFLAGS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
@@ -310,6 +306,7 @@ infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+link_cilkrts = @link_cilkrts@
localedir = @localedir@
localstatedir = @localstatedir@
lt_cv_dlopen_libs = @lt_cv_dlopen_libs@
@@ -328,7 +325,6 @@ sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
-target_noncanonical = @target_noncanonical@
target_os = @target_os@
target_vendor = @target_vendor@
toolexecdir = @toolexecdir@
@@ -356,6 +352,7 @@ AM_LDFLAGS = -lpthread
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
# Target list.
+nodist_toolexeclib_HEADERS = libcilkrts.spec
toolexeclib_LTLIBRARIES = libcilkrts.la
libcilkrts_la_SOURCES = \
runtime/config/$(config_dir)/cilk-abi-vla.c \
@@ -403,7 +400,7 @@ libcilkrts_la_LDFLAGS = -version-info 5:0:0 -lpthread \
# C/C++ header files for Cilk.
# cilkincludedir = $(includedir)/cilk
cilkincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include/cilk
-cilkinclude_HEADERS = \
+nodist_cilkinclude_HEADERS = \
include/cilk/cilk_api.h \
include/cilk/cilk_api_linux.h \
include/cilk/cilk.h \
@@ -505,6 +502,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
+libcilkrts.spec: $(top_builddir)/config.status $(srcdir)/libcilkrts.spec.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)"
@@ -853,10 +852,10 @@ distclean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
maintainer-clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
-install-cilkincludeHEADERS: $(cilkinclude_HEADERS)
+install-nodist_cilkincludeHEADERS: $(nodist_cilkinclude_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(cilkincludedir)" || $(MKDIR_P) "$(DESTDIR)$(cilkincludedir)"
- @list='$(cilkinclude_HEADERS)'; test -n "$(cilkincludedir)" || list=; \
+ @list='$(nodist_cilkinclude_HEADERS)'; test -n "$(cilkincludedir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -866,13 +865,33 @@ install-cilkincludeHEADERS: $(cilkinclude_HEADERS)
$(INSTALL_HEADER) $$files "$(DESTDIR)$(cilkincludedir)" || exit $$?; \
done
-uninstall-cilkincludeHEADERS:
+uninstall-nodist_cilkincludeHEADERS:
@$(NORMAL_UNINSTALL)
- @list='$(cilkinclude_HEADERS)'; test -n "$(cilkincludedir)" || list=; \
+ @list='$(nodist_cilkinclude_HEADERS)'; test -n "$(cilkincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(cilkincludedir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(cilkincludedir)" && rm -f $$files
+install-nodist_toolexeclibHEADERS: $(nodist_toolexeclib_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)"
+ @list='$(nodist_toolexeclib_HEADERS)'; test -n "$(toolexeclibdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(toolexeclibdir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(toolexeclibdir)" || exit $$?; \
+ done
+
+uninstall-nodist_toolexeclibHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nodist_toolexeclib_HEADERS)'; test -n "$(toolexeclibdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(toolexeclibdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(toolexeclibdir)" && rm -f $$files
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -929,7 +948,7 @@ check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) all-multi $(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(cilkincludedir)"; do \
+ for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(cilkincludedir)" "$(DESTDIR)$(toolexeclibdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -981,13 +1000,14 @@ info: info-am
info-am:
-install-data-am: install-cilkincludeHEADERS
+install-data-am: install-nodist_cilkincludeHEADERS
install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am: install-multi install-toolexeclibLTLIBRARIES
+install-exec-am: install-multi install-nodist_toolexeclibHEADERS \
+ install-toolexeclibLTLIBRARIES
install-html: install-html-am
@@ -1029,7 +1049,8 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-cilkincludeHEADERS \
+uninstall-am: uninstall-nodist_cilkincludeHEADERS \
+ uninstall-nodist_toolexeclibHEADERS \
uninstall-toolexeclibLTLIBRARIES
.MAKE: all-multi clean-multi distclean-multi install-am install-multi \
@@ -1040,17 +1061,20 @@ uninstall-am: uninstall-cilkincludeHEADERS \
clean-toolexeclibLTLIBRARIES ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-multi \
distclean-tags dvi dvi-am html html-am info info-am install \
- install-am install-cilkincludeHEADERS install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-multi install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
+ install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-multi install-nodist_cilkincludeHEADERS \
+ install-nodist_toolexeclibHEADERS install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip \
install-toolexeclibLTLIBRARIES installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
maintainer-clean-multi mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool mostlyclean-multi pdf \
pdf-am ps ps-am tags uninstall uninstall-am \
- uninstall-cilkincludeHEADERS uninstall-toolexeclibLTLIBRARIES
+ uninstall-nodist_cilkincludeHEADERS \
+ uninstall-nodist_toolexeclibHEADERS \
+ uninstall-toolexeclibLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/libcilkrts/aclocal.m4 b/libcilkrts/aclocal.m4
index c24d0b60415..68107caffa0 100644
--- a/libcilkrts/aclocal.m4
+++ b/libcilkrts/aclocal.m4
@@ -968,10 +968,8 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
-m4_include([../config/acx.m4])
m4_include([../config/depstand.m4])
m4_include([../config/lead-dot.m4])
-m4_include([../config/libstdc++-raw-cxx.m4])
m4_include([../config/multi.m4])
m4_include([../config/override.m4])
m4_include([../libtool.m4])
diff --git a/libcilkrts/configure b/libcilkrts/configure
index 63181d78ba5..0dadbbda035 100644
--- a/libcilkrts/configure
+++ b/libcilkrts/configure
@@ -604,6 +604,7 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
+link_cilkrts
lt_cv_dlopen_libs
toolexeclibdir
toolexecdir
@@ -4214,7 +4215,7 @@ fi
# AC_PROG_LIBTOOL
# AC_CONFIG_MACRO_DIR([..])
-ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files Makefile libcilkrts.spec"
# Default to --enable-multilib
# Check whether --enable-multilib was given.
@@ -11056,7 +11057,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11059 "configure"
+#line 11060 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11162,7 +11163,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11165 "configure"
+#line 11166 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14451,6 +14452,56 @@ fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+# Check to see if -pthread or -lpthread is needed. Prefer the former.
+# Note that the CILK_SELF_SPEC in gcc.c may force -pthread.
+# In case the pthread.h system header is not found, this test will fail.
+CFLAGS="$CFLAGS -pthread"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+ void *g(void *d) { return NULL; }
+int
+main ()
+{
+pthread_t t; pthread_create(&t,NULL,g,NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+ CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+ void *g(void *d) { return NULL; }
+int
+main ()
+{
+pthread_t t; pthread_create(&t,NULL,g,NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+ as_fn_error "Pthreads are required to build libcilkrts" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+if test $enable_shared = yes; then
+ link_cilkrts="-lcilkrts %{static: $LIBS}"
+else
+ link_cilkrts="-lcilkrts $LIBS"
+fi
+
+
# Must be last
cat >confcache <<\_ACEOF
@@ -15567,6 +15618,7 @@ do
case $ac_config_target in
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "libcilkrts.spec") CONFIG_FILES="$CONFIG_FILES libcilkrts.spec" ;;
"default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
diff --git a/libcilkrts/configure.ac b/libcilkrts/configure.ac
index 61b45b00723..fb215052dd6 100644
--- a/libcilkrts/configure.ac
+++ b/libcilkrts/configure.ac
@@ -49,7 +49,7 @@ AC_PROG_CC
AC_PROG_CXX
# AC_PROG_LIBTOOL
# AC_CONFIG_MACRO_DIR([..])
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile libcilkrts.spec])
AM_ENABLE_MULTILIB(, ..)
AC_FUNC_ALLOCA
@@ -183,6 +183,32 @@ AC_LINK_IFELSE(
AC_DEFINE(HAVE_PTHREAD_AFFINITY_NP, 1,
[ Define if pthread_{,attr_}{g,s}etaffinity_np is supported.]))
+# Check to see if -pthread or -lpthread is needed. Prefer the former.
+# Note that the CILK_SELF_SPEC in gcc.c may force -pthread.
+# In case the pthread.h system header is not found, this test will fail.
+CFLAGS="$CFLAGS -pthread"
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [#include <pthread.h>
+ void *g(void *d) { return NULL; }],
+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
+ [],
+ [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [#include <pthread.h>
+ void *g(void *d) { return NULL; }],
+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
+ [],
+ [AC_MSG_ERROR([Pthreads are required to build libcilkrts])])])
+
+if test $enable_shared = yes; then
+ link_cilkrts="-lcilkrts %{static: $LIBS}"
+else
+ link_cilkrts="-lcilkrts $LIBS"
+fi
+AC_SUBST(link_cilkrts)
+
# Must be last
AC_OUTPUT