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
8955c80a
Commit
8955c80a
authored
Mar 30, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libgo: Support systems which do not have strerror_r.
From-SVN: r171757
parent
25a182be
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
7 deletions
+61
-7
libgo/Makefile.am
+5
-1
libgo/Makefile.in
+3
-2
libgo/configure
+18
-3
libgo/configure.ac
+3
-1
libgo/syscalls/errstr_nor.go
+32
-0
No files found.
libgo/Makefile.am
View file @
8955c80a
...
@@ -1264,7 +1264,11 @@ endif
...
@@ -1264,7 +1264,11 @@ endif
if
LIBGO_IS_RTEMS
if
LIBGO_IS_RTEMS
syscall_errstr_file
=
syscalls/errstr_rtems.go
syscall_errstr_file
=
syscalls/errstr_rtems.go
else
else
if
HAVE_STRERROR_R
syscall_errstr_file
=
syscalls/errstr.go
syscall_errstr_file
=
syscalls/errstr.go
else
syscall_errstr_file
=
syscalls/errstr_nor.go
endif
endif
endif
# Declare libc_strerror_r which is the Go name for strerror_r.
# Declare libc_strerror_r which is the Go name for strerror_r.
...
@@ -1273,7 +1277,7 @@ if LIBGO_IS_RTEMS
...
@@ -1273,7 +1277,7 @@ if LIBGO_IS_RTEMS
syscall_errstr_decl_file
=
syscalls/errstr_decl_rtems.go
syscall_errstr_decl_file
=
syscalls/errstr_decl_rtems.go
else
else
if
LIBGO_IS_LINUX
if
LIBGO_IS_LINUX
#
In
Linux the POSIX strerror_r is called __xpg_strerror_r.
#
On GNU/
Linux the POSIX strerror_r is called __xpg_strerror_r.
syscall_errstr_decl_file
=
syscalls/errstr_decl_linux.go
syscall_errstr_decl_file
=
syscalls/errstr_decl_linux.go
else
else
# On other systems we hope strerror_r is just strerror_r.
# On other systems we hope strerror_r is just strerror_r.
...
...
libgo/Makefile.in
View file @
8955c80a
...
@@ -1638,13 +1638,14 @@ go_testing_script_files = \
...
@@ -1638,13 +1638,14 @@ go_testing_script_files = \
# Define Sleep.
# Define Sleep.
@LIBGO_IS_RTEMS_TRUE@
syscall_sleep_file
=
syscalls/sleep_rtems.go
@LIBGO_IS_RTEMS_TRUE@
syscall_sleep_file
=
syscalls/sleep_rtems.go
@LIBGO_IS_RTEMS_FALSE@
syscall_errstr_file
=
syscalls/errstr.go
@HAVE_STRERROR_R_FALSE@@LIBGO_IS_RTEMS_FALSE@
syscall_errstr_file
=
syscalls/errstr_nor.go
@HAVE_STRERROR_R_TRUE@@LIBGO_IS_RTEMS_FALSE@
syscall_errstr_file
=
syscalls/errstr.go
# Define Errstr.
# Define Errstr.
@LIBGO_IS_RTEMS_TRUE@
syscall_errstr_file
=
syscalls/errstr_rtems.go
@LIBGO_IS_RTEMS_TRUE@
syscall_errstr_file
=
syscalls/errstr_rtems.go
# On other systems we hope strerror_r is just strerror_r.
# On other systems we hope strerror_r is just strerror_r.
@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_RTEMS_FALSE@
syscall_errstr_decl_file
=
syscalls/errstr_decl.go
@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_RTEMS_FALSE@
syscall_errstr_decl_file
=
syscalls/errstr_decl.go
#
In
Linux the POSIX strerror_r is called __xpg_strerror_r.
#
On GNU/
Linux the POSIX strerror_r is called __xpg_strerror_r.
@LIBGO_IS_LINUX_TRUE@@LIBGO_IS_RTEMS_FALSE@
syscall_errstr_decl_file
=
syscalls/errstr_decl_linux.go
@LIBGO_IS_LINUX_TRUE@@LIBGO_IS_RTEMS_FALSE@
syscall_errstr_decl_file
=
syscalls/errstr_decl_linux.go
# Declare libc_strerror_r which is the Go name for strerror_r.
# Declare libc_strerror_r which is the Go name for strerror_r.
...
...
libgo/configure
View file @
8955c80a
...
@@ -603,6 +603,8 @@ am__EXEEXT_TRUE
...
@@ -603,6 +603,8 @@ am__EXEEXT_TRUE
LTLIBOBJS
LTLIBOBJS
LIBOBJS
LIBOBJS
STRINGOPS_FLAG
STRINGOPS_FLAG
HAVE_STRERROR_R_FALSE
HAVE_STRERROR_R_TRUE
HAVE_SYS_MMAN_H_FALSE
HAVE_SYS_MMAN_H_FALSE
HAVE_SYS_MMAN_H_TRUE
HAVE_SYS_MMAN_H_TRUE
PTHREAD_LIBS
PTHREAD_LIBS
...
@@ -10898,7 +10900,7 @@ else
...
@@ -10898,7 +10900,7 @@ else
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_status
=
$lt_dlunknown
lt_status
=
$lt_dlunknown
cat
>
conftest.
$ac_ext
<<
_LT_EOF
cat
>
conftest.
$ac_ext
<<
_LT_EOF
#line 1090
1
"configure"
#line 1090
3
"configure"
#include "confdefs.h"
#include "confdefs.h"
#if HAVE_DLFCN_H
#if HAVE_DLFCN_H
...
@@ -11004,7 +11006,7 @@ else
...
@@ -11004,7 +11006,7 @@ else
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_dlunknown
=
0
;
lt_dlno_uscore
=
1
;
lt_dlneed_uscore
=
2
lt_status
=
$lt_dlunknown
lt_status
=
$lt_dlunknown
cat
>
conftest.
$ac_ext
<<
_LT_EOF
cat
>
conftest.
$ac_ext
<<
_LT_EOF
#line 1100
7
"configure"
#line 1100
9
"configure"
#include "confdefs.h"
#include "confdefs.h"
#if HAVE_DLFCN_H
#if HAVE_DLFCN_H
...
@@ -14151,7 +14153,8 @@ else
...
@@ -14151,7 +14153,8 @@ else
HAVE_SYS_MMAN_H_FALSE
=
HAVE_SYS_MMAN_H_FALSE
=
fi
fi
for
ac_func
in
srandom random strsignal
for
ac_func
in
srandom random strerror_r strsignal
do
:
do
:
as_ac_var
=
`
$as_echo
"ac_cv_func_
$ac_func
"
|
$as_tr_sh
`
as_ac_var
=
`
$as_echo
"ac_cv_func_
$ac_func
"
|
$as_tr_sh
`
ac_fn_c_check_func
"
$LINENO
"
"
$ac_func
"
"
$as_ac_var
"
ac_fn_c_check_func
"
$LINENO
"
"
$ac_func
"
"
$as_ac_var
"
...
@@ -14164,6 +14167,14 @@ _ACEOF
...
@@ -14164,6 +14167,14 @@ _ACEOF
fi
fi
done
done
if
test
"
$ac_cv_func_strerror_r
"
=
yes
;
then
HAVE_STRERROR_R_TRUE
=
HAVE_STRERROR_R_FALSE
=
'#'
else
HAVE_STRERROR_R_TRUE
=
'#'
HAVE_STRERROR_R_FALSE
=
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for __sync_bool_compare_and_swap_4"
>
&5
{
$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
;
}
$as_echo_n
"checking for __sync_bool_compare_and_swap_4... "
>
&6
;
}
...
@@ -14537,6 +14548,10 @@ if test -z "${HAVE_SYS_MMAN_H_TRUE}" && test -z "${HAVE_SYS_MMAN_H_FALSE}"; then
...
@@ -14537,6 +14548,10 @@ if test -z "${HAVE_SYS_MMAN_H_TRUE}" && test -z "${HAVE_SYS_MMAN_H_FALSE}"; then
as_fn_error
"conditional
\"
HAVE_SYS_MMAN_H
\"
was never defined.
as_fn_error
"conditional
\"
HAVE_SYS_MMAN_H
\"
was never defined.
Usually this means the macro was only invoked conditionally."
"
$LINENO
"
5
Usually this means the macro was only invoked conditionally."
"
$LINENO
"
5
fi
fi
if
test
-z
"
${
HAVE_STRERROR_R_TRUE
}
"
&&
test
-z
"
${
HAVE_STRERROR_R_FALSE
}
"
;
then
as_fn_error
"conditional
\"
HAVE_STRERROR_R
\"
was never defined.
Usually this means the macro was only invoked conditionally."
"
$LINENO
"
5
fi
:
${
CONFIG_STATUS
=./config.status
}
:
${
CONFIG_STATUS
=./config.status
}
ac_write_fail
=
0
ac_write_fail
=
0
...
...
libgo/configure.ac
View file @
8955c80a
...
@@ -380,7 +380,9 @@ esac
...
@@ -380,7 +380,9 @@ esac
AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h)
AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h)
AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)
AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)
AC_CHECK_FUNCS(srandom random strsignal)
AC_CHECK_FUNCS(srandom random strerror_r strsignal)
AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
AC_CACHE_CHECK([for __sync_bool_compare_and_swap_4],
AC_CACHE_CHECK([for __sync_bool_compare_and_swap_4],
[libgo_cv_func___sync_bool_compare_and_swap_4],
[libgo_cv_func___sync_bool_compare_and_swap_4],
...
...
libgo/syscalls/errstr_nor.go
0 → 100644
View file @
8955c80a
// errstr.go -- Error strings when there is no strerror_r.
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
syscall
import
(
"sync"
"unsafe"
)
func
libc_strerror
(
int
)
*
byte
__asm__
(
"strerror"
)
var
errstr_lock
sync
.
Mutex
func
Errstr
(
errno
int
)
string
{
errstr_lock
.
Lock
()
bp
:=
libc_strerror
(
errno
)
b
:=
(
*
[
1000
]
byte
)(
unsafe
.
Pointer
(
bp
))
i
:=
0
for
b
[
i
]
!=
0
{
i
++
}
s
:=
string
(
b
[
:
i
])
errstr_lock
.
Unlock
()
return
s
}
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