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
725471d2
Commit
725471d2
authored
Aug 05, 1998
by
Bruce Korb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to allow bypassing tests for certain machines
From-SVN: r21614
parent
7c3b5ba5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
23 deletions
+79
-23
contrib/fixinc/Makefile
+1
-1
contrib/fixinc/fixincl.c
+55
-17
contrib/fixinc/fixincl.tpl
+21
-3
contrib/fixinc/mkfixinc.sh
+2
-2
No files found.
contrib/fixinc/Makefile
View file @
725471d2
...
...
@@ -34,7 +34,7 @@ regex.o: regex.c
-
$(CC)
-g
-DSTDC_HEADERS
=
1
-c
regex.c
fixincl.o
:
fixincl.x fixincl.c
-
$(CC)
$(CFLAGS)
-o
$@
-c
fixincl.c
-
$(CC)
$(CFLAGS)
'-DTARGET_MACHINE="
$(TARGET)
"'
-o
$@
-c
fixincl.c
server.o
:
server.c server.h
-
$(CC)
$(CFLAGS)
-o
$@
-c
server.c
...
...
contrib/fixinc/fixincl.c
View file @
725471d2
...
...
@@ -73,27 +73,28 @@ struct test_desc
regex_t
*
pTestRegex
;
};
typedef
enum
{
PATCH_SED
,
PATCH_SHELL
}
tePatch
;
typedef
struct
patch_desc
tPatchDesc
;
#define FD_MACH_ONLY 0x0000
#define FD_MACH_IFNOT 0x0001
#define FD_SKIP_TEST 0x8000
typedef
struct
fix_desc
tFixDesc
;
struct
fix_desc
{
const
char
*
pzFixName
;
const
char
*
pzFileList
;
regex_t
*
pListRegex
;
const
char
*
pzFixName
;
/* Name of the fix */
const
char
*
pzFileList
;
/* List of files it applies to */
const
char
**
papzMachs
;
/* List of machine/os-es it applies to */
regex_t
*
pListRegex
;
int
testCt
;
tTestDesc
*
pTestDesc
;
const
char
**
papzPatchArgs
;
int
fdFlags
;
tTestDesc
*
pTestDesc
;
const
char
**
papzPatchArgs
;
};
char
*
pzDestDir
=
(
char
*
)
NULL
;
char
*
pzSrcDir
=
(
char
*
)
NULL
;
char
zMachine
[]
=
TARGET_MACHINE
;
pid_t
chainHead
=
(
pid_t
)
-
1
;
...
...
@@ -135,7 +136,7 @@ main (argc, argv)
if
(
strcmp
(
argv
[
1
],
"-v"
)
==
0
)
{
fputs
(
"$Id: fixincl.c,v 1.3 1998/06/02 07:00:12
korbb Exp $
\n
"
,
stderr
);
fputs
(
"$Id: fixincl.c,v 1.4 1998/08/05 10:20:11
korbb Exp $
\n
"
,
stderr
);
exit
(
EXIT_SUCCESS
);
}
...
...
@@ -345,11 +346,48 @@ runCompiles ()
/*
* FOR every fixup, ...
*/
for
(;;)
do
{
pTD
=
pFD
->
pTestDesc
;
tstCt
=
pFD
->
testCt
;
if
(
pFD
->
papzMachs
!=
(
const
char
**
)
NULL
)
{
const
char
**
papzMachs
=
pFD
->
papzMachs
;
char
*
pz
=
zFileNameBuf
;
char
*
pzSep
=
""
;
tCC
*
pzIfTrue
;
tCC
*
pzIfFalse
;
tSCC
zSkip
[]
=
"skip"
;
tSCC
zRun
[]
=
"run"
;
sprintf
(
pz
,
"case %s in
\n
"
,
zMachine
);
pz
+=
strlen
(
pz
);
if
(
pFD
->
fdFlags
&
FD_MACH_IFNOT
)
{
pzIfTrue
=
zSkip
;
pzIfFalse
=
zRun
;
}
else
{
pzIfTrue
=
zRun
;
pzIfFalse
=
zSkip
;
}
for
(;;)
{
const
char
*
pzMach
=
*
(
papzMachs
++
);
if
(
pzMach
==
(
const
char
*
)
NULL
)
break
;
sprintf
(
pz
,
"%s %s"
,
pzSep
,
pzMach
);
pz
+=
strlen
(
pz
);
pzSep
=
" |
\\\n
"
;
}
sprintf
(
pz
,
" )
\n
echo %s ;;
\n
* )
\n
echo %s ;;
\n
esac"
,
pzIfTrue
,
pzIfFalse
);
pz
=
runShell
(
zFileNameBuf
);
if
(
*
pz
==
's'
)
{
pFD
->
fdFlags
|=
FD_SKIP_TEST
;
continue
;
}
}
/*
* FOR every test for the fixup, ...
*/
...
...
@@ -378,11 +416,8 @@ runCompiles ()
}
pTD
++
;
}
if
(
--
fixCt
<=
0
)
break
;
pFD
++
;
}
while
(
pFD
++
,
--
fixCt
>
0
);
}
...
...
@@ -600,6 +635,9 @@ process (pzDta, pzDir, pzFile)
int
tstCt
;
tSuccess
egrepRes
;
if
(
pFD
->
fdFlags
&
FD_SKIP_TEST
)
continue
;
/*
* IF there is a file name restriction,
* THEN ensure the current file name matches one in the pattern
...
...
contrib/fixinc/fixincl.tpl
View file @
725471d2
...
...
@@ -33,6 +33,20 @@ tSCC z[=hackname _cap=]List[] =[=
_ELSE =]
#define z[=hackname _cap=]List (char*)NULL[=
_ENDIF "files _exist" =]
/*
* Machine/OS name selection pattern
*/[=
_IF mach _exist=]
tSCC* apz[=hackname _cap=]Machs[] = {[=
_FOR mach =]
[=mach _str=],[=
/mach=]
(const char*)NULL };[=
_ELSE =]
#define apz[=hackname _cap=]Machs (const char**)NULL[=
_ENDIF "files _exist" =][=
_IF exesel _exist=]
...
...
@@ -143,9 +157,13 @@ tFixDesc fixDescList[ [=_eval fix _count =] ] = {[=
_FOR fix ",\n" =]
{ z[=hackname _cap=]Name, z[=hackname _cap=]List, (regex_t*)NULL,
[=hackname _up=]_TEST_CT, a[=hackname _cap=]Tests,
apz[=hackname _cap=]Patch }[=
{ z[=hackname _cap=]Name, z[=hackname _cap=]List,
apz[=hackname _cap=]Machs, (regex_t*)NULL,
[=hackname _up=]_TEST_CT, [=
_IF not_machine _exist =]FD_MACH_IFNOT[=
_ELSE =]FD_MACH_ONLY[=
_ENDIF =],
a[=hackname _cap=]Tests, apz[=hackname _cap=]Patch }[=
/fix=]
};
contrib/fixinc/mkfixinc.sh
View file @
725471d2
...
...
@@ -113,7 +113,7 @@ then
exit
0
fi
echo
$MAKE
install
DESTDIR
=
`
dirname
$dest
`
$MAKE
install
DESTDIR
=
`
dirname
$dest
`
echo
$MAKE
install
DESTDIR
=
`
dirname
$dest
`
TARGET
=
$machine
$MAKE
install
DESTDIR
=
`
dirname
$dest
`
TARGET
=
$machine
exit
1
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