We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempting to build a Linux kernel with tip of tree results in an assembler error in fs/nfs/flexfilelayout/flexfilelayout.o:
$ make -j$(nproc) ARCH=riscv CC=clang-11 CROSS_COMPILE=riscv64-linux-gnu- HOSTCC=clang-11 O=/out.riscv distclean defconfig fs/nfs/flexfilelayout/flexfilelayout.o ...
/tmp/flexfilelayout-143baf.s: Assembler messages: [0/99810] /tmp/flexfilelayout-143baf.s:37: Error: bad expression /tmp/flexfilelayout-143baf.s:37: Error: illegal operands auipc a0,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:232: Error: bad expression /tmp/flexfilelayout-143baf.s:232: Error: illegal operands auipc a2,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:359: Error: bad expression /tmp/flexfilelayout-143baf.s:359: Error: illegal operands auipc a0,%got_pcrel_hi(mem_map)' /tmp/flexfilelayout-143baf.s:367: Error: bad expression /tmp/flexfilelayout-143baf.s:367: Error: illegal operands auipc a2,%got_pcrel_hi(pfn_base)' /tmp/flexfilelayout-143baf.s:374: Error: bad expression /tmp/flexfilelayout-143baf.s:374: Error: illegal operands auipc a3,%got_pcrel_hi(va_pa_offset)' /tmp/flexfilelayout-143baf.s:429: Error: bad expression /tmp/flexfilelayout-143baf.s:429: Error: illegal operands auipc a1,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:478: Error: bad expression /tmp/flexfilelayout-143baf.s:478: Error: illegal operands auipc a0,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:755: Error: bad expression /tmp/flexfilelayout-143baf.s:755: Error: illegal operands auipc a0,%got_pcrel_hi(init_user_ns)' /tmp/flexfilelayout-143baf.s:797: Error: bad expression /tmp/flexfilelayout-143baf.s:797: Error: illegal operands auipc a0,%got_pcrel_hi(init_user_ns)' /tmp/flexfilelayout-143baf.s:1702: Error: bad expression /tmp/flexfilelayout-143baf.s:1702: Error: illegal operands auipc a0,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:1777: Error: bad expression /tmp/flexfilelayout-143baf.s:1777: Error: illegal operands auipc a1,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:3291: Error: bad expression /tmp/flexfilelayout-143baf.s:3291: Error: illegal operands auipc a2,%got_pcrel_hi(__per_cpu_offset)' /tmp/flexfilelayout-143baf.s:3599: Error: bad expression /tmp/flexfilelayout-143baf.s:3599: Error: illegal operands auipc a1,%got_pcrel_hi(layoutstats_timer)' /tmp/flexfilelayout-143baf.s:4219: Error: bad expression /tmp/flexfilelayout-143baf.s:4219: Error: illegal operands auipc a1,%got_pcrel_hi(layoutstats_timer)' /tmp/flexfilelayout-143baf.s:4718: Error: bad expression /tmp/flexfilelayout-143baf.s:4718: Error: illegal operands auipc a1,%got_pcrel_hi(layoutstats_timer)' /tmp/flexfilelayout-143baf.s:5644: Error: bad expression /tmp/flexfilelayout-143baf.s:5644: Error: illegal operands auipc a3,%got_pcrel_hi(mem_map)' /tmp/flexfilelayout-143baf.s:5654: Error: bad expression /tmp/flexfilelayout-143baf.s:5654: Error: illegal operands auipc a2,%got_pcrel_hi(pfn_base)' /tmp/flexfilelayout-143baf.s:5661: Error: bad expression /tmp/flexfilelayout-143baf.s:5661: Error: illegal operands auipc a3,%got_pcrel_hi(va_pa_offset)' clang: error: assembler command failed with exit code 1 (use -v to see invocation) ...
auipc a0,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:232: Error: bad expression /tmp/flexfilelayout-143baf.s:232: Error: illegal operands
auipc a0,%got_pcrel_hi(mem_map)' /tmp/flexfilelayout-143baf.s:367: Error: bad expression /tmp/flexfilelayout-143baf.s:367: Error: illegal operands
auipc a3,%got_pcrel_hi(va_pa_offset)' /tmp/flexfilelayout-143baf.s:429: Error: bad expression /tmp/flexfilelayout-143baf.s:429: Error: illegal operands
auipc a0,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:755: Error: bad expression /tmp/flexfilelayout-143baf.s:755: Error: illegal operands
auipc a0,%got_pcrel_hi(init_user_ns)' /tmp/flexfilelayout-143baf.s:1702: Error: bad expression /tmp/flexfilelayout-143baf.s:1702: Error: illegal operands
auipc a1,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:3291: Error: bad expression /tmp/flexfilelayout-143baf.s:3291: Error: illegal operands
auipc a1,%got_pcrel_hi(layoutstats_timer)' /tmp/flexfilelayout-143baf.s:4219: Error: bad expression /tmp/flexfilelayout-143baf.s:4219: Error: illegal operands
auipc a1,%got_pcrel_hi(layoutstats_timer)' /tmp/flexfilelayout-143baf.s:5644: Error: bad expression /tmp/flexfilelayout-143baf.s:5644: Error: illegal operands
auipc a2,%got_pcrel_hi(pfn_base)' /tmp/flexfilelayout-143baf.s:5661: Error: bad expression /tmp/flexfilelayout-143baf.s:5661: Error: illegal operands
I narrowed it down to the use of -fPIC, which is used with kernel modules: https://elixir.bootlin.com/linux/v5.5.2/source/arch/riscv/Makefile#L16
creduce spits out:
$ cat flexfilelayout.i a() { b(a); }
$ cat test.sh clang-11 --target=riscv64-linux-gnu --prefix=/usr/bin/ --gcc-toolchain=/usr -no-integrated-as -mabi=lp64 -march=rv64imac -mcmodel=medany -O2 -c -o / dev/null flexfilelayout.i || exit ${?} ! clang-11 --target=riscv64-linux-gnu --prefix=/usr/bin/ --gcc-toolchain=/usr -no-integrated-as -mabi=lp64 -march=rv64imac -mcmodel=medany -O2 -fPIC -c -o /dev/null flexfilelayout.i
Full preprocessed file available here: https://gist.github.com/b15e69f181fe1dcabb05414da00575eb
The text was updated successfully, but these errors were encountered:
That syntax looks fine. What version of binutils are you using?
Sorry, something went wrong.
$ riscv64-linux-gnu-as --version | head -n1 GNU assembler (GNU Binutils for Debian) 2.31.1
I can try a newer version once I am home from traveling.
Just tried running
$ make -j$(nproc) ARCH=riscv CC=clang-11 AS=clang-11 CROSS_COMPILE=riscv64-linux-gnu- HOSTCC=clang-11 O=/out.riscv distclean defconfig fs/nfs/flexfilelayout/flexfilelayout.o
and it succeeded. Problem with GNU as confirmed.
I still see this with ToT binutils
$ ./bin/riscv64-linux-gnu-as --version | head -n1 GNU assembler (GNU Binutils) 2.34.50.20200210
I don't think this is reproducible any longer and we have since moved onto compiling the RISC-V with the integrated assembler.
No branches or pull requests
Extended Description
Attempting to build a Linux kernel with tip of tree results in an assembler error in fs/nfs/flexfilelayout/flexfilelayout.o:
$ make -j$(nproc) ARCH=riscv CC=clang-11 CROSS_COMPILE=riscv64-linux-gnu- HOSTCC=clang-11 O=/out.riscv distclean defconfig fs/nfs/flexfilelayout/flexfilelayout.o
...
/tmp/flexfilelayout-143baf.s: Assembler messages: [0/99810]
/tmp/flexfilelayout-143baf.s:37: Error: bad expression
/tmp/flexfilelayout-143baf.s:37: Error: illegal operands
auipc a0,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:232: Error: bad expression /tmp/flexfilelayout-143baf.s:232: Error: illegal operands
auipc a2,%got_pcrel_hi(kmalloc_caches)'/tmp/flexfilelayout-143baf.s:359: Error: bad expression
/tmp/flexfilelayout-143baf.s:359: Error: illegal operands
auipc a0,%got_pcrel_hi(mem_map)' /tmp/flexfilelayout-143baf.s:367: Error: bad expression /tmp/flexfilelayout-143baf.s:367: Error: illegal operands
auipc a2,%got_pcrel_hi(pfn_base)'/tmp/flexfilelayout-143baf.s:374: Error: bad expression
/tmp/flexfilelayout-143baf.s:374: Error: illegal operands
auipc a3,%got_pcrel_hi(va_pa_offset)' /tmp/flexfilelayout-143baf.s:429: Error: bad expression /tmp/flexfilelayout-143baf.s:429: Error: illegal operands
auipc a1,%got_pcrel_hi(kmalloc_caches)'/tmp/flexfilelayout-143baf.s:478: Error: bad expression
/tmp/flexfilelayout-143baf.s:478: Error: illegal operands
auipc a0,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:755: Error: bad expression /tmp/flexfilelayout-143baf.s:755: Error: illegal operands
auipc a0,%got_pcrel_hi(init_user_ns)'/tmp/flexfilelayout-143baf.s:797: Error: bad expression
/tmp/flexfilelayout-143baf.s:797: Error: illegal operands
auipc a0,%got_pcrel_hi(init_user_ns)' /tmp/flexfilelayout-143baf.s:1702: Error: bad expression /tmp/flexfilelayout-143baf.s:1702: Error: illegal operands
auipc a0,%got_pcrel_hi(kmalloc_caches)'/tmp/flexfilelayout-143baf.s:1777: Error: bad expression
/tmp/flexfilelayout-143baf.s:1777: Error: illegal operands
auipc a1,%got_pcrel_hi(kmalloc_caches)' /tmp/flexfilelayout-143baf.s:3291: Error: bad expression /tmp/flexfilelayout-143baf.s:3291: Error: illegal operands
auipc a2,%got_pcrel_hi(__per_cpu_offset)'/tmp/flexfilelayout-143baf.s:3599: Error: bad expression
/tmp/flexfilelayout-143baf.s:3599: Error: illegal operands
auipc a1,%got_pcrel_hi(layoutstats_timer)' /tmp/flexfilelayout-143baf.s:4219: Error: bad expression /tmp/flexfilelayout-143baf.s:4219: Error: illegal operands
auipc a1,%got_pcrel_hi(layoutstats_timer)'/tmp/flexfilelayout-143baf.s:4718: Error: bad expression
/tmp/flexfilelayout-143baf.s:4718: Error: illegal operands
auipc a1,%got_pcrel_hi(layoutstats_timer)' /tmp/flexfilelayout-143baf.s:5644: Error: bad expression /tmp/flexfilelayout-143baf.s:5644: Error: illegal operands
auipc a3,%got_pcrel_hi(mem_map)'/tmp/flexfilelayout-143baf.s:5654: Error: bad expression
/tmp/flexfilelayout-143baf.s:5654: Error: illegal operands
auipc a2,%got_pcrel_hi(pfn_base)' /tmp/flexfilelayout-143baf.s:5661: Error: bad expression /tmp/flexfilelayout-143baf.s:5661: Error: illegal operands
auipc a3,%got_pcrel_hi(va_pa_offset)'clang: error: assembler command failed with exit code 1 (use -v to see invocation)
...
I narrowed it down to the use of -fPIC, which is used with kernel modules: https://elixir.bootlin.com/linux/v5.5.2/source/arch/riscv/Makefile#L16
creduce spits out:
$ cat flexfilelayout.i
a() { b(a); }
$ cat test.sh
clang-11 --target=riscv64-linux-gnu --prefix=/usr/bin/ --gcc-toolchain=/usr -no-integrated-as -mabi=lp64 -march=rv64imac -mcmodel=medany -O2 -c -o /
dev/null flexfilelayout.i || exit ${?}
! clang-11 --target=riscv64-linux-gnu --prefix=/usr/bin/ --gcc-toolchain=/usr -no-integrated-as -mabi=lp64 -march=rv64imac -mcmodel=medany -O2 -fPIC
-c -o /dev/null flexfilelayout.i
Full preprocessed file available here: https://gist.github.com/b15e69f181fe1dcabb05414da00575eb
The text was updated successfully, but these errors were encountered: