Jack Jansen | 2 Oct 2007 17:16
Picon
Picon
Favicon

Alignment errors with -march=armv5te, iwmmxt

I'm still playing around with building ffmpeg with mingw32ce and then  
using it in a Visual Studio 2005 project.

Up until now I had compiled everything for the default armv4  
architecture, and things run fine both in the microsoft device  
emulator and in the actual device (HP iPaq with PXA270 XScale  
processor).

To speed things up I tried building with -march=armv5te, but I'm  
getting data alignment errors:

> Data Abort: Thread=92c237f0 Proc=90990c10 'AmbulantPlayer.exe'
> AKY=00080001 PC=00acae84(avformat-51.dll+0x0000ae84) RA=00acae1c 
> (avformat-51.dll+0x0000ae1c) BVA=2802ed14 FSR=00000003
> Unhandled exception at 0x00acae84 in AmbulantPlayer.exe:  
> 0x80000002: Datatype misalignment.

Retried with -march=iwmmxt, same result.

Debugging this is hell, because the MS debugger doesn't understands  
neither the cegcc stack frame nor the symbol table, so I'm off in  
never-never land.

Hence the question: has anyone else built for armv5te or xscale, with  
or without success?
--
Jack Jansen, <Jack.Jansen@...>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma  
Goldman

(Continue reading)

Jacek M. Holeczek | 4 Oct 2007 11:06
Picon
Favicon

ChangeDisplaySettingsEx missing?

Hi,
I am trying to play a bit with arm-wince-mingw32ce (0.50-cygwin).

I'd like to compile a piece of code which does "screen rotation".
It is based on the "Pocket PC Screen Rotation" example code:
	http://www.codeproject.com/ce/pocketscreenrotation.asp
and the "Rotating the Contents of the Screen" explanations:
	http://msdn2.microsoft.com/en-us/library/aa452713.aspx
The detailed explanations about ChangeDisplaySettingsEx can be found here:
	http://msdn2.microsoft.com/en-us/library/ms908108.aspx

When I try to compile the code, I get a message that the symbols related
to screen orientation are not defined: DMDO_0, DMDO_90, DMDO_180,
DMDO_270, DM_DISPLAYQUERYORIENTATION, DM_DISPLAYORIENTATION.

So, I am trying to define them myself:
---------------------------------------------------------------------
enum DMD
   {
      DMDO_0      = 0,
      DMDO_90     = 1,
      DMDO_180    = 2,
      DMDO_270    = 4
   };

enum DM_Fields
   {
      DM_DISPLAYORIENTATION = 0x00800000L,
      DM_DISPLAYQUERYORIENTATION =0x01000000L
   };
(Continue reading)

Danny Backx | 4 Oct 2007 20:44
Picon
Favicon

Re: ChangeDisplaySettingsEx missing?

On Thu, 2007-10-04 at 11:06 +0200, Jacek M. Holeczek wrote:
> When I try to compile the code, I get a message that the symbols related
> to screen orientation are not defined: DMDO_0, DMDO_90, DMDO_180,
> DMDO_270, DM_DISPLAYQUERYORIENTATION, DM_DISPLAYORIENTATION.

Indeed, we don't have all the macros we should have. Our include files
are inherited from other projects (e.g. MinGW). They're very good but
they tend to lack some CE specific stuff (CE is not their focus).

A patch for our include files would be very welcome :-)

> So, I am trying to define them myself:
> ---------------------------------------------------------------------
> enum DMD
>    {
>       DMDO_0      = 0,
>       DMDO_90     = 1,
>       DMDO_180    = 2,
>       DMDO_270    = 4
>    };
> 
> enum DM_Fields
>    {
>       DM_DISPLAYORIENTATION = 0x00800000L,
>       DM_DISPLAYQUERYORIENTATION =0x01000000L
>    };
> ---------------------------------------------------------------------
> Can anybody verify that it is correct? (I have also seen source code, in
> the Internet, in which people define, for example, DMDO_270=3, and/or
> DM_DISPLAYORIENTATION=0x00000080.)
(Continue reading)

Jacek M. Holeczek | 5 Oct 2007 19:39
Picon
Favicon

Re: ChangeDisplaySettingsEx missing?

Hi,
thanks for your explanations.

> For now you can try whether it helps to add -DNOGDI to your compile

Well, this does not seem to help.
Without "-DNOGDI", the code compiles fine, and I only get linker problem:
"undefined reference to `ChangeDisplaySettingsExW'".
As soon as I add "-DNOGDI", the compiler starts to complain about
undeclared identifiers DeviceMode and DEVMODE, and about implicit
declaration of function `ChangeDisplaySettingsEx' (it does not reach the
linker stage).

Any idea?

Best regards,
Thanks in advance,
Jacek.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Jacek M. Holeczek | 5 Oct 2007 19:45
Picon
Favicon

ShellExecuteExW missing?

Hi,
I've got another problem.

I am trying to play a bit with arm-wince-mingw32ce (0.50-cygwin).

I'd like to use ShellExecuteEx in my code.
The code compiles fine, but the linker complains "undefined reference to
`ShellExecuteExW'".

Any idea?

Thanks in advance,
Best regards,
Jacek.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Carsten Sørensen | 5 Oct 2007 23:28
Picon

Re: ShellExecuteExW missing?

Hi,
 
Like your other problem, it sounds like another one of those cases where WinCE doesn't define ShellExecuteExW but only ShellExecuteEx (with the same signature as ShellExecuteExW). You can verify this for instance by running "strings" on the right library-file.
 
The fix is to #ifdef the prototype in the header with _WIN32_WCE and declare the function as ShellExecuteEx instead of ShellExecuteExW + ShellExecuteExA with a #define ShellExecuteEx depending on UNICODE.
 
If that doesn't make a lot of sense right now, it probably will when you peek in the header ;) Oh, and please submit a patch if you get the header fixed, if that is indeed the problem.
 
 
Best regards,
Carsten Sorensen
 


On 05/10/2007, Jacek M. Holeczek <holeczek-AXCoTodweqdmR6Xm/wNWPw@public.gmane.org> wrote:
Hi,
I've got another problem.

I am trying to play a bit with arm-wince-mingw32ce (0.50-cygwin ).

I'd like to use ShellExecuteEx in my code.
The code compiles fine, but the linker complains "undefined reference to
`ShellExecuteExW'".

Any idea?

Thanks in advance,
Best regards,
Jacek.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@...
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Danny Backx | 6 Oct 2007 10:06
Picon
Favicon

Re: ChangeDisplaySettingsEx missing?

On Fri, 2007-10-05 at 19:39 +0200, Jacek M. Holeczek wrote:
> Hi,
> thanks for your explanations.
> 
> > For now you can try whether it helps to add -DNOGDI to your compile
> 
> Well, this does not seem to help.
> Without "-DNOGDI", the code compiles fine, and I only get linker problem:
> "undefined reference to `ChangeDisplaySettingsExW'".

As Carsten already pointed out, some of the functions have inconsistent
names, I forgot about that when I replied. Sorry. Turns out that both
ShellExecuteEx and ChangeDisplaySettingsEx are available on CE without
the "W".

If you want to know what "inconsistent API" means, have a look at this :
dannypc: {427} fgrep ExW coredll.def | wc -l
26
dannypc: {428} fgrep Ex coredll.def | fgrep -v ExW | wc -l
85

Oh well. Back to your problem.
> As soon as I add "-DNOGDI", the compiler starts to complain about
> undeclared identifiers DeviceMode and DEVMODE, and about implicit
> declaration of function `ChangeDisplaySettingsEx' (it does not reach the
> linker stage).
> 
> Any idea?

Yes, drop that. Try the patches below.

Another thing I neglected to mention: I hope you are defining macros
that tell the compiler which version of CE you're using ?

I always use something like
	-D_WIN32_WCE=400 -D_WIN32_IE=400

dannypc: {420} svn diff winuser.h shellapi.h
Index: winuser.h
===================================================================
--- winuser.h   (revision 1061)
+++ winuser.h   (working copy)
 <at>  <at>  -3390,12 +3390,16  <at>  <at> 
 WINUSERAPI LRESULT WINAPI
CallWindowProcW(WNDPROC,HWND,UINT,WPARAM,LPARAM);
 WINUSERAPI WORD WINAPI CascadeWindows(HWND,UINT,LPCRECT,UINT,const
HWND*);
 WINUSERAPI BOOL WINAPI ChangeClipboardChain(HWND,HWND);
+#ifndef _WIN32_WCE
 #ifndef NOGDI
 WINUSERAPI LONG WINAPI ChangeDisplaySettingsA(PDEVMODEA,DWORD);
 WINUSERAPI LONG WINAPI ChangeDisplaySettingsW(PDEVMODEW,DWORD);
 WINUSERAPI LONG WINAPI
ChangeDisplaySettingsExA(LPCSTR,LPDEVMODEA,HWND,DWORD,LPVOID);
 WINUSERAPI LONG WINAPI
ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
 #endif
+#else /* _WIN32_WCE */
+WINUSERAPI LONG WINAPI
ChangeDisplaySettingsEx(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
+#endif
 WINUSERAPI BOOL WINAPI ChangeMenuA(HMENU,UINT,LPCSTR,UINT,UINT);
 WINUSERAPI BOOL WINAPI ChangeMenuW(HMENU,UINT,LPCWSTR,UINT,UINT);
 WINUSERAPI LPSTR WINAPI CharLowerA(LPSTR);
Index: shellapi.h
===================================================================
--- shellapi.h  (revision 1061)
+++ shellapi.h  (working copy)
 <at>  <at>  -297,10 +297,10  <at>  <at> 
 BOOL WINAPI Shell_NotifyIconW(DWORD,PNOTIFYICONDATAW);
 int WINAPI ShellAboutA(HWND,LPCSTR,LPCSTR,HICON);
 int WINAPI ShellAboutW(HWND,LPCWSTR,LPCWSTR,HICON);
+#ifndef _WIN32_WCE
 HINSTANCE WINAPI ShellExecuteA(HWND,LPCSTR,LPCSTR,LPCSTR,LPCSTR,INT);
 HINSTANCE WINAPI
ShellExecuteW(HWND,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,INT);
 BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA);
-#ifndef _WIN32_WCE
 BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW);
 #else
 BOOL WINAPI ShellExecuteEx(LPSHELLEXECUTEINFOW);
dannypc: {421} 

--

-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@...
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Vitus Jensen | 5 Oct 2007 22:26
Picon
Picon

using thirdparty libs

Hej!

I'm trying to port a small testprogramm from embedded Visual C 4 to 
mingw32ce (cegcc-mingw32ce-0.50-1.i586.rpm).  It's text mode, 2 threads, 
some printf, some files, nothing fancy but ... it has to use 2 object 
libraries (3rd party) and a DLL (my own).

I'm able to compile and link this programm but when I call the 3rd party 
library an important call fails.  It's the only call with several 
parameters so I suspect different calling conventions.

Goes like this:

extern int libconfig(int hd, int subfct, void * parameter);

test()
{
      hd = libopen();
      res = libconfig(hd, 1, (void *)0815);
      res = libconfig(hd, 2, (void *)15);
      ...
      libclose(hd);
}

Result code indicates "invalid subfunction" :-(

The prototype shows no "__syscall" or the like, the object library works 
when used with eVC.  I've looked at the produced assembler code in the eVC 
debugger and it seems parameters are transfered via r0, r1 and r2.  Isn't 
this the same as in mingw32ce?  In my opinion all this indicates that the 
program should work.  It doesn't :-(

Any ideas from you?  I'm at my wit's end.
     Vitus

--

-- 
Vitus Jensen, Hannover, Germany, Earth, Universe (current)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Danny Backx | 6 Oct 2007 16:46
Picon
Favicon

Re: using thirdparty libs

On Fri, 2007-10-05 at 22:26 +0200, Vitus Jensen wrote:
> Hej!
> 
> I'm trying to port a small testprogramm from embedded Visual C 4 to 
> mingw32ce (cegcc-mingw32ce-0.50-1.i586.rpm).  It's text mode, 2 threads, 
> some printf, some files, nothing fancy but ... it has to use 2 object 
> libraries (3rd party) and a DLL (my own).
> 
> I'm able to compile and link this programm but when I call the 3rd party 
> library an important call fails.  It's the only call with several 
> parameters so I suspect different calling conventions.
> 
> Goes like this:
> 
> extern int libconfig(int hd, int subfct, void * parameter);
> 
> test()
> {
>       hd = libopen();
>       res = libconfig(hd, 1, (void *)0815);
>       res = libconfig(hd, 2, (void *)15);
>       ...
>       libclose(hd);
> }
> 
> Result code indicates "invalid subfunction" :-(
> 
> The prototype shows no "__syscall" or the like, the object library works 
> when used with eVC.  I've looked at the produced assembler code in the eVC 
> debugger and it seems parameters are transfered via r0, r1 and r2.  Isn't 
> this the same as in mingw32ce?  In my opinion all this indicates that the 
> program should work.  It doesn't :-(

This is probably a silly remark but "0815" is an invalid number. The GNU
C compiler will treat any number that starts with a 0 as octal. In
octal, there's no 8, so the compiler issues an error :
  tt.c:8:33: error: invalid digit "8" in octal constant

In case that that isn't your problem, I've attached a source and
assembler file generated by arm-wince-mingw32ce-gcc . Which assembler
instructions does eVC generate for this file ?

	Danny
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
Attachment (tt.c): text/x-csrc, 193 bytes
	.file	"tt.c"
	.text
	.align	0
	.global	test
	.def	test;	.scl	2;	.type	32;	.endef
test:
	 <at>  args = 0, pretend = 0, frame = 8
	 <at>  frame_needed = 1, uses_anonymous_args = 0
	mov	ip, sp
	stmfd	sp!, {fp, ip, lr, pc}
	sub	fp, ip, #4
	sub	sp, sp, #8
	bl	libopen
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r0, [fp, #-20]
	mov	r1, #1
	ldr	r2, .L3
	bl	libconfig
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r0, [fp, #-20]
	mov	r1, #2
	mov	r2, #15
	bl	libconfig
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r0, [fp, #-20]
	bl	libclose
	sub	sp, fp, #12
	ldmfd	sp, {fp, sp, pc}
.L4:
	.align	0
.L3:
	.word	815
	.def	libclose;	.scl	2;	.type	32;	.endef
	.def	libconfig;	.scl	2;	.type	32;	.endef
	.def	libopen;	.scl	2;	.type	32;	.endef
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@...
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Rodolfo Hansen | 6 Oct 2007 20:22
Picon
Gravatar

libtool & cegcc

Hi, Im trying to compile libjpeg (i'm thinking of working on porting enlightenment...)

when compiling with the -fPIC flag, I get this error:

./libtool-wrap --tag=CC --mode=compile arm-wince-cegcc-gcc -I/opt/cegcc/include  -I. -c ./jctrans.c

arm-wince-cegcc-gcc -I/opt/cegcc/include -I. -c ./jctrans.c  -fPIC -DPIC -o .libs/jctrans.o

/tmp/cczlnTAh.s: Assembler messages:
/tmp/cczlnTAh.s:921: Error: undefined symbol `_GLOBAL_OFFSET_TABLE_' in operation
/tmp/cczlnTAh.s:933: Error: attempt to get value of unresolved symbol `L0

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@...
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Gmane