<< Back to previous view

[PCC-88] pcc is still unable to detect freetype2 Created: 22/Aug/09  Updated: 04/May/14

Status: Resolved
Project: pcc
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Detlef Riekenberg Assignee: Anders Magnusson
Resolution: Fixed Votes: 0
Environment: i386-linux

File Attachments: Text File _diff_define_max.txt     Text File _diff_extend_limits.txt     File ft2.c    

 Description   
This is an update of: http://pcc.ludd.ltu.se/jira/browse/PCC-76

A configure script still failed to detect freetype2, when using pcc.
Attached is an updated testcase.

With the spaces (one to lots of) before #include, pcc bail out with:

_scrap/ft2$ pcc -I/usr/include/freetype2 ft2.c -c -o ft2_pcc.o
ft2.c, line 16: syntax error

There are 2 Problems here.
1. pcc failed to compile that code.
    (The standard might say, that the "#" is expected to be in the first column,
    but the attached code works with gcc and tcc)

2. The failure message say "line 16", while the source has only 5 lines

--
By by ... Detlef


 Comments   
Comment by Detlef Riekenberg [ 23/Aug/09 06:10 PM ]
A lot more header checks are affected by this bug.
Example from: diff -u bin_gcc/_configure.txt bin_pcc/_configure.txt

-checking for sys/mount.h... yes
-checking for sys/statfs.h... yes
-checking for sys/sysctl.h... yes
-checking for sys/user.h... yes
-checking for sys/vfs.h... yes
-checking for netinet/ip.h... yes
-checking for net/if.h... yes
-checking for net/if_arp.h... yes
+checking for sys/mount.h... no
+checking for sys/statfs.h... no
+checking for sys/sysctl.h... no
+checking for sys/user.h... no
+checking for sys/vfs.h... no
+checking for netinet/ip.h... no
+checking for net/if.h... no
+checking for net/if_arp.h... no

More locations exists, but they are striped.

--
By by ... Detlef

Comment by Detlef Riekenberg [ 25/Aug/09 12:18 PM ]
This is a cpp regression!
(How can the topic be updated?)

Freetype2 and the above headers where detected with the old cpp

I added some logging to pushfile(name) and found out, that fastscan() returned from the included file
before the "syntax error" came up.

--
By by ... Detlef


Comment by Detlef Riekenberg [ 13/Jun/10 04:54 PM ]
The example still fail to compile with pcc, but the message is different:

_scrap/ft2$ pcc -I/usr/include/freetype2 ft2.c -c -o ft2_pcc.o
/usr/include/freetype2/freetype/config/ftconfig.h:103: error: "Unsupported size of `int' type!"

freetype need defines for CHAR_BIT, UINT_MAX and ULONG_MAX, but limits.h from glibc
skip the defines and use the compiler provided limits (that is missing in libpcc_limits.h)

Extending cc/cc/cc.c to export __CHAR_BIT__, __INT_MAX__ and __LONG_MAX__
( http://pcc.ludd.ltu.se/jira/secure/attachment/10106/_diff_define_max.txt )
together with extending libpcc_limits.h to use these values to export
CHAR_BIT, UINT_MAX and ULONG_MAX
( http://pcc.ludd.ltu.se/jira/secure/attachment/10108/_diff_extend_limits.txt )
let pcc compile this example.

The attached Patches fixes these for i386, but including macdefs.h is not nice.
We get the needed defines (storage size and the MAX_* values) but the rest of macdefs.h
might have unwanted effects.
MULTITARGET was also not tested

--
By by ... Detlef
Comment by Detlef Riekenberg [ 14/Jun/10 01:09 PM ]
Updated Patch:
Add also INT_MIN and LONG_MIN (needed by WIne)

--
By by ... Detlef
Comment by Anders Magnusson [ 04/May/14 03:04 PM ]
As far as I can see all these bugs are fixed now.
Generated at Wed Oct 01 20:21:24 CEST 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.