Re: [dev] [scc] typeof is a gcc keyword

From: Marc Collin <marc.collin7_AT_gmail.com>
Date: Sun, 3 Jul 2016 11:49:26 -0300

>That's not really the cause. You'll have to use a c99 compiler to build
>scc. Maybe yours need an option like “-std=c99”.

I got the idea from here.
https://sourceforge.net/p/schillix-on/schillix-on/ci/6071f8422be450d2c3abd949005e0cb02960932c/
I changed config.mk. #CC = c99 to CC = cc. Otherwise I get c99:
Command not found

>make install

Thanks. Now I get other errors.
{standard input}: Assembler messages:
{standard input}:1: Error: no such instruction: `aseg'
{standard input}:2: Error: no such instruction: `extrn _stdin'
{standard input}:3: Error: no such instruction: `extrn _stdio'
{standard input}:4: Error: no such instruction: `extrn _stderr'
{standard input}:5: Error: no such instruction: `dseg'
{standard input}:7: Error: no such instruction: `db "hello"'
{standard input}:8: Error: no such instruction: `db 10'
{standard input}:9: Error: no such instruction: `db 0'

>Any compiler following the c99 standard will work.
But a binary compiled with gcc or clang will suck. No?
Even if scc source is suckless, won't the binary suck with we use
gcc/clang to compile it?

>You may want to test it with the qbe backend for now, as most of the
>work is done there atm.

Can you explain how I do that? Sorry for dumb questions.


On Sun, Jul 3, 2016 at 11:25 AM, Quentin Rameau <quinq_AT_fifth.space> wrote:
> Hey Marc,
>
>> Hey, I tried to compile scc with gcc and it failed because typeof is a
>> gcc keyword and scc has a function called typeof on cc1/expr.c
> That's not really the cause. You'll have to use a c99 compiler to build
> scc. Maybe yours need an option like “-std=c99”.
>
>> Then I got scc to compile.
> \o/
>
>> But this leaves me with the question on how to use scc?
>> I got a /bin directory with cc1, cc2 and scc.
>> ./scc hello.c gives errors.
>> scc: execvp /home/marcc/libexec/scc/cc1: No such file or directory
>> scc: execvp /home/marcc/libexec/scc/cc2: No such file or directory
> make install
>
>> Then I thought maybe the Makefile failed to create correct
>> directories, so I did mkdir ~/libexec && mkdir ~/libexec/scc && mv
>> ~/scc/bin/* ~/libexec/scc
>> This worked, now scc could find the directory and bin files it needed.
>> But I got another error now.
>> /home/marcc/hello.c:1: error: included file 'stdio.h' not found
>> /home/marcc/hello.c:6: error: 'printf' undeclared
>> /home/marcc/hello.c:6: error: function or function pointer expected
> scc -I where/your/c/headers/files/are
> (although scc isn't necessarily able to parse them atm).
>
>> Then I though, maybe I can install scc on the system and everything
>> will work. No!
>> "sudo make clean install" creates /root/scc which isn't usual.
> Have a look at config.mk. By default it uses PREFIX=$HOME. So if you
> want to install scc elsewhere, rebuild it setting the PREFIX to
> elsewhere.
>
>> How can I get it right?
> Reading the code.
>
>> Also, this got me thinking.
>> scc will have to be compiled the first time with another compiler.
> Yes.
>
>> Which one should we use? Compiling scc with a non-suckless compiler is
>> bad, but is there a work-around?
> Any compiler following the c99 standard will work.
>
>> Well, that was my experience after playing with scc for a few minutes.
> You may want to test it with the qbe backend for now, as most of the
> work is done there atm.
>
> Thanks!
>
Received on Sun Jul 03 2016 - 16:49:26 CEST

This archive was generated by hypermail 2.3.0 : Sun Jul 03 2016 - 17:00:12 CEST