diff mbox series

toolchain/toolchain-wrapper: make gcc --help -v work correctly

Message ID 5DD722F6-F9EE-4517-9E55-5A61BB01F196@gmail.com
State New
Headers show
Series toolchain/toolchain-wrapper: make gcc --help -v work correctly | expand

Commit Message

Sagi Mor Jan. 7, 2023, 6:09 p.m. UTC
make "gcc --help -v" display all the options, some packages depend on this
https://bugs.busybox.net/show_bug.cgi?id=15231

Signed-off-by: Sagi Mor <sagimor6@gmail.com>
---
 toolchain/toolchain-wrapper.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Romain Naour Feb. 7, 2023, 1:40 p.m. UTC | #1
Hello Sagi,

Le 07/01/2023 à 19:09, Sagi Mor a écrit :
> make "gcc --help -v" display all the options, some packages depend on this
> https://bugs.busybox.net/show_bug.cgi?id=15231
> <https://bugs.busybox.net/show_bug.cgi?id=15231>

Thanks for the report.

Actually it's surprising that --help -v options are really used together by a
build system to check gcc support.

Is something to fix in the python build system instead [1]?

As noticed by the GCC maintainer, the -fwrapv option is available since
gcc-3.4.5 [2], so it's unlikely someone still trying to build python with gcc 3.

Is any other package using "gcc --help -v"?

[1] https://github.com/python/cpython/blob/v3.11.1/configure.ac#L2062
[2]
https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=4fa26a60791ec314128a9683fd4d657b251d0268

Best regards,
Romain


> 
> Signed-off-by: Sagi Mor <sagimor6@gmail.com>
> ---
>  toolchain/toolchain-wrapper.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
> index 37b24dd24a..85d592ad2d 100644
> --- a/toolchain/toolchain-wrapper.c
> +++ b/toolchain/toolchain-wrapper.c
> @@ -498,6 +498,17 @@ int main(int argc, char **argv)
>  }
>  }
>  
> +/* drop all non forwards args if --help is specified */
> +for (i = 1; i < argc; i++) {
> +if (!strcmp(argv[i], "--help")) {
> +cur = args + 1;
> +#ifdef BR_CCACHE
> +cur++;
> +#endif
> +break;
> +}
> +}
> +
>  /* append forward args */
>  memcpy(cur, &argv[1], sizeof(char *) * (argc - 1));
>  cur += argc - 1;
> -- 
> 2.34.1
> 
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
index 37b24dd24a..85d592ad2d 100644
--- a/toolchain/toolchain-wrapper.c
+++ b/toolchain/toolchain-wrapper.c
@@ -498,6 +498,17 @@  int main(int argc, char **argv)
 		}
 	}
 
+	/* drop all non forwards args if --help is specified */
+	for (i = 1; i < argc; i++) {
+		if (!strcmp(argv[i], "--help")) {
+			cur = args + 1;
+#ifdef BR_CCACHE
+			cur++;
+#endif
+			break;
+		}
+	}
+
 	/* append forward args */
 	memcpy(cur, &argv[1], sizeof(char *) * (argc - 1));
 	cur += argc - 1;