Hello All,

I've successfully installed Prc-tools-0.5.1b3 on my Linux box 
and was able to make John Marshall's 'Trashy Little Program' 
(TLP) - which demonstates howto to compile a multisegmented 
palm app, with Palm SDK 3.1.

I downloaded version 3.5 of the SDK from the Provider Pavillion,
btw: thanks for updating the UNIX link to a ZIP file rather than
a SIT (MAC) file (Any chance of getting a Tarball?).  Installed
the includes in the 'palmdev' directory under sdk-3.5 and created
a symbolic link.  Created a 'header.gcc' file consisting of:

   PalmOptErrorCheckLevel.h    Dynamic/PalmOptErrorCheckLevel.h
   LibTraps.h                  Libraries/LibTraps.h

to take care of the gcc errors complaining about not finding
those header files.

ISSUE 1 - 'callseq' warnings
----------------------------
I then massaged the TLP Code to be conformant with the various
changes in SDK 3.5, include PalmOS.h, use UInt16, UInt32, etc...
Attempted to make the program again, and received a *huge* amount
of warnings concerning a 'possibly bad __callseq__'.  A small
clip of the output follows:

-------- 8< -----------
m68k-palmos-gcc -O2    -c multiapp.c -o multiapp.o
In file included from /usr/local/palmdev/sdk/include/Core/System/AlarmMgr.h:26,
                 from /usr/local/palmdev/sdk/include/Core/System/SystemPublic.h:24,
                 from /usr/local/palmdev/sdk/include/PalmOS.h:28,
                 from multiapp.c:1:
/usr/local/palmdev/sdk/include/Core/System/ErrorBase.h:236: 
  warning: possibly bad __callseq__ `trap #15; dc.w sysTrapErrSetJump'

/usr/local/palmdev/sdk/include/Core/System/ErrorBase.h:239: 
  warning: possibly bad __callseq__ `trap #15; dc.w sysTrapErrLongJump'

/usr/local/palmdev/sdk/include/Core/System/ErrorBase.h:243: 
  warning: possibly bad __callseq__ `trap #15; dc.w sysTrapErrExceptionList'

...
-------- 8< -----------

The warning occurs for every function prototype in the SDK with 
an associated SYS_TRAP defined.  For example ErrSetJump is 
defined as:

  Int16 ErrSetJump(ErrJumpBuf buf) 
    __attribute__((__callseq__( "trap #" "15" "; dc.w "sysTrapErrSetJump")));   

in version 3.5 of the Palm SDK. But with version 3.1 of the SDK, 
ErrSetJump is defined as:

  Int ErrSetJump(ErrJumpBuf buf)
    __attribute__((systrap ( sysTrapErrSetJump ))) ;

Ok, something has changed, so I look in the patch file for GCC, 
named gcc-20000105.diff in the Prc-Tools-0.5.1b3.  The only place
I can see this warning being generated is from the file:

  gcc-2.95.2/gcc/config/m68k/m68k.c

within the function 'palmos_valid_machine_decl_attribute()'.
The relevent code follows:

-------- 8< -----------
+   else if (is_attribute_p ("callseq", attr))
+       {
+         tree prev;

...

+         /* JWM @@@ This is brutal test code */
+         {
+           char *fmt = TREE_STRING_POINTER (TREE_VALUE (args));
+           int warn = 0;
+           char *s;
+
+           for (s = fmt; (s = index (s, '#')) != NULL; s++) {
+             while (s[1] == '(')  s++;
+             if (s[1] && !isdigit (s[1]))  warn = 1;
+             }
+
+           for (s = fmt; (s = strstr (s, "dc.w ")) != NULL; s++) {
+             while (s[5] == '(')  s++;
+             if (s[5] && !isdigit (s[5]))  warn = 1;
+             }
+
+           if (warn)  warning ("possibly bad __callseq__ `%s'", fmt);
+         }
-------- 8< -----------

>From what I can see the variable 'warn' is set to 1 in the 'if' 
statement of the second 'for' loop.  IE: given the previous 
definition for ErrSetJump in SDK 3.5:

   fmt            = "trap #15; dc.w sysTrapErrSetJump"
   s              = "dc.w sysTrapErrSetJump"
   s[5]           = 's'   
   !isdigit(s[5]) = TRUE

Is there supposed to be some numerical prefix to the sysTrap...
enumeration?  Or does the code need to be changed?


ISSUE 2 - Undefined references
------------------------------

Dismissing the warnings: when the gcc command executes to create 
the multiapp file:

-------- 8< -----------
m68k-palmos-gcc -O2 -o multiapp multiapp.o multidef.o
/usr/local/m68k-palmos/bin/ld: warning: no memory region specified for section `bob'
multiapp.o(.text+0x2c):multiapp.c: undefined reference to `sysTrapWinDrawChars'
multiapp.o(.text+0x56):multiapp.c: undefined reference to `sysTrapEvtGetEvent'
multiapp.o(.text+0x5c):multiapp.c: undefined reference to `sysTrapSysHandleEvent'
multiapp.o(bob+0x28):multiapp.c: undefined reference to `sysTrapWinDrawChars'
collect2: ld returned 1 exit status
make: *** [multiapp] Error 1
-------- 8< -----------

As you can see I receive 'undefined reference' errors for all the Palm 
SDK functions I attempt to call.  Does this have something to do
with the ISSUE 1 - 'callseq' problems?


Unfortunately, I am not well versed in the inner-workings of GCC, or
John's work.  I am just interested in converting my personal travel
tracking program to use the new 3.5 SDK as well as take advantage of
the multisegmented code enhancements of the new prc-tools (adding
datebook integration will increase the size).

Thanks for any and all answers.  I'll apologize in advance for the
long lines...

-- 
Andy Vasquez
[EMAIL PROTECTED]

Reply via email to