Hi there!
First of all sorry for the form of my last email, I was in a kind of
strange mood that day.
I just realized that I sent an uncommented patch as an attachment in a
html-mail to this list
without telling what it does and why I needed to patch cegcc (my
bad). :(
So, again here it is, this time with information about each modification
(I'm compiling the current CeGCC SVN-trunk on Mac OSX Leopard 10.5.6
(PowerPC) )
Index: src/binutils/ld/deffilep.y
===================================================================
--- src/binutils/ld/deffilep.y (revision 1238)
+++ src/binutils/ld/deffilep.y (working copy)
@@ -104,7 +104,8 @@
int number;
};
-%token NAME LIBRARY DESCRIPTION STACKSIZE HEAPSIZE CODE DATAU DATAL
+/* %token NAME LIBRARY DESCRIPTION STACKSIZE HEAPSIZE CODE DATAU
DATAL */
+%token NAME LIBRARY DESCRIPTION HEAPSIZE CODE DATAU DATAL
%token SECTIONS EXPORTS IMPORTS VERSIONK BASE CONSTANTU CONSTANTL
%token PRIVATEU PRIVATEL
%token READ WRITE EXECUTE SHARED NONAMEU NONAMEL DIRECTIVE
@@ -124,7 +125,7 @@
NAME opt_name opt_base { def_image_name ($2, $3, 0); }
| LIBRARY opt_name opt_base { def_image_name ($2, $3, 1); }
| DESCRIPTION ID { def_description ($2);}
- | STACKSIZE NUMBER opt_number { def_stacksize ($2, $3);}
+/* | STACKSIZE NUMBER opt_number { def_stacksize ($2, $3);} */
| HEAPSIZE NUMBER opt_number { def_heapsize ($2, $3);}
| CODE attr_list { def_section ("CODE", $2);}
| DATAU attr_list { def_section ("DATA", $2);}
Without this patch, I get the following when compiling:
gcc -DHAVE_CONFIG_H -I. -I/Users/cerial/sources/cegcc/src/binutils/ld -
I. -I. -I/Users/cerial/sources/cegcc/src/binutils/ld -I../bfd -I/Users/
cerial/sources/cegcc/src/binutils/ld/../bfd -I/Users/cerial/sources/
cegcc/src/binutils/ld/../include -g -O2 -DLOCALEDIR="\"/opt/cegcc/
share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -
Werror -g -O2 -c deffilep.c -Wno-error
deffilep.c:204: error: syntax error before numeric constant
deffilep.c:233:1: warning: "STACKSIZE" redefined
In file included from /usr/include/machine/param.h:35,
from /usr/include/sys/param.h:110,
from /Users/cerial/sources/cegcc/src/binutils/ld/
sysdep.h:56,
from deffilep.y:23:
/usr/include/ppc/param.h:61:1: warning: this is the location of the
previous definition
make[4]: *** [deffilep.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-ld] Error 2
make: *** [all] Error 2
-----------------------------
I really don't know what's causing it, and what sideeffects my patch
has. Until now, I had no problems with
cegcc patched this way. If someone knows how to fix this safely,
please help! Thanks!
Next change:
Index: src/gcc/gcc/config/rs6000/host-darwin.c
===================================================================
--- src/gcc/gcc/config/rs6000/host-darwin.c (revision 1238)
+++ src/gcc/gcc/config/rs6000/host-darwin.c (working copy)
@@ -35,7 +35,9 @@
/* This doesn't have a prototype in signal.h in 10.2.x and earlier,
fixed in later releases. */
+#ifndef __DARWIN_UNIX03
extern int sigaltstack(const struct sigaltstack *, struct
sigaltstack *);
+#endif
#undef HOST_HOOKS_EXTRA_SIGNALS
#define HOST_HOOKS_EXTRA_SIGNALS darwin_rs6000_extra_signals
@@ -68,7 +70,11 @@
sigaddset (&sigset, SIGSEGV);
sigprocmask (SIG_UNBLOCK, &sigset, NULL);
+#if __DARWIN_UNIX03
+ faulting_insn = *(unsigned *)uc->uc_mcontext->__ss.__srr0;
+#else
faulting_insn = *(unsigned *)uc->uc_mcontext->ss.srr0;
+#endif
/* Note that this only has to work for GCC, so we don't have to deal
with all the possible cases (GCC has no AltiVec code, for
@@ -115,9 +121,13 @@
exit (FATAL_EXIT_CODE);
}
-
+#if __DARWIN_UNIX03
+ fprintf (stderr, "[address=%08lx pc=%08x]\n",
+ uc->uc_mcontext->__es.__dar, uc->uc_mcontext->__ss.__srr0);
+#else
fprintf (stderr, "[address=%08lx pc=%08x]\n",
uc->uc_mcontext->es.dar, uc->uc_mcontext->ss.srr0);
+#endif
internal_error ("Segmentation Fault");
exit (FATAL_EXIT_CODE);
}
Without the above, I get:
/Users/cerial/sources/cegcc/src/gcc/gcc/config/rs6000/host-darwin.c:
38: error: conflicting types for 'sigaltstack'
/usr/include/signal.h:89: error: previous declaration of 'sigaltstack'
was here
/Users/cerial/sources/cegcc/src/gcc/gcc/config/rs6000/host-darwin.c:
In function 'segv_handler':
/Users/cerial/sources/cegcc/src/gcc/gcc/config/rs6000/host-darwin.c:
71: error: 'struct __darwin_mcontext' has no member named 'ss'
/Users/cerial/sources/cegcc/src/gcc/gcc/config/rs6000/host-darwin.c:
120: error: 'struct __darwin_mcontext' has no member named 'es'
/Users/cerial/sources/cegcc/src/gcc/gcc/config/rs6000/host-darwin.c:
120: error: 'struct __darwin_mcontext' has no member named 'ss'
/Users/cerial/sources/cegcc/src/gcc/gcc/config/rs6000/host-darwin.c:
In function 'darwin_rs6000_extra_signals':
/Users/cerial/sources/cegcc/src/gcc/gcc/config/rs6000/host-darwin.c:
134: warning: passing argument 1 of 'sigaltstack' from incompatible
pointer type
make[1]: *** [host-ppc-darwin.o] Error 1
make: *** [all-gcc] Error 2
(also see:
http://mail-index.netbsd.org/netbsd-bugs/2008/02/13/msg001324.html
about this problem with gcc on mac osx 10.5 leopard)
-----------------------------
Another change:
Index: src/w32api/include/winuser.h
===================================================================
--- src/w32api/include/winuser.h (revision 1238)
+++ src/w32api/include/winuser.h (working copy)
@@ -3724,7 +3724,8 @@
WINUSERAPI int WINAPI GetKeyNameTextW(LONG,LPWSTR,int);
WINUSERAPI SHORT WINAPI GetKeyState(int);
WINUSERAPI HWND WINAPI GetLastActivePopup(HWND);
-WINUSERAPI HMENU WINAPI GetMenu(HWND);
+/* WINUSERAPI HMENU WINAPI GetMenu(HWND); */
+#define GetMenu(x) (NULL)
WINUSERAPI LONG WINAPI GetMenuCheckMarkDimensions(void);
WINUSERAPI DWORD WINAPI GetMenuContextHelpId(HMENU);
WINUSERAPI UINT WINAPI GetMenuDefaultItem(HMENU,UINT,UINT);
I'm not sure if this is always a safe fix, but NULL should be an
expected return value, according to:
http://msdn.microsoft.com/en-us/library/ms647640(VS.85).aspx
Maybe it should be replaced with CommandBar_GetMenu (http://msdn.microsoft.com/en-us/library/aa920592.aspx
)
(also see:
http://sourceforge.net/tracker/?func=detail&atid=865514&aid=1952666&group_id=173455
about this bug)
-----------------------------
Please disregard my modifications to winnt.h in the patch I submitted
in the last email; it seems
that I had some other problems with my headers - after a clean
checkout and rebuild of cegcc everything works
fine without my modifications to winnt.h.
It would be very kind if someone reviews these changes and tells me
his opinion about all this.
Thanks in advance! :)
Cerial
--
Ismail "Cerial" Khatib, http://pocketinsanity.org
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel