<< Back to previous view

[PCC-389] pcc fails to compile ksh93 (ast-ksh.2012-02-29) Created: 04/Apr/12  Updated: 29/Jul/12

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

Type: Bug Priority: Critical
Reporter: Roland Mainz Assignee: Anders Magnusson
Resolution: Fixed Votes: 2
Environment: Suse Linux 12.1/AMD64

File Attachments: Text File buildlog.log    

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)

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.

Comment by Anders Magnusson [ 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.
Comment by Roland Mainz [ 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... ;-/ ) ?
Comment by Roland Mainz [ 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 ?
Comment by Anders Magnusson [ 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.
Comment by Roland Mainz [ 10/Apr/12 05:36 PM ]
Is there a way to use an alternative "cpp" (BTW: Which "cpp" is used ? Does "pcc" supply one ?) ?
Comment by Anders Magnusson [ 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.
Comment by Roland Mainz [ 04/May/12 12:59 AM ]
Any news on the issue ?
Comment by Anders Magnusson [ 05/May/12 05:48 PM ]
cpp bails on

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

which it shouldn't. Need to find out why.
Comment by Irek Szczesniak [ 21/May/12 10:21 AM ]
Is there an easy workaround? Does using the HEAD of pcc-dev fix this?
Comment by Anders Magnusson [ 21/May/12 06:08 PM ]
Unfortunately no, I just haven't had time to work with it.
Comment by Anders Magnusson [ 29/Jul/12 07:30 PM ]
Fixed now. I compiled ksh93 based on the instructions given and it at least did start.
Comment by Roland Mainz [ 29/Jul/12 07:46 PM ]
How can I checkout&&build pcc to verify the fix ?
Generated at Sun Apr 19 11:27:24 CEST 2015 using JIRA Enterprise Edition, Version: 3.13.1-#333.