Skip to content
This repository was archived by the owner on Apr 13, 2019. It is now read-only.
This repository was archived by the owner on Apr 13, 2019. It is now read-only.

linker issue undefined reference to __lshrti3 #136

@wbx-github

Description

@wbx-github

Hi,

I am trying to compile Linux 4.15 branch and targeting Qemu. But the linking step fails with:

  • /Users/wbrodkorb/openadk/toolchain_qemu-riscv64_glibc/usr/bin/riscv64-openadk-linux-gnu-ld -melf64lriscv --build-id -o vmlinux -T ./arch/riscv/kernel/vmlinux.lds --whole-archive built-in.o --no-whole-archive --start-group lib/lib.a arch/riscv/lib/lib.a --end-group
    kernel/sched/fair.o: In function .L21': fair.c:(.text+0xdc): undefined reference to __lshrti3'
    kernel/time/timekeeping.o: In function read_persistent_clock64': timekeeping.c:(.text+0x1b0c): undefined reference to __lshrti3'

Looks like gcc emits some symbols not provided by the internal libgcc copy?

Self compiled toolchain with gcc 7.3.0. Happens with gcc 8.1.0, too. Binutils 2.30 + glib 2.27.

./toolchain_qemu-riscv64_glibc/usr/bin/riscv64-openadk-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=./toolchain_qemu-riscv64_glibc/usr/bin/riscv64-openadk-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/Users/wbrodkorb/openadk/toolchain_qemu-riscv64_glibc/usr/libexec/gcc/riscv64-openadk-linux-gnu/7.3.0/lto-wrapper
Target: riscv64-openadk-linux-gnu
Configured with: /Users/wbrodkorb/openadk/toolchain_build_qemu-riscv64_glibc/w-gcc-7.3.0-1/gcc-7.3.0/configure --prefix=/Users/wbrodkorb/openadk/toolchain_qemu-riscv64_glibc/usr --with-bugurl=https://openadk.org --build=x86_64-apple-darwin17.5.0 --host=x86_64-apple-darwin17.5.0 --target=riscv64-openadk-linux-gnu --with-gmp=/Users/wbrodkorb/openadk/host_x86_64-apple-darwin17.5.0/usr --with-mpfr=/Users/wbrodkorb/openadk/host_x86_64-apple-darwin17.5.0/usr --disable-__cxa_atexit --with-system-zlib --with-gnu-ld --with-gnu-as --disable-libsanitizer --disable-install-libiberty --disable-libitm --disable-libmudflap --disable-libgomp --disable-libcc1 --disable-libmpx --disable-libcilkrts --disable-libquadmath --disable-libquadmath-support --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-ppl --without-cloog --without-isl --disable-werror --disable-nls --disable-lto --with-arch=rv64imafdc --with-abi=lp64d --enable-tls --enable-threads --enable-libatomic --enable-shared --enable-cxx-flags=-fPIC --disable-libssp --disable-biarch --disable-multilib --enable-languages=c --with-build-sysroot='/../../target_qemu-riscv64_glibc' --with-sysroot='/../../target_qemu-riscv64_glibc'
Thread model: posix
gcc version 7.3.0 (GCC)

Any ideas?

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