[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 again John. I build it again, now it works. :)

First time when ran "./configure" I indeed did not have m4. Then I installed m4 and built it, but NOT running "./configure" before issuing the "make" command. Do you think that's why it got built wrong?

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

 

On Fri, Oct 2, 2015 at 4:17 PM, John Regehr <regehr@cs.utah.edu> wrote:
I think you will find, if you look in your safe_math.h, that it contains nothing.  It is supposed to contain all those functions that your linker is complaining about.  Perhaps you do not have m4 installed on your system, or it didn't work for whatever reason.  Our configure script checks for it, I'll note.

Anyway your build of Csmith is all wrong.

John




On 10/2/15 11:12 PM, Shafiul Azam wrote:
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
Web: http://shafiul.github.io



On Fri, Oct 2, 2015 at 3:54 PM, John Regehr <regehr@cs.utah.edu
<mailto: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

    John


    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>
        <mailto:chenyang@cs.utah.edu <mailto:chenyang@cs.utah.edu>>> wrote:

             Hi Shafiul,

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

             $ pwd
             /home/yangchen/Programs/csmith/src
             $ ./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:

                 Hi,

                 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
                 `safe_rshift_func_uint16_t_u_s'
                 test.c:(.text+0x22d): undefined reference to
                 `safe_unary_minus_func_int16_t_s'
                 test.c:(.text+0x2ee): undefined reference to
                 `safe_rshift_func_uint16_t_u_u'
                 /tmp/ccksSLp6.o: In function `func_9':
                 test.c:(.text+0x43f): undefined reference to
                 `safe_add_func_int32_t_s_s'
                 test.c:(.text+0x45e): undefined reference to
                 `safe_mul_func_int16_t_s_s'
                 test.c:(.text+0x4b8): undefined reference to
                 `safe_rshift_func_uint16_t_u_u'

                 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
                 4.8.4.

                 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
                 similar.)

                 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.

                 --

                 Shafiul




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