<< Back to previous view

[PCC-293] Lack of pragma support causing build failures (Cross-compiler Win32) Created: 03/Apr/11  Updated: 25/May/14

Status: Closed
Project: pcc
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Richard Spencer Assignee: Anders Magnusson
Resolution: Incomplete Votes: 0
Environment: Linux Fedora 11/binutils 2.21/--target=i386-pe

File Attachments: Text File hellowin.c    

 Description   
I've raised this as a new issue rather than requesting reopening of PCC-276 since this issue highlights a new area of pcc being a problem. The additions to the wiki page at http://pcc.ludd.ltu.se/cross-compiler/ may assist in relation to this issue.

The cross-compiler executable '/usr/local/bin/i386-pe-pcc' fails to build pcc-libs at file ssp.c with Assembler error: unknown pseudo-op: `.previous'. The reason I hesitate to call this a backend issue is because of the lines:

#define __constructor _Pragma("init")
#define __destructor _Pragma("fini")

which seem to cause the problem. However I'm not qualified to judge that.

With the mingw32 and w32api packages it is the header files which fail to compile with pcc saying "bad argument to #pragma" many times before giving up.

I attach a .c file which currently fails to compile but which may well work if pcc can be made to support the pragma's in the support libraries. (It is a very slightly altered version of http://www.cprogramming.com/tutorial/opengl_first_windows_app.html. Compile with "i386-pe-pcc -o /tmp/hellowin.exe /tmp/hellowin.c -lgdi32".)



 Comments   
Comment by Richard Spencer [ 08/Dec/11 06:44 PM ]
Same issue with latest win32 native port pcc-20111206-win32.exe from http://pcc.ludd.ltu.se/ftp/pub/win32/ and above test file.

"bad argument to #pragma" in winnt.h, pshpack4.h, poppack.h, wingdi.h and winuser.h

Is pragma support planned? If not then maybe list this one as a known bug and close this report. Thanks.
Comment by Gregory McGarry [ 11/Dec/11 11:05 PM ]
#pragma pack() is not supported at the moment.

But I have an idea how it may be possible to add support for it.
Comment by Anders Magnusson [ 02/May/14 12:32 PM ]
The first bug above seems to be the assembler; not pcc.
The second addressed seems to be lack of pragma pack(), which is supported these days.
Are there more issues involved or can the ticket be closed?
Comment by Anders Magnusson [ 25/May/14 05:35 AM ]
No response, file a new ticket if still a problem.
Generated at Wed Jul 30 21:13:55 CEST 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.