gsliepen / tinc

a VPN daemon
http://tinc-vpn.org/
Other
1.87k stars 280 forks source link

Meson configure incorrectly detects -Qunused-arguments #383

Closed lancethepants closed 2 years ago

lancethepants commented 2 years ago

I noticed I was getting lots of warnings unrecognized option '-Qunused-arguments' while cross-compiling tinc. Looking in the meson logs it is showing it is supported despite Compiler stderr saying that it's not recognized by the compiler.


Running compile:
Working directory:  /home/lance/freshtomato-tinc/release/src-rt-6.x.4708/router/tinc/build/meson-private/tmpwfsuztqf
Command line:  arm-brcm-linux-uclibcgnueabi-gcc -I/home/lance/freshtomato-tinc/release/src-rt-6.x.4708/router/zlib/staged/usr/include -I/home/lance/freshtomato-tinc/release/src-rt-6.x.4708/router/lzo/staged/usr/include -I/home/lance/freshtomato-tinc/release/src-rt-6.x.4708/router/lz4/staged/usr/include -I/home/lance/freshtomato-tinc/release/src-rt-6.x.4708/router/openssl-1.1/staged/usr/include /home/lance/freshtomato-tinc/release/src-rt-6.x.4708/router/tinc/build/meson-private/tmpwfsuztqf/testfile.c -o /home/lance/freshtomato-tinc/release/src-rt-6.x.4708/router/tinc/build/meson-private/tmpwfsuztqf/output.obj -c -DLINUX26 -DCONFIG_BCMWL5 -DCONFIG_BCMWL6 -DCONFIG_BCMWL6A -DPART_JFFS2_GAP=0UL -pipe -fno-strict-aliasing -DBCMWPA2 -DBCMARM -fno-delete-null-pointer-checks -marm -DTCONFIG_NVRAM_64K -DLINUX_KERNEL_VERSION=132644 -ffunction-sections -fdata-sections -D_FILE_OFFSET_BITS=64 -O0 -Qunused-arguments

Code:
 extern int i;
int i;

Compiler stdout:

Compiler stderr:
 arm-brcm-linux-uclibcgnueabi-gcc: unrecognized option '-Qunused-arguments'

Compiler for C supports arguments -Qunused-arguments: YES```
hg commented 2 years ago

Could you try simply removing it? It was used to silence clang warnings about flag combinations that are not relevant anymore IIRC.

https://github.com/hg/tinc/actions/runs/2286199075

eli-schwartz commented 2 years ago

Looking in the meson logs it is showing it is supported despite Compiler stderr saying that it's not recognized by the compiler.

If you try running this compiler on the command line by hand, what does it say when given that option?

arm-brcm-linux-uclibcgnueabi-gcc: unrecognized option '-Qunused-arguments'

For me, I get:

gcc: error: unrecognized command-line option ‘-Qunused-arguments’

and the compiler exits 1 for failure without producing compiled output.

Why are you getting lots of warnings instead of lots of errors?

lancethepants commented 2 years ago

So when I manually run the command arm-brcm-linux-uclibcgnueabi-gcc -Qunused-arguments hello.c -o hello the compiler does exit with 0 and I have a hello binary. Perhaps it has something to do with being a very old compiler version (4.5.3) because on newer compilers I do see exit 1.

gsliepen commented 2 years ago

Fixed by PR #384.