Issue Details (XML | Word | Printable)

Key: PCC-389
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Anders Magnusson
Reporter: Roland Mainz
Votes: 2
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
pcc

pcc fails to compile ksh93 (ast-ksh.2012-02-29)

Created: 04/Apr/12 08:59 PM   Updated: 29/Jul/12 07:46 PM
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. Text File buildlog.log (627 kB)

Environment: Suse Linux 12.1/AMD64


 Description  « Hide
pcc fails to compile ksh93 (ast-ksh.2012-02-29)

Steps to reproduce:
1. Fetch ksh93 sources
wget --http-user="I accept www.opensource.org/licenses/eclipse" --http-passwd="." 'http://www2.research.att.com/~gsf/download/tgz/ast-ksh.2012-02-29.tgz'
wget --http-user="I accept www.opensource.org/licenses/eclipse" --http-passwd="." 'http://www2.research.att.com/~gsf/download/tgz/INIT.2012-02-29.tgz'
2. Unpack
3. Compile code with:
$ (CC='/usr/bin/pcc -D__NO_INLINE__=1' ./bin/package make) 2>&1 | tee -a buildlog.log
(-D__NO_INLINE__=1' is set to avoid trouble with gcc-specific math inlines on Linux)

Result:
Several failures, with errors like these ones:
/home/test001/work/ast_ksh_20120229/build_pcc/src/cmd/ksh93/sh/arith.c:150: error: out of macro space!
/home/test001/work/ast_ksh_20120229/build_pcc/src/cmd/ksh93/edit/completion.c:128: error: Too much defining

I attached "buildlog.log" ... search for "exit code" to find locations where the errors occured.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson made changes - 05/Apr/12 05:00 PM
Field Original Value New Value
Assignee Anders Magnusson [ ragge ]
Anders Magnusson added a comment - 05/Apr/12 05:10 PM
Which pcc version are you using? I'm asking because the math-specific stuff that I assume failed for you (the use of : for designated initializers) were added to pcc long time ago.

Roland Mainz added a comment - 05/Apr/12 08:09 PM
The pcc version is:
$ pcc --version
pcc 1.0.0.RELEASE 20110221 for x86_64-suse-linux-gnu

Based on the date I assume this is... old (if "yes" the blame is likely on SuSE's side... ;-/ ) ?

Roland Mainz added a comment - 05/Apr/12 11:30 PM
> math-specific stuff that I assume failed for you

Erm... AFAIK the math-specific stuff isn't failing for me... I worked around that trouble with -D__NO_INLINE__=1 ... the problem are the errors which look like compiler-internal issues, e.g. "sh/arith.c:150: error: out of macro space! ", "edit/completion.c:128: error: Too much defining" etc.

Can you just try to follow the "Steps to reproduce" on your side on Linux and see where/if the AST/ksh93 build is failing for you ?

Anders Magnusson added a comment - 06/Apr/12 11:05 AM
Yes, I tried it and cpp did run out of macro space for me also. I assume that it triggers some memory leak code path in cpp.
I'll see if I have time to look at it now in the easter weekend.

Roland Mainz added a comment - 10/Apr/12 05:36 PM
Is there a way to use an alternative "cpp" (BTW: Which "cpp" is used ? Does "pcc" supply one ?) ?

Anders Magnusson added a comment - 10/Apr/12 06:03 PM
pcc uses its own cpp, which is basically the cpp that has been around ~forever.
I have a pretty good idea about what is failing, but unfortunately I got a really bad cold and has been into bed most of easter weekend, hence no pcc hacking :-/
You could try to use gcc with the -E flag and give the output to a .i file, and then compile the .i file with pcc. It might work.

Roland Mainz added a comment - 04/May/12 12:59 AM
Any news on the issue ?

Anders Magnusson added a comment - 05/May/12 05:48 PM
cpp bails on

#define i1(w) i2(w)
#define i2(x) i1(x)
i1(c)

which it shouldn't. Need to find out why.

Irek Szczesniak added a comment - 21/May/12 10:21 AM
Is there an easy workaround? Does using the HEAD of pcc-dev fix this?

Anders Magnusson added a comment - 21/May/12 06:08 PM
Unfortunately no, I just haven't had time to work with it.

Anders Magnusson made changes - 28/Jul/12 10:26 PM
Component/s C preprocessor [ 10021 ]
Anders Magnusson added a comment - 29/Jul/12 07:30 PM
Fixed now. I compiled ksh93 based on the instructions given and it at least did start.

Anders Magnusson made changes - 29/Jul/12 07:30 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Roland Mainz added a comment - 29/Jul/12 07:46 PM
How can I checkout&&build pcc to verify the fix ?