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
a7c48c8e
Commit
a7c48c8e
authored
Feb 01, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test whether libgcc or kernel defines __sync_bool_compare_and_swap_4.
From-SVN: r169504
parent
56490b74
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
1 deletions
+47
-1
libgo/config.h.in
+4
-0
libgo/configure
+28
-0
libgo/configure.ac
+14
-0
libgo/runtime/thread.c
+1
-1
No files found.
libgo/config.h.in
View file @
a7c48c8e
...
...
@@ -39,6 +39,10 @@
/* Define to 1 if you have the `strsignal' function. */
#undef HAVE_STRSIGNAL
/* Define to 1 if the compiler provides the __sync_bool_compare_and_swap
function for uint32 */
#undef HAVE_SYNC_BOOL_COMPARE_AND_SWAP_4
/* Define to 1 if you have the <syscall.h> header file. */
#undef HAVE_SYSCALL_H
...
...
libgo/configure
View file @
a7c48c8e
...
...
@@ -14099,6 +14099,34 @@ fi
done
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for __sync_bool_compare_and_swap_4"
>
&5
$as_echo_n
"checking for __sync_bool_compare_and_swap_4... "
>
&6
;
}
if
test
"
${
libgo_cv_func___sync_bool_compare_and_swap_4
+set
}
"
=
set
;
then
:
$as_echo_n
"(cached) "
>
&6
else
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
typedef unsigned int uint32 __attribute__ ((mode (SI)));
uint32 i;
int main() { return __sync_bool_compare_and_swap (&i, 0, 1); }
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
libgo_cv_func___sync_bool_compare_and_swap_4
=
yes
else
libgo_cv_func___sync_bool_compare_and_swap_4
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$libgo_cv_func___sync_bool_compare_and_swap_4
"
>
&5
$as_echo
"
$libgo_cv_func___sync_bool_compare_and_swap_4
"
>
&6
;
}
if
test
"
$libgo_cv_func___sync_bool_compare_and_swap_4
"
=
"yes"
;
then
$as_echo
"#define HAVE_SYNC_BOOL_COMPARE_AND_SWAP_4 1"
>>
confdefs.h
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether compiler supports -minline-all-stringops"
>
&5
$as_echo_n
"checking whether compiler supports -minline-all-stringops... "
>
&6
;
}
if
test
"
${
libgo_cv_c_stringops
+set
}
"
=
set
;
then
:
...
...
libgo/configure.ac
View file @
a7c48c8e
...
...
@@ -332,6 +332,20 @@ AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/user.h sys/ut
AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)
AC_CHECK_FUNCS(srandom random strsignal)
AC_CACHE_CHECK([for __sync_bool_compare_and_swap_4],
[libgo_cv_func___sync_bool_compare_and_swap_4],
[AC_LINK_IFELSE([
typedef unsigned int uint32 __attribute__ ((mode (SI)));
uint32 i;
int main() { return __sync_bool_compare_and_swap (&i, 0, 1); }
],
[libgo_cv_func___sync_bool_compare_and_swap_4=yes],
[libgo_cv_func___sync_bool_compare_and_swap_4=no])])
if test "$libgo_cv_func___sync_bool_compare_and_swap_4" = "yes"; then
AC_DEFINE(HAVE_SYNC_BOOL_COMPARE_AND_SWAP_4, 1,
[Define to 1 if the compiler provides the __sync_bool_compare_and_swap function for uint32])
fi
dnl For x86 we want to use the -minline-all-stringops option to avoid
dnl forcing a stack split when calling memcpy and friends.
AC_CACHE_CHECK([whether compiler supports -minline-all-stringops],
...
...
libgo/runtime/thread.c
View file @
a7c48c8e
...
...
@@ -77,7 +77,7 @@ runtime_destroylock(Lock *l)
sem_destroy
(
&
l
->
sem
);
}
#ifndef
__GCC_HAVE_SYNC
_COMPARE_AND_SWAP_4
#ifndef
HAVE_SYNC_BOOL
_COMPARE_AND_SWAP_4
// For targets which don't have the required sync support. Really
// this should be provided by gcc itself. FIXME.
...
...
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