ssrg-vt / ebpf-fuzzer

A fuzzer for Linux eBPF module; build on top of LKL
Other
1 stars 2 forks source link

gcc unrecognized command line option ‘-fprofile-instr-generate’ #2

Open xjtuwxg opened 1 year ago

xjtuwxg commented 1 year ago

I tried to build ebpf-fuzzer on Ubuntu 20.04 and Ubuntu 22.04 (cloudlab m510 nodes), but both have errors on unrecognized options -fprofile-instr-generate and -fcoverage-mapping:

xgwang@x86-m510-ubuntu2004:~/ebpf-fuzzer  dev ✔         
▶ make -C tools/lkl ARCH=lkl  
make: Entering directory '/users/xgwang/ebpf-fuzzer/tools/lkl'
scripts/Makefile.asm-generic:25: redundant generic-y found in arch/lkl/include/uapi/asm/Kbuild: siginfo.h
scripts/Makefile.asm-generic:25: redundant generic-y found in arch/lkl/include/asm/Kbuild: atomic.h barrier.h bitops.h bug.h bugs.h cacheflush.h checksum.h compat.h current.h delay.h device.h div64.h emergency-restart.h exec.h ftrace.h futex.h hardirq.h hw_irq.h irq_regs.h irq_work.h kdebug.h kmap_types.h kprobes.h linkage.h local.h mmiowb.h mmu.h mmu_context.h module.h percpu.h pgalloc.h preempt.h sections.h serial.h simd.h switch_to.h timex.h tlbflush.h topology.h trace_clock.h uaccess.h unaligned.h vga.h word-at-a-time.h
  CALL    scripts/checksyscalls.sh
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
  CALL    scripts/atomic/check-atomics.sh
  CHK     include/generated/compile.h
  CC      kernel/bpf/verifier.o
gcc: error: unrecognized command line option ‘-fprofile-instr-generate’; did you mean ‘-fprofile-generate’?
gcc: error: unrecognized command line option ‘-fcoverage-mapping’
make[3]: *** [scripts/Makefile.build:279: kernel/bpf/verifier.o] Error 1
make[2]: *** [scripts/Makefile.build:496: kernel/bpf] Error 2
make[1]: *** [Makefile:1808: kernel] Error 2

GCC versions:

xgwang@x86-m510-ubuntu2004:~/ebpf-fuzzer  dev ✔          
▶ gcc --version                                                              
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

xgwang@x86-m510:~/ebpf-fuzzer  dev ✔    
▶ gcc --version  
gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0

Not sure whether this is related to the code coverage part.

husainnk commented 1 year ago

The flags-fprofile-instr-generate and -fcoverage-mapping are for code coverage instrumentation with clang compiler. For now I removed them from makefile to avoid build errors.