Skip to content

Failure to build hid-fuzzer #595

@scheperdion

Description

@scheperdion

I am experimenting with different fuzzing research using LKL so far so good. During one of these experiments I experienced a linker error related to KASAN/ASAN and wanted to retrace my steps and see what I did wrong. But I ended up with this new linker error.

These are the commands I executed on my Ubuntu 24.04.2 LTS x86 host:

git clone https://github.com/lkl/linux.git
cd linux
make -C tools/lkl LKL_FUZZING=1 -j12 fuzzers

The following linker error is an excerpt of the full compiler output, liblkl builds succesfully as far as I can tell.

  LD      /home/user/projects/lkl/linux/tools/lkl/lib/liblkl-in.o
  AR      /home/user/projects/lkl/linux/tools/lkl/liblkl.a
  LINK    /home/user/projects/lkl/linux/tools/lkl/fuzzers/hid/hid-fuzzer
ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'system_state'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by main.c:125 (/home/user/projects/lkl/linux/init/main.c:125)
>>>               lkl.o:(.export_symbol+0x8) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'static_key_initialized'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by main.c:165 (/home/user/projects/lkl/linux/init/main.c:165)
>>>               lkl.o:(.export_symbol+0x18) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'reset_devices'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by main.c:177 (/home/user/projects/lkl/linux/init/main.c:177)
>>>               lkl.o:(.export_symbol+0x28) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'loops_per_jiffy'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by main.c:225 (/home/user/projects/lkl/linux/init/main.c:225)
>>>               lkl.o:(.export_symbol+0x38) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'init_uts_ns'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by version-timestamp.c:10 (init/version-timestamp.c:10)
>>>               lkl.o:(.export_symbol+0x48) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'init_task'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by init_task.c:64 (/home/user/projects/lkl/linux/init/init_task.c:64)
>>>               lkl.o:(.export_symbol+0x58) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'memcpy'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by xarray.c
>>>               lkl.o:(.export_symbol+0x68) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'memset'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by xarray.c
>>>               lkl.o:(.export_symbol+0x78) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'memmove'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by xarray.c
>>>               lkl.o:(.export_symbol+0x88) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'free_task'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by xarray.c
>>>               lkl.o:(.export_symbol+0x98) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol '__mmdrop'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by xarray.c
>>>               lkl.o:(.export_symbol+0xA8) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol '__put_task_struct'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by xarray.c
>>>               lkl.o:(.export_symbol+0xB8) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol '__put_task_struct_rcu_cb'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by xarray.c
>>>               lkl.o:(.export_symbol+0xC8) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'mmput'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by xarray.c
>>>               lkl.o:(.export_symbol+0xD8) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'get_task_mm'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by xarray.c
>>>               lkl.o:(.export_symbol+0xE8) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'panic_timeout'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by panic.c:66 (/home/user/projects/lkl/linux/kernel/panic.c:66)
>>>               lkl.o:(.export_symbol+0xF8) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'panic_notifier_list'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by panic.c:78 (/home/user/projects/lkl/linux/kernel/panic.c:78)
>>>               lkl.o:(.export_symbol+0x108) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'panic_blink'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by panic.c:138 (/home/user/projects/lkl/linux/kernel/panic.c:138)
>>>               lkl.o:(.export_symbol+0x118) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'nmi_panic'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by xarray.c
>>>               lkl.o:(.export_symbol+0x128) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: relocation R_X86_64_64 cannot be used against symbol 'panic'; recompile with -fPIC
>>> defined in /home/user/projects/lkl/linux/tools/lkl/liblkl.a(lkl.o)
>>> referenced by xarray.c
>>>               lkl.o:(.export_symbol+0x138) in archive /home/user/projects/lkl/linux/tools/lkl/liblkl.a

ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I can not remember that I have seen this one before while experimenting. Does someone here know where this is coming from? I am curious if this is reproducible for anyone or maybe obvious for someone that either my setup is incorrect or that that there is something missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions