[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [csmith-dev] Generated code does not compile: undefined reference to `safe_rshift_func_uint16_t_u_s'

Thanks John. Please find the preprocessed version here: http://pastebin.com/KzL6bNWm

Shafiul Azam Chowdhury
PhD Student and Graduate Research Assistant
The University of Texas at Arlington


On Fri, Oct 2, 2015 at 3:54 PM, John Regehr <regehr@cs.utah.edu> wrote:
Hi Shafiul,

Something basic is going wrong.  We cannot track it down using what you have told us so far.  One thing you could do is provide us with a preprocessed version of your file.  You can get that for example like this:

  gcc -I${CSMITH_PATH}/runtime test.c -E > preprocessed.txt


On 10/2/15 10:47 PM, Shafiul Azam wrote:
Hi Yang,

Thanks. I did indeed include the runtime. I used this command to
compile: gcc -I${CSMITH_PATH}/runtime test.c -o test;

Any idea why this still fails?

You can see the complete output here http://pastebin.com/ie0CqmDM

Shafiul Azam Chowdhury
PhD Student and Graduate Research Assistant
The University of Texas at Arlington
Web: http://shafiul.github.io

On Fri, Oct 2, 2015 at 3:40 PM, Yang Chen <chenyang@cs.utah.edu
<mailto:chenyang@cs.utah.edu>> wrote:

    Hi Shafiul,

    You may need to include Csmith's runtime path, e.g.,

    $ pwd
    $ ./csmith > foo.c
    $ gcc -I ../runtime foo.c > /dev/null 2>&1
    $ ./a.out
    checksum = DAB3BE95

    - Yang

    On 2015-10-02 08:24, Shafiul Azam wrote:


        I'm new to csmith (2.2.0) and tried generating code and
        compiling, but
        I'm getting lots of these errors:

        test.c:(.text+0x221): undefined reference to
        test.c:(.text+0x22d): undefined reference to
        test.c:(.text+0x2ee): undefined reference to
        /tmp/ccksSLp6.o: In function `func_9':
        test.c:(.text+0x43f): undefined reference to
        test.c:(.text+0x45e): undefined reference to
        test.c:(.text+0x4b8): undefined reference to

        These definitions were indeed missing in the generated code. I'm
        guessing that I'm missing some library. I'm using Ubuntu 14.04
        and gcc

        Command I used: csmith --no-arrays --no-bitfields --no-checksum
        --no-consts --no-longlong --no-int8 --no-uint8 --max-block-depth 2
        --no-structs --no-unions --no-volatiles --no-const-pointers > test.c

        (I tried without passing any options to csmith but the result is

        Generated C Code: http://pastebin.com/1uJ7Bsdy [1]

        Complete Output: http://pastebin.com/ie0CqmDM [2]

        I might be doing something stupid and I'm sorry for this post,
        but any
        help will be highly appreciated.



        [1] http://pastebin.com/1uJ7Bsdy
        [2] http://pastebin.com/ie0CqmDM