[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: clang 7.0.1 build fails with `error: argument unused during compilat
From: |
Nick Vinson |
Subject: |
Re: clang 7.0.1 build fails with `error: argument unused during compilation: '-Qn'` |
Date: |
Wed, 6 Feb 2019 07:42:02 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 |
On 2/6/19 2:53 AM, Daniel Kiper wrote:
> Hi Paul,
>
> On Tue, Feb 05, 2019 at 05:45:50PM +0100, Paul Menzel wrote:
>> Dear GRUB folks,
>>
>> Building GRUB from the master branch fails with clang 7.0.1 fails
>> with the error below. The error is not shown with clang 6.0.1.
>>
>> ```
>> $ ./autogen.sh
>> $ ./configure CC=clang
>> $ make -j`nproc`
When nproc retruns a value >1, make -j `nproc` can mask which command
actually triggered the error. In the future, I recommend using 'make'
or 'make -j1' when reporting build failures.
>> […]
>> clang -DHAVE_CONFIG_H -I. -I.. -Wall -W -DGRUB_MACHINE_PCBIOS=1
>> -DGRUB_MACHINE=I386_PC -m32 -msoft-float -Xclang -msoft-float -Xclang
>> -no-implicit-float -nostdinc -isystem /usr/lib/clang/7.0.1/include
>> -I../include -I../include -DGRUB_FILE=\"bus/cs5536.c\" -I. -I. -I.. -I..
>> -I../include -I../include -I../grub-core/lib/libgcrypt-grub/src/
>> -D_FILE_OFFSET_BITS=64 -Os -Wall -W -Wshadow -Wpointer-arith -Wundef
>> -Wchar-subscripts -Wcomment -Wdeprecated-declarations
>> -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args
>> -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration
>> -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute
>> -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow
>> -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused
>> -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value
>> -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g
>> -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wextra
>> -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch
>> -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla
>> -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros
>> -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs
>> -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -march=i386 -m32
>> -malign-jumps=1 -malign-loops=1 -malign-functions=1 -freg-struct-return
>> -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -fno-dwarf2-cfi-asm
>> -mno-stack-arg-probe -fno-asynchronous-unwind-tables -fno-unwind-tables -Qn
>> -fno-stack-protector -Werror -ffreestanding -MT
>> bus/cs5536_module-cs5536.o -MD -MP -MF
>> bus/.deps-core/cs5536_module-cs5536.Tpo -c -o bus/cs5536_module-cs5536.o
>> `test -f 'bus/cs5536.c' || echo './'`bus/cs5536.c
>> clang-7grep 'MARKER' gcry_twofish.marker.new > gcry_twofish.marker; rm -f
>> gcry_twofish.marker.new
>> : error: argument unused during compilation: '-Qn'
>> [-Werror,-Wunused-command-line-argument]
>> make[3]: *** [Makefile:28232: trig.module] Error 1
>
> I am not sure what the problem is. May I ask you to take closer look and fix
> it?
The issue is with the '-Qn' flag. Clang is flagging it as 'unused', and
then exiting because of the '-Wunused-command-line-argument' and
'-Werror' flags. '-Qn' appears to be unused when the only operation
performed is linking. I suspect GCC is filtering that flag out before
calling the linker. I can work-around this issue by adding '-Wno-error'
to CFLAGS. However, even with '-Wno-error' in the CFLAGS, GRUB fails to
build with clang-7.0.1.
I have attached two build logs. The first is without -Wno-error. The
second one is with it.
Thanks,
Nicholas Vinson
>
> Daniel
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
build_without_no_error.log
Description: Text Data
build_with_no_error.log
Description: Text Data
signature.asc
Description: OpenPGP digital signature