Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
6c94a9fa
Commit
6c94a9fa
authored
14 years ago
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for -pthread and -lpthread at configure time.
From-SVN: r167445
parent
9ad64188
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
9 deletions
+106
-9
libgo/Makefile.am
+3
-3
libgo/Makefile.in
+7
-4
libgo/configure
+74
-2
libgo/configure.ac
+20
-0
libgo/testsuite/Makefile.in
+2
-0
No files found.
libgo/Makefile.am
View file @
6c94a9fa
...
...
@@ -30,7 +30,7 @@ LIBFFIINCS = @LIBFFIINCS@
WARN_CFLAGS
=
$(WARN_FLAGS)
$(WERROR)
# -I/-D flags to pass when compiling.
AM_CPPFLAGS
=
-I
$(srcdir)
/runtime
$(LIBFFIINCS)
-pthread
AM_CPPFLAGS
=
-I
$(srcdir)
/runtime
$(LIBFFIINCS)
$(PTHREAD_CFLAGS)
ACLOCAL_AMFLAGS
=
-I
./config
-I
../config
...
...
@@ -1263,7 +1263,7 @@ libgo_go_objs = \
libgo_la_SOURCES
=
$(runtime_files)
libgo_la_LIBADD
=
$(libgo_go_objs)
$(LIBFFI)
-lpthread
libgo_la_LIBADD
=
$(libgo_go_objs)
$(LIBFFI)
$(PTHREAD_LIBS)
libgobegin_a_SOURCES
=
\
runtime/go-main.c
...
...
@@ -1279,7 +1279,7 @@ LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \
GOLINK
=
$(LIBTOOL)
--tag
GO
--mode-link
$(GOC)
\
$(OPT_LDFLAGS)
$(SECTION_LDFLAGS)
$(AM_GOCFLAGS)
$(LTLDFLAGS)
\
-lpthread
-o
$@
$(PTHREAD_LIBS)
-o
$@
# Build a package.
BUILDARCHIVE
=
\
...
...
This diff is collapsed.
Click to expand it.
libgo/Makefile.in
View file @
6c94a9fa
...
...
@@ -120,7 +120,8 @@ am_libgobegin_a_OBJECTS = go-main.$(OBJEXT)
libgobegin_a_OBJECTS
=
$(am_libgobegin_a_OBJECTS)
LTLIBRARIES
=
$(toolexeclib_LTLIBRARIES)
am__DEPENDENCIES_1
=
libgo_la_DEPENDENCIES
=
$(libgo_go_objs)
$(am__DEPENDENCIES_1)
libgo_la_DEPENDENCIES
=
$(libgo_go_objs)
$(am__DEPENDENCIES_1)
\
$(am__DEPENDENCIES_1)
am__libgo_la_SOURCES_DIST
=
runtime/go-append.c runtime/go-assert.c
\
runtime/go-assert-interface.c
\
runtime/go-byte-array-to-string.c runtime/go-breakpoint.c
\
...
...
@@ -340,6 +341,8 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL
=
@PACKAGE_URL@
PACKAGE_VERSION
=
@PACKAGE_VERSION@
PATH_SEPARATOR
=
@PATH_SEPARATOR@
PTHREAD_CFLAGS
=
@PTHREAD_CFLAGS@
PTHREAD_LIBS
=
@PTHREAD_LIBS@
RANLIB
=
@RANLIB@
SED
=
@SED@
SET_MAKE
=
@SET_MAKE@
...
...
@@ -426,7 +429,7 @@ toolexeclibdir = $(glibgo_toolexeclibdir)
WARN_CFLAGS
=
$(WARN_FLAGS)
$(WERROR)
# -I/-D flags to pass when compiling.
AM_CPPFLAGS
=
-I
$(srcdir)
/runtime
$(LIBFFIINCS)
-pthread
AM_CPPFLAGS
=
-I
$(srcdir)
/runtime
$(LIBFFIINCS)
$(PTHREAD_CFLAGS)
ACLOCAL_AMFLAGS
=
-I
./config
-I
../config
AM_CFLAGS
=
-fexceptions
-fplan9-extensions
$(SPLIT_STACK)
$(WARN_CFLAGS)
\
$(STRINGOPS_FLAG)
\
...
...
@@ -1559,7 +1562,7 @@ libgo_go_objs = \
testing/libscript.la
libgo_la_SOURCES
=
$(runtime_files)
libgo_la_LIBADD
=
$(libgo_go_objs)
$(LIBFFI)
-lpthread
libgo_la_LIBADD
=
$(libgo_go_objs)
$(LIBFFI)
$(PTHREAD_LIBS)
libgobegin_a_SOURCES
=
\
runtime/go-main.c
...
...
@@ -1571,7 +1574,7 @@ LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \
GOLINK
=
$(LIBTOOL)
--tag
GO
--mode-link
$(GOC)
\
$(OPT_LDFLAGS)
$(SECTION_LDFLAGS)
$(AM_GOCFLAGS)
$(LTLDFLAGS)
\
-lpthread
-o
$@
$(PTHREAD_LIBS)
-o
$@
# Build a package.
...
...
This diff is collapsed.
Click to expand it.
libgo/configure
View file @
6c94a9fa
...
...
@@ -605,6 +605,8 @@ LIBOBJS
STRINGOPS_FLAG
HAVE_SYS_MMAN_H_FALSE
HAVE_SYS_MMAN_H_TRUE
PTHREAD_LIBS
PTHREAD_CFLAGS
USING_SPLIT_STACK_FALSE
USING_SPLIT_STACK_TRUE
SPLIT_STACK
...
...
@@ -10866,7 +10868,7 @@ else
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_status
=
$lt_dlunknown
cat
>
conftest.
$ac_ext
<<
_LT_EOF
#line 108
69
"configure"
#line 108
71
"configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
...
...
@@ -10972,7 +10974,7 @@ else
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_status
=
$lt_dlunknown
cat
>
conftest.
$ac_ext
<<
_LT_EOF
#line 1097
5
"configure"
#line 1097
7
"configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
...
...
@@ -13326,6 +13328,76 @@ $as_echo "#define LINKER_SUPPORTS_SPLIT_STACK 1" >>confdefs.h
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether -pthread is supported"
>
&5
$as_echo_n
"checking whether -pthread is supported... "
>
&6
;
}
if
test
"
${
ac_cv_libgo_pthread_supported
+set
}
"
=
set
;
then
:
$as_echo_n
"(cached) "
>
&6
else
CFLAGS_hold
=
$CFLAGS
CFLAGS
=
"
$CFLAGS
-pthread"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
int i;
_ACEOF
if
ac_fn_c_try_compile
"
$LINENO
"
;
then
:
ac_cv_libgo_pthread_supported
=
yes
else
ac_cv_libgo_pthread_supported
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest.
$ac_ext
CFLAGS
=
$CFLAGS_hold
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_libgo_pthread_supported
"
>
&5
$as_echo
"
$ac_cv_libgo_pthread_supported
"
>
&6
;
}
PTHREAD_CFLAGS
=
if
test
"
$ac_cv_libgo_pthread_supported
"
=
yes
;
then
PTHREAD_CFLAGS
=
-pthread
fi
PTHREAD_LIBS
=
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for pthread_create in -lpthread"
>
&5
$as_echo_n
"checking for pthread_create in -lpthread... "
>
&6
;
}
if
test
"
${
ac_cv_lib_pthread_pthread_create
+set
}
"
=
set
;
then
:
$as_echo_n
"(cached) "
>
&6
else
ac_check_lib_save_LIBS
=
$LIBS
LIBS
=
"-lpthread
$LIBS
"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char pthread_create ();
int
main ()
{
return pthread_create ();
;
return 0;
}
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_lib_pthread_pthread_create
=
yes
else
ac_cv_lib_pthread_pthread_create
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_pthread_pthread_create
"
>
&5
$as_echo
"
$ac_cv_lib_pthread_pthread_create
"
>
&6
;
}
if
test
"x
$ac_cv_lib_pthread_pthread_create
"
=
x
""
yes
;
then
:
PTHREAD_LIBS
=
-lpthread
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether byte ordering is bigendian"
>
&5
$as_echo_n
"checking whether byte ordering is bigendian... "
>
&6
;
}
if
test
"
${
ac_cv_c_bigendian
+set
}
"
=
set
;
then
:
...
...
This diff is collapsed.
Click to expand it.
libgo/configure.ac
View file @
6c94a9fa
...
...
@@ -187,6 +187,26 @@ if test "$ac_cv_libgo_linker_supports_split_stack" = yes; then
[Define if the linker support split stack adjustments])
fi
dnl Test whether the compiler supports the -pthread option.
AC_CACHE_CHECK([whether -pthread is supported],
[ac_cv_libgo_pthread_supported],
[CFLAGS_hold=$CFLAGS
CFLAGS="$CFLAGS -pthread"
AC_COMPILE_IFELSE([[int i;]],
[ac_cv_libgo_pthread_supported=yes],
[ac_cv_libgo_pthread_supported=no])
CFLAGS=$CFLAGS_hold])
PTHREAD_CFLAGS=
if test "$ac_cv_libgo_pthread_supported" = yes; then
PTHREAD_CFLAGS=-pthread
fi
AC_SUBST(PTHREAD_CFLAGS)
dnl Test for the -lpthread library.
PTHREAD_LIBS=
AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)
AC_SUBST(PTHREAD_LIBS)
AC_C_BIGENDIAN
GCC_CHECK_UNWIND_GETIPINFO
...
...
This diff is collapsed.
Click to expand it.
libgo/testsuite/Makefile.in
View file @
6c94a9fa
...
...
@@ -117,6 +117,8 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL
=
@PACKAGE_URL@
PACKAGE_VERSION
=
@PACKAGE_VERSION@
PATH_SEPARATOR
=
@PATH_SEPARATOR@
PTHREAD_CFLAGS
=
@PTHREAD_CFLAGS@
PTHREAD_LIBS
=
@PTHREAD_LIBS@
RANLIB
=
@RANLIB@
SED
=
@SED@
SET_MAKE
=
@SET_MAKE@
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment