You are not logged in.

#1 2011-06-17 14:59:01

mghis
Member
Registered: 2010-12-08
Posts: 27

PCC (Portable C Compiler) SegV

Hi,

I'm trying to use the PCC, the Portable C Compiler.  I'm studying how does a compiler work, and I prefer
to use PCC because it's quick and simple.  GCC, the GNU compiler, is more optimized but more complex.

I installed the ''pcc'' packet from AUR, and it seems to compile everything.  But all binaries from PCC
awfully crash and dumps a core for segmentation fault just after they start.  I tried with a simple
program (the classic, trivial ''Hello World'').

This is the debug I tried:

$ pcc -g main.c
$ gdb a.out
Reading symbols from /tmp/a.out...done.
(gdb) run
Starting program: /tmp/a.out 

Program received signal SIGSEGV, Segmentation fault.
0x00000001 in ?? ()
(gdb) backtrace
#0  0x00000001 in ?? ()
#1  0x08048341 in __do_global_ctors_aux ()
#2  0x0804827c in _init ()
#3  0x080481e1 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

Can someone help?

Thanks!

Last edited by mghis (2011-06-17 14:59:38)

Offline

#2 2011-06-17 15:30:56

Guff
Member
Registered: 2009-09-30
Posts: 158
Website

Re: PCC (Portable C Compiler) SegV

Well, I can confirm it's not just you. "Hello world" segfaults for me, as well, but works fine when compiled with GCC or TCC.

I'd look into it, but PCC's site is currently down. Bummer.

Last edited by Guff (2011-06-17 15:31:43)

Offline

#3 2011-06-18 14:23:46

mghis
Member
Registered: 2010-12-08
Posts: 27

Re: PCC (Portable C Compiler) SegV

Now it's up.  I filed a bug.  Thanks for any help!

   --mghis

Offline

Board footer

Powered by FluxBB