Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by nagai takayuki
Tue, 26 Nov 1996 00:00
Re: gcc trampoline-feature does not work on NEWS-OS 4.2
Author: nagai takayuki
Date: Tue, 26 Nov 1996 00:00
Date: Tue, 26 Nov 1996 00:00
152 lines
6022 bytes
6022 bytes
Hi.
Previously I reported a problem following.
>I'm using gcc under the environment:
>
>
> gcc-version: 2.7.2
> (installed by
> ./configure --prefix=/home/local
> make bootstarap
> make install)
>
> machine: SONY NEWS-5000
> OS: NEWS-OS Release 4.2.1R
>
>
>The trouble is that gcc's trampoline-feature does not work on my environment.
>
>I tried to compile a source code following:
>
>/* Used by `configure' to test GCC nested functions */
>int main()
>{
> int a = 2;
> void nested(int b)
> {
> a += b;
> }
> void doit(void(*f)(int))
> {
> (*f)(4);
> }
> doit(nested);
> if (a != 6)
> exit(-1);
> exit(0);
>}
>
>When I compiled this code, the gcc returns error:
>
>>verdandi[62]% gcc config.nested.c
>>/usr/lib/cmplrs/cc/ld:
>>Undefined:
>>cacheflush
To solve this problem, I made a patch for gcc-2.7.2.1.
This patch defines 'cacheflush' function for SONY NEWS-OS 4.2.
To test this patch, I compiled gstep-base-0.2.10(which uses
gcc's trampoline-feature intensively) and all examples
worked correctly.
--------------patch here -----------------------
Common subdirectories: gcc-2.7.2.1.org/config and gcc-2.7.2.1/config
Common subdirectories: gcc-2.7.2.1.org/cp and gcc-2.7.2.1/cp
Only in gcc-2.7.2.1: diff
Common subdirectories: gcc-2.7.2.1.org/ginclude and gcc-2.7.2.1/ginclude
diff -r -c gcc-2.7.2.1.org/libgcc2.c gcc-2.7.2.1/libgcc2.c
*** gcc-2.7.2.1.org/libgcc2.c Mon Nov 27 04:39:21 1995
--- gcc-2.7.2.1/libgcc2.c Tue Nov 26 23:42:07 1996
***************
*** 2078,2083 ****
--- 2078,2112 ----
}
}
#endif /* __pyr__ */
+
+ #if defined (sony_news) && defined (SYSTYPE_BSD)
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <syscall.h>
+ #include <machine/sysnews.h>
+
+ /*
+ cacheflush function for NEWS-OS 4.2
+ This function is called from trampoline-initialize code
+ defined in config/mips/mips.h.
+ */
+
+ void cacheflush(beg,size,flag)
+ char *beg;
+ int size;
+ int flag;
+ {
+ if (syscall(SYS_sysnews,NEWS_CACHEFLUSH,beg,size,FLUSH_BCACHE))
+ {
+ perror ("cache_flush");
+ fflush (stderr);
+ abort ();
+ }
+ }
+
+ #endif /* sony_news */
#endif /* L_trampoline */
#ifdef L__main
Common subdirectories: gcc-2.7.2.1.org/objc and gcc-2.7.2.1/objc
Common subdirectories: gcc-2.7.2.1.org/config/1750a and gcc-2.7.2.1/config/1750a
Common subdirectories: gcc-2.7.2.1.org/config/a29k and gcc-2.7.2.1/config/a29k
Common subdirectories: gcc-2.7.2.1.org/config/alpha and gcc-2.7.2.1/config/alpha
Common subdirectories: gcc-2.7.2.1.org/config/arm and gcc-2.7.2.1/config/arm
Common subdirectories: gcc-2.7.2.1.org/config/clipper and gcc-2.7.2.1/config/clipper
Common subdirectories: gcc-2.7.2.1.org/config/convex and gcc-2.7.2.1/config/convex
Common subdirectories: gcc-2.7.2.1.org/config/dsp16xx and gcc-2.7.2.1/config/dsp16xx
Common subdirectories: gcc-2.7.2.1.org/config/elxsi and gcc-2.7.2.1/config/elxsi
Common subdirectories: gcc-2.7.2.1.org/config/fx80 and gcc-2.7.2.1/config/fx80
Common subdirectories: gcc-2.7.2.1.org/config/gmicro and gcc-2.7.2.1/config/gmicro
Common subdirectories: gcc-2.7.2.1.org/config/h8300 and gcc-2.7.2.1/config/h8300
Common subdirectories: gcc-2.7.2.1.org/config/i370 and gcc-2.7.2.1/config/i370
Common subdirectories: gcc-2.7.2.1.org/config/i386 and gcc-2.7.2.1/config/i386
Common subdirectories: gcc-2.7.2.1.org/config/i860 and gcc-2.7.2.1/config/i860
Common subdirectories: gcc-2.7.2.1.org/config/i960 and gcc-2.7.2.1/config/i960
Common subdirectories: gcc-2.7.2.1.org/config/m68k and gcc-2.7.2.1/config/m68k
Common subdirectories: gcc-2.7.2.1.org/config/m88k and gcc-2.7.2.1/config/m88k
Common subdirectories: gcc-2.7.2.1.org/config/mips and gcc-2.7.2.1/config/mips
Common subdirectories: gcc-2.7.2.1.org/config/msdos and gcc-2.7.2.1/config/msdos
Common subdirectories: gcc-2.7.2.1.org/config/ns32k and gcc-2.7.2.1/config/ns32k
Common subdirectories: gcc-2.7.2.1.org/config/pa and gcc-2.7.2.1/config/pa
Common subdirectories: gcc-2.7.2.1.org/config/pdp11 and gcc-2.7.2.1/config/pdp11
Common subdirectories: gcc-2.7.2.1.org/config/pyr and gcc-2.7.2.1/config/pyr
Common subdirectories: gcc-2.7.2.1.org/config/romp and gcc-2.7.2.1/config/romp
Common subdirectories: gcc-2.7.2.1.org/config/rs6000 and gcc-2.7.2.1/config/rs6000
Common subdirectories: gcc-2.7.2.1.org/config/sh and gcc-2.7.2.1/config/sh
Common subdirectories: gcc-2.7.2.1.org/config/sparc and gcc-2.7.2.1/config/sparc
Common subdirectories: gcc-2.7.2.1.org/config/spur and gcc-2.7.2.1/config/spur
Common subdirectories: gcc-2.7.2.1.org/config/tahoe and gcc-2.7.2.1/config/tahoe
Common subdirectories: gcc-2.7.2.1.org/config/vax and gcc-2.7.2.1/config/vax
Common subdirectories: gcc-2.7.2.1.org/config/we32k and gcc-2.7.2.1/config/we32k
Common subdirectories: gcc-2.7.2.1.org/config/winnt and gcc-2.7.2.1/config/winnt
-------------------------------------------------
ChangeLog entry for this patch
-------------------------------------------------
Tue Nov 26 23:45:12 Nagai Takayuki <nagai@ics.es.osaka-u.ac.jp>
* libgcc2.c (cacheflush): Add SONY NEWS-OS 4.2 version.
-------------------------------------------------
I would be happy if this helps you.
Bye.
Faculty of Engineering Science, Osaka University
Nagai Takayuki
nagai@ics.es.osaka-u.ac.jp
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads