decaf-project / DECAF

DECAF (short for Dynamic Executable Code Analysis Framework) is a binary analysis platform based on QEMU. This is also the home of the DroidScope dynamic Android malware analysis platform. DroidScope is now an extension to DECAF.
GNU General Public License v3.0
803 stars 168 forks source link

Compilation error on Ubuntu #80

Open johnfxgalea opened 4 years ago

johnfxgalea commented 4 years ago

I'm trying to compile DECAF on my i686 Ubuntu 14.04 machine, and am facing some compiler issues.

In particular, I am getting the following error:

In file included from DECAF/decaf/softmmu_template.h:398:0,
                 from DECAF/decaf/target-i386/op_helper.c:5002:
DECAF/decaf/softmmu_taint_template.h: In function ‘taint_slow_stl_mmu’:
DECAF/decaf/softmmu_taint_template.h:469:13: warning: passing argument 1 of ‘__taint_stl_raw’ makes pointer from integer without a cast [enabled by default]
             glue(glue(__taint_st, SUFFIX), _raw)((unsigned long)(addr+addend),addr);
             ^
In file included from DECAF/decaf/target-i386/../shared/tainting/taintcheck_opt.h:23:0,
                 from DECAF/decaf/target-i386/op_helper.c:31:
DECAF/decaf/target-i386/../shared/tainting/taint_memory.h:114:14: note: expected ‘void *’ but argument is of type ‘long unsigned int’
 void REGPARM __taint_stl_raw(void * p, gva_t vaddr);
              ^
In file included from DECAF/decaf/softmmu_template.h:398:0,
                 from DECAF/decaf/target-i386/op_helper.c:5005:
DECAF/decaf/softmmu_taint_template.h: In function ‘__taint_ldq_mmu’:
DECAF/decaf/softmmu_taint_template.h:143:13: warning: passing argument 1 of ‘__taint_ldq_raw’ makes pointer from integer without a cast [enabled by default]
             glue(glue(__taint_ld, SUFFIX), _raw)((unsigned long)(addr+addend),addr);
             ^
In file included from DECAF/decaf/target-i386/../shared/tainting/taintcheck_opt.h:23:0,
                 from DECAF/decaf/target-i386/op_helper.c:31:
DECAF/decaf/target-i386/../shared/tainting/taint_memory.h:106:14: note: expected ‘void *’ but argument is of type ‘long unsigned int’
 void REGPARM __taint_ldq_raw(void * p, gva_t vaddr);
              ^
In file included from DECAF/decaf/softmmu_template.h:398:0,
                 from DECAF/decaf/target-i386/op_helper.c:5005:
DECAF/decaf/softmmu_taint_template.h: In function ‘taint_slow_ldq_mmu’:
DECAF/decaf/softmmu_taint_template.h:235:13: warning: passing argument 1 of ‘__taint_ldq_raw’ makes pointer from integer without a cast [enabled by default]
             glue(glue(__taint_ld, SUFFIX), _raw)((unsigned long)(addr+addend),addr);
             ^
In file included from DECAF/decaf/target-i386/../shared/tainting/taintcheck_opt.h:23:0,
                 from DECAF/decaf/target-i386/op_helper.c:31:
DECAF/decaf/target-i386/../shared/tainting/taint_memory.h:106:14: note: expected ‘void *’ but argument is of type ‘long unsigned int’
 void REGPARM __taint_ldq_raw(void * p, gva_t vaddr);
              ^
In file included from DECAF/decaf/softmmu_template.h:398:0,
                 from DECAF/decaf/target-i386/op_helper.c:5005:
DECAF/decaf/softmmu_taint_template.h: In function ‘__taint_stq_mmu’:
DECAF/decaf/softmmu_taint_template.h:382:13: warning: passing argument 1 of ‘__taint_stq_raw’ makes pointer from integer without a cast [enabled by default]
             glue(glue(__taint_st, SUFFIX), _raw)((unsigned long)(addr+addend),addr);
             ^
In file included from DECAF/decaf/target-i386/../shared/tainting/taintcheck_opt.h:23:0,
                 from DECAF/decaf/target-i386/op_helper.c:31:
DECAF/decaf/target-i386/../shared/tainting/taint_memory.h:115:14: note: expected ‘void *’ but argument is of type ‘long unsigned int’
 void REGPARM __taint_stq_raw(void * p, gva_t vaddr);
              ^
In file included from DECAF/decaf/softmmu_template.h:398:0,
                 from DECAF/decaf/target-i386/op_helper.c:5005:
DECAF/decaf/softmmu_taint_template.h: In function ‘taint_slow_stq_mmu’:
DECAF/decaf/softmmu_taint_template.h:469:13: warning: passing argument 1 of ‘__taint_stq_raw’ makes pointer from integer without a cast [enabled by default]
             glue(glue(__taint_st, SUFFIX), _raw)((unsigned long)(addr+addend),addr);
             ^
In file included from DECAF/decaf/target-i386/../shared/tainting/taintcheck_opt.h:23:0,
                 from DECAF/decaf/target-i386/op_helper.c:31:
DECAF/decaf/target-i386/../shared/tainting/taint_memory.h:115:14: note: expected ‘void *’ but argument is of type ‘long unsigned int’
 void REGPARM __taint_stq_raw(void * p, gva_t vaddr);
              ^
DECAF/decaf/target-i386/op_helper.c: In function ‘helper_flds_FT0’:
DECAF/decaf/target-i386/op_helper.c:3648:6: error: frame pointer required, but reserved
 void helper_flds_FT0(uint32_t val)
      ^
In file included from DECAF/decaf/target-i386/op_helper.c:22:0:
DECAF/decaf/dyngen-exec.h:64:20: note: for ‘env’
 register CPUState *env asm(AREG0);

It seems like this issue has been encountered before: https://groups.google.com/forum/#!msg/decaf-platform-discuss/eFYLlRxaOGg/hv2_2Y6tJaUJ

Finally, my configure command is as follows:

./configure --enable-tcg-taint --target-list=i386-softmmu

Can anybody help me resolve the issue please?

johnfxgalea commented 4 years ago

I switched to a 64-bit host and it compiled albeit with some warnings. Given the errors above, I think there is code that is 64-bit specific which therefore yields errors on 32-bit hosts.

enlighten5 commented 4 years ago

Hi, I think you are right. I noticed that this issue is only associated with 32-bit systems and compilers. It's most likely a bug in the compiler (specifically gcc-4.8 or newer). See this report for more information: https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg428450.html I do not have a fix for this currently, but FYI, I tried gcc-4.7 on a 32-bit system and it works.

johnfxgalea commented 4 years ago

Thanks for the info!