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
7a9cdb10
Commit
7a9cdb10
authored
Mar 22, 2003
by
DJ Delorie
Committed by
Bruce Korb
Mar 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Solaris 2.6 initializers
Co-Authored-By: Bruce Korb <bkorb@gnu.org> From-SVN: r64727
parent
8330e2c6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
163 additions
and
74 deletions
+163
-74
gcc/ChangeLog
+9
-0
gcc/fixinc/check.tpl
+1
-1
gcc/fixinc/fixincl.c
+9
-5
gcc/fixinc/fixincl.x
+106
-65
gcc/fixinc/inclhack.def
+20
-1
gcc/fixinc/tests/base/pthread.h
+18
-2
No files found.
gcc/ChangeLog
View file @
7a9cdb10
2003-03-22 DJ Delorie <dj at redhat dot com>,
Bruce Korb <bkorb at gnu dot org>
* fixinc/inclhack.def (solaris_mutex_init_1): New; Fix
buggy Solaris 2.6 mutex/cond initializers.
(solaris_mutex_init): Rename to solaris_mutex_init_2.
* fixinc/fixincl.x: Regenerate.
* fixinc/tests/base/pthread.h: Update.
2003-03-22 Andreas Jaeger <aj@suse.de>
* config/i386/i386.c (ix86_init_machine_status): Return value.
...
...
gcc/fixinc/check.tpl
View file @
7a9cdb10
...
...
@@ -17,7 +17,7 @@ TARGET_MACHINE='*'
DESTDIR=`$
{
PWDCMD
-
pwd
}
`/res
SRCDIR=`$
{
PWDCMD
-
pwd
}
`/inc
FIND_BASE='.'
VERBOSE=
1
VERBOSE=
[=` echo $
{
VERBOSE
-
1
}
`=]
INPUT=`$
{
PWDCMD
-
pwd
}
`
ORIGDIR=$
{
INPUT
}
...
...
gcc/fixinc/fixincl.c
View file @
7a9cdb10
...
...
@@ -284,6 +284,7 @@ ENV_TABLE
case
'A'
:
verbose_level
=
VERB_APPLIES
;
break
;
default:
case
'p'
:
case
'P'
:
verbose_level
=
VERB_PROGRESS
;
break
;
...
...
@@ -296,11 +297,14 @@ ENV_TABLE
case
'E'
:
verbose_level
=
VERB_EVERYTHING
;
break
;
}
while
((
pz_find_base
[
0
]
==
'.'
)
&&
(
pz_find_base
[
1
]
==
'/'
))
pz_find_base
+=
2
;
if
((
pz_find_base
[
0
]
!=
'.'
)
||
(
pz_find_base
[
1
]
!=
NUL
))
find_base_len
=
strlen
(
pz_find_base
);
if
(
verbose_level
>=
VERB_EVERYTHING
)
{
verbose_level
=
VERB_EVERYTHING
;
fputs
(
"fixinc verbosity: EVERYTHING
\n
"
,
stderr
);
}
while
((
pz_find_base
[
0
]
==
'.'
)
&&
(
pz_find_base
[
1
]
==
'/'
))
pz_find_base
+=
2
;
if
((
pz_find_base
[
0
]
!=
'.'
)
||
(
pz_find_base
[
1
]
!=
NUL
))
find_base_len
=
strlen
(
pz_find_base
);
/* Compile all the regular expressions now.
That way, it is done only once for the whole run.
...
...
gcc/fixinc/fixincl.x
View file @
7a9cdb10
...
...
@@ -5,7 +5,7 @@
* files which are fixed to work correctly with ANSI C and placed in a
* directory that GNU C will search.
*
* This file contains 14
7
fixup descriptions.
* This file contains 14
8
fixup descriptions.
*
* See README for more information.
*
...
...
@@ -2338,6 +2338,46 @@ static const char* apzIp_Missing_SemiPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Irix___Restrict fix
*/
tSCC zIrix___RestrictName[] =
"irix___restrict";
/*
* File name selection pattern
*/
tSCC zIrix___RestrictList[] =
"|internal/sgimacros.h|";
/*
* Machine/OS name selection pattern
*/
tSCC* apzIrix___RestrictMachs[] = {
"mips-sgi-irix6.5",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zIrix___RestrictSelect0[] =
"(#ifdef __c99\n\
)(#[ \t]*define __restrict restrict)";
#define IRIX___RESTRICT_TEST_CT 1
static tTestDesc aIrix___RestrictTests[] = {
{ TT_EGREP, zIrix___RestrictSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Irix___Restrict
*/
static const char* apzIrix___RestrictPatch[] = {
"format",
"%1# ifndef __cplusplus\n\
%2\n\
# endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Irix_Asm_Apostrophe fix
*/
tSCC zIrix_Asm_ApostropheName[] =
...
...
@@ -2409,46 +2449,6 @@ static const char* apzIrix_Limits_ConstPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Irix___Restrict fix
*/
tSCC zIrix___RestrictName[] =
"irix___restrict";
/*
* File name selection pattern
*/
tSCC zIrix___RestrictList[] =
"|internal/sgimacros.h|";
/*
* Machine/OS name selection pattern
*/
tSCC* apzIrix___RestrictMachs[] = {
"mips-sgi-irix6.5",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zIrix___RestrictSelect0[] =
"(#ifdef __c99\n\
)(#[ \t]*define __restrict restrict)";
#define IRIX___RESTRICT_TEST_CT 1
static tTestDesc aIrix___RestrictTests[] = {
{ TT_EGREP, zIrix___RestrictSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Irix___Restrict
*/
static const char* apzIrix___RestrictPatch[] = {
"format",
"%1# ifndef __cplusplus\n\
%2\n\
# endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Irix_Socklen_T fix
*/
tSCC zIrix_Socklen_TName[] =
...
...
@@ -3749,35 +3749,70 @@ static const char* apzSco_UtimePatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Solaris_Mutex_Init fix
* Description of Solaris_Mutex_Init
_1
fix
*/
tSCC zSolaris_Mutex_InitName[] =
"solaris_mutex_init";
tSCC zSolaris_Mutex_Init
_1
Name[] =
"solaris_mutex_init
_1
";
/*
* File name selection pattern
*/
tSCC zSolaris_Mutex_InitList[] =
tSCC zSolaris_Mutex_Init
_1
List[] =
"|pthread.h|";
/*
* Machine/OS name selection pattern
*/
#define apzSolaris_Mutex_InitMachs (const char**)NULL
#define apzSolaris_Mutex_Init
_1
Machs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
tSCC zSolaris_Mutex_InitSelect0[] =
tSCC zSolaris_Mutex_Init_1Select0[] =
"@\\(#\\)pthread.h[ \t]+1.1[0-9][ \t]+97/[0-9/]+ SMI";
#define SOLARIS_MUTEX_INIT_1_TEST_CT 1
static tTestDesc aSolaris_Mutex_Init_1Tests[] = {
{ TT_EGREP, zSolaris_Mutex_Init_1Select0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Solaris_Mutex_Init_1
*/
static const char* apzSolaris_Mutex_Init_1Patch[] = { "sed",
"-e", "/define[ \t]*PTHREAD_MUTEX_INI/s/{0, 0,/{{{0}, 0}, {{{0}}},/\n\
/define[ \t]*PTHREAD_COND_INI/s/{0,/{{{0},0},/",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Solaris_Mutex_Init_2 fix
*/
tSCC zSolaris_Mutex_Init_2Name[] =
"solaris_mutex_init_2";
/*
* File name selection pattern
*/
tSCC zSolaris_Mutex_Init_2List[] =
"|pthread.h|";
/*
* Machine/OS name selection pattern
*/
#define apzSolaris_Mutex_Init_2Machs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
tSCC zSolaris_Mutex_Init_2Select0[] =
"@\\(#\\)pthread.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
#define SOLARIS_MUTEX_INIT_TEST_CT 1
static tTestDesc aSolaris_Mutex_InitTests[] = {
{ TT_EGREP, zSolaris_Mutex_InitSelect0, (regex_t*)NULL }, };
#define SOLARIS_MUTEX_INIT_
2_
TEST_CT 1
static tTestDesc aSolaris_Mutex_Init
_2
Tests[] = {
{ TT_EGREP, zSolaris_Mutex_Init
_2
Select0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Solaris_Mutex_Init
* Fix Command Arguments for Solaris_Mutex_Init
_2
*/
static const char* apzSolaris_Mutex_InitPatch[] = {
static const char* apzSolaris_Mutex_Init
_2
Patch[] = {
"format",
"#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n\
%0\n\
...
...
@@ -5803,9 +5838,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
#define REGEX_COUNT 1
59
#define REGEX_COUNT 1
60
#define MACH_LIST_SIZE_LIMIT 261
#define FIX_COUNT 14
7
#define FIX_COUNT 14
8
/*
* Enumerate the fixes
...
...
@@ -5867,9 +5902,9 @@ typedef enum {
IO_QUOTES_DEF_FIXIDX,
IO_QUOTES_USE_FIXIDX,
IP_MISSING_SEMI_FIXIDX,
IRIX___RESTRICT_FIXIDX,
IRIX_ASM_APOSTROPHE_FIXIDX,
IRIX_LIMITS_CONST_FIXIDX,
IRIX___RESTRICT_FIXIDX,
IRIX_SOCKLEN_T_FIXIDX,
IRIX_STDIO_VA_LIST_FIXIDX,
IRIX_WCSFTIME_FIXIDX,
...
...
@@ -5904,7 +5939,8 @@ typedef enum {
RS6000_PARAM_FIXIDX,
SCO_STATIC_FUNC_FIXIDX,
SCO_UTIME_FIXIDX,
SOLARIS_MUTEX_INIT_FIXIDX,
SOLARIS_MUTEX_INIT_1_FIXIDX,
SOLARIS_MUTEX_INIT_2_FIXIDX,
SOLARIS_STDIO_TAG_FIXIDX,
SOLARIS_WIDEC_FIXIDX,
STATSSWTCH_FIXIDX,
...
...
@@ -6241,6 +6277,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
IP_MISSING_SEMI_TEST_CT, FD_MACH_ONLY,
aIp_Missing_SemiTests, apzIp_Missing_SemiPatch, 0 },
{ zIrix___RestrictName, zIrix___RestrictList,
apzIrix___RestrictMachs,
IRIX___RESTRICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aIrix___RestrictTests, apzIrix___RestrictPatch, 0 },
{ zIrix_Asm_ApostropheName, zIrix_Asm_ApostropheList,
apzIrix_Asm_ApostropheMachs,
IRIX_ASM_APOSTROPHE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
...
...
@@ -6251,11 +6292,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
IRIX_LIMITS_CONST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aIrix_Limits_ConstTests, apzIrix_Limits_ConstPatch, 0 },
{ zIrix___RestrictName, zIrix___RestrictList,
apzIrix___RestrictMachs,
IRIX___RESTRICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aIrix___RestrictTests, apzIrix___RestrictPatch, 0 },
{ zIrix_Socklen_TName, zIrix_Socklen_TList,
apzIrix_Socklen_TMachs,
IRIX_SOCKLEN_T_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
...
...
@@ -6426,10 +6462,15 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
SCO_UTIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSco_UtimeTests, apzSco_UtimePatch, 0 },
{ zSolaris_Mutex_InitName, zSolaris_Mutex_InitList,
apzSolaris_Mutex_InitMachs,
SOLARIS_MUTEX_INIT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSolaris_Mutex_InitTests, apzSolaris_Mutex_InitPatch, 0 },
{ zSolaris_Mutex_Init_1Name, zSolaris_Mutex_Init_1List,
apzSolaris_Mutex_Init_1Machs,
SOLARIS_MUTEX_INIT_1_TEST_CT, FD_MACH_ONLY,
aSolaris_Mutex_Init_1Tests, apzSolaris_Mutex_Init_1Patch, 0 },
{ zSolaris_Mutex_Init_2Name, zSolaris_Mutex_Init_2List,
apzSolaris_Mutex_Init_2Machs,
SOLARIS_MUTEX_INIT_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSolaris_Mutex_Init_2Tests, apzSolaris_Mutex_Init_2Patch, 0 },
{ zSolaris_Stdio_TagName, zSolaris_Stdio_TagList,
apzSolaris_Stdio_TagMachs,
...
...
gcc/fixinc/inclhack.def
View file @
7a9cdb10
...
...
@@ -2057,6 +2057,25 @@ fix = {
/*
* Sun Solaris 2.6 defines PTHREAD_{MUTEX|COND}_INITIALIZER incorrectly,
* so we replace them with versions that correspond to the definition. We
* also explicitly name this fix "1" and the next fix "2" because this one
* does not deal with the last field. This fix needs to run before the next.
*/
fix = {
hackname = solaris_mutex_init_1;
select = '@\(#\)pthread.h' "[ \t]+1.1[0-9][ \t]+97/[0-9/]+ SMI";
files = pthread.h;
sed = "/define[ \t]*PTHREAD_MUTEX_INI/s/{0, 0,/{{{0}, 0}, {{{0}}},/\n"
"/define[ \t]*PTHREAD_COND_INI/s/{0,/{{{0},0},/";
test_text =
'#ident "@(#)pthread.h 1.16 97/05/05 SMI"'"\n"
"#define PTHREAD_MUTEX_INITIALIZER\t{0, 0, 0}\n"
"#define PTHREAD_COND_INITIALIZER\t{0, 0} /* */\n";
};
/*
* Sun Solaris defines PTHREAD_MUTEX_INITIALIZER with a trailing
* "0" for the last field of the pthread_mutex_t structure, which is
* of type upad64_t, which itself is typedef'd to int64_t, but with
...
...
@@ -2064,7 +2083,7 @@ fix = {
* initializer to "{0}" instead
*/
fix = {
hackname = solaris_mutex_init;
hackname = solaris_mutex_init
_2
;
select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
files = pthread.h;
c_fix = format;
...
...
gcc/fixinc/tests/base/pthread.h
View file @
7a9cdb10
...
...
@@ -20,7 +20,23 @@ extern int __page_size;
#endif
/* PTHREAD_PAGE_SIZE_CHECK */
#if defined( SOLARIS_MUTEX_INIT_CHECK )
#if defined( SOLARIS_MUTEX_INIT_1_CHECK )
#ident "@(#)pthread.h 1.16 97/05/05 SMI"
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_MUTEX_INITIALIZER {{{0}, 0}, {{{0}}}, 0}
#else
#define PTHREAD_MUTEX_INITIALIZER {{{0}, 0}, {{{0}}}, {0}}
#endif
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_COND_INITIALIZER {{{0},0}, 0}
/* */
#else
#define PTHREAD_COND_INITIALIZER {{{0},0}, {0}}
/* */
#endif
#endif
/* SOLARIS_MUTEX_INIT_1_CHECK */
#if defined( SOLARIS_MUTEX_INIT_2_CHECK )
#ident "@(#)pthread.h 1.26 98/04/12 SMI"
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_MUTEX_INITIALIZER {{{0},0}, {{{0}}}, 0}
...
...
@@ -33,7 +49,7 @@ extern int __page_size;
#define PTHREAD_COND_INITIALIZER {{{0}, 0}, {0}}
/* DEFAULTCV */
#endif
#define PTHREAD_RWLOCK_INITIALIZER {0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}
#endif
/* SOLARIS_MUTEX_INIT_CHECK */
#endif
/* SOLARIS_MUTEX_INIT_
2_
CHECK */
#if defined( THREAD_KEYWORD_CHECK )
...
...
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