All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the rust tree
@ 2021-09-28  4:09 Stephen Rothwell
  2021-09-28  4:18 ` Gary Guo
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2021-09-28  4:09 UTC (permalink / raw)
  To: Miguel Ojeda, Masahiro Yamada
  Cc: Richard Weinberger, Adam Bratschi-Kaye, Alex Gaynor, Ayaan Zaidi,
	Boqun Feng, Boris-Chengbiao Zhou, Douglas Su, Finn Behrens,
	Fox Chen, Gary Guo, Geoffrey Thomas, Michael Ellerman,
	Sumera Priyadarsini, Sven Van Asbroeck, Wedson Almeida Filho,
	Yuki Okushi, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1932 bytes --]

Hi all,

After merging the rust tree, today's linux-next build (x86_64
allmodconfig) failed like this:

scripts/kconfig/confdata.c: In function 'rustc_cfg_print_symbol':
scripts/kconfig/confdata.c:669:9: warning: implicit declaration of function 'sym_escape_string_value'; did you mean 'sym_set_string_value'? [-Wimplicit-function-declaration]
  669 |   str = sym_escape_string_value(value);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         sym_set_string_value
scripts/kconfig/confdata.c:669:7: warning: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  669 |   str = sym_escape_string_value(value);
      |       ^
/usr/bin/ld: scripts/kconfig/confdata.o: in function `rustc_cfg_print_symbol':
confdata.c:(.text+0x738): undefined reference to `sym_escape_string_value'

Caused by commit

  dc08d49444e9 ("Kbuild: add Rust support")

interacting with commit

  420a2bdbead2 ("kconfig: Refactor sym_escape_string_value")

from the kbuild tree.

I applied the following patch, but it doesn't seem quite right.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 28 Sep 2021 14:02:54 +1000
Subject: [PATCH] fixup for "kconfig: Refactor sym_escape_string_value"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 scripts/kconfig/confdata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index e1a739897d5a..096222531954 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -666,7 +666,7 @@ static void rustc_cfg_print_symbol(FILE *fp, struct symbol *sym, const char *val
 	case S_HEX:
 	case S_BOOLEAN:
 	case S_TRISTATE:
-		str = sym_escape_string_value(value);
+		str = sym_escape_string(sym);
 
 		/*
 		 * We don't care about disabled ones, i.e. no need for
-- 
2.33.0

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: linux-next: build failure after merge of the rust tree
  2021-09-28  4:09 linux-next: build failure after merge of the rust tree Stephen Rothwell
@ 2021-09-28  4:18 ` Gary Guo
  2021-09-28  5:52   ` Stephen Rothwell
  0 siblings, 1 reply; 6+ messages in thread
From: Gary Guo @ 2021-09-28  4:18 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Miguel Ojeda, Masahiro Yamada, Richard Weinberger,
	Adam Bratschi-Kaye, Alex Gaynor, Ayaan Zaidi, Boqun Feng,
	Boris-Chengbiao Zhou, Douglas Su, Finn Behrens, Fox Chen,
	Geoffrey Thomas, Michael Ellerman, Sumera Priyadarsini,
	Sven Van Asbroeck, Wedson Almeida Filho, Yuki Okushi,
	Linux Kernel Mailing List, Linux Next Mailing List

On Tue, 28 Sep 2021 14:09:32 +1000
Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi all,
> 
> After merging the rust tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> scripts/kconfig/confdata.c: In function 'rustc_cfg_print_symbol':
> scripts/kconfig/confdata.c:669:9: warning: implicit declaration of
> function 'sym_escape_string_value'; did you mean
> 'sym_set_string_value'? [-Wimplicit-function-declaration] 669 |   str
> = sym_escape_string_value(value); |         ^~~~~~~~~~~~~~~~~~~~~~~ |
>         sym_set_string_value scripts/kconfig/confdata.c:669:7:
> warning: assignment to 'const char *' from 'int' makes pointer from
> integer without a cast [-Wint-conversion] 669 |   str =
> sym_escape_string_value(value); |       ^ /usr/bin/ld:
> scripts/kconfig/confdata.o: in function `rustc_cfg_print_symbol':
> confdata.c:(.text+0x738): undefined reference to
> `sym_escape_string_value'
> 
> Caused by commit
> 
>   dc08d49444e9 ("Kbuild: add Rust support")
> 
> interacting with commit
> 
>   420a2bdbead2 ("kconfig: Refactor sym_escape_string_value")
> 
> from the kbuild tree.
> 
> I applied the following patch, but it doesn't seem quite right.

That's indeed incorrect, if we have `CONFIG_FOO=bar` then sym here is
`FOO` and value is `bar`. I think to resolve the conflict, 420a2bdbead2
would have to be reverted.

> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 28 Sep 2021 14:02:54 +1000
> Subject: [PATCH] fixup for "kconfig: Refactor sym_escape_string_value"
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  scripts/kconfig/confdata.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index e1a739897d5a..096222531954 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -666,7 +666,7 @@ static void rustc_cfg_print_symbol(FILE *fp,
> struct symbol *sym, const char *val case S_HEX:
>  	case S_BOOLEAN:
>  	case S_TRISTATE:
> -		str = sym_escape_string_value(value);
> +		str = sym_escape_string(sym);
>  
>  		/*
>  		 * We don't care about disabled ones, i.e. no need
> for


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: build failure after merge of the rust tree
  2021-09-28  4:18 ` Gary Guo
@ 2021-09-28  5:52   ` Stephen Rothwell
  2021-09-28 23:37     ` Stephen Rothwell
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2021-09-28  5:52 UTC (permalink / raw)
  To: Gary Guo
  Cc: Miguel Ojeda, Masahiro Yamada, Richard Weinberger,
	Adam Bratschi-Kaye, Alex Gaynor, Ayaan Zaidi, Boqun Feng,
	Boris-Chengbiao Zhou, Douglas Su, Finn Behrens, Fox Chen,
	Geoffrey Thomas, Michael Ellerman, Sumera Priyadarsini,
	Sven Van Asbroeck, Wedson Almeida Filho, Yuki Okushi,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1696 bytes --]

Hi Gary,

On Tue, 28 Sep 2021 05:18:49 +0100 Gary Guo <gary@garyguo.net> wrote:
>
> On Tue, 28 Sep 2021 14:09:32 +1000
> Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> > Hi all,
> > 
> > After merging the rust tree, today's linux-next build (x86_64
> > allmodconfig) failed like this:
> > 
> > scripts/kconfig/confdata.c: In function 'rustc_cfg_print_symbol':
> > scripts/kconfig/confdata.c:669:9: warning: implicit declaration of
> > function 'sym_escape_string_value'; did you mean
> > 'sym_set_string_value'? [-Wimplicit-function-declaration] 669 |   str
> > = sym_escape_string_value(value); |         ^~~~~~~~~~~~~~~~~~~~~~~ |
> >         sym_set_string_value scripts/kconfig/confdata.c:669:7:
> > warning: assignment to 'const char *' from 'int' makes pointer from
> > integer without a cast [-Wint-conversion] 669 |   str =
> > sym_escape_string_value(value); |       ^ /usr/bin/ld:
> > scripts/kconfig/confdata.o: in function `rustc_cfg_print_symbol':
> > confdata.c:(.text+0x738): undefined reference to
> > `sym_escape_string_value'
> > 
> > Caused by commit
> > 
> >   dc08d49444e9 ("Kbuild: add Rust support")
> > 
> > interacting with commit
> > 
> >   420a2bdbead2 ("kconfig: Refactor sym_escape_string_value")
> > 
> > from the kbuild tree.
> > 
> > I applied the following patch, but it doesn't seem quite right.  
> 
> That's indeed incorrect, if we have `CONFIG_FOO=bar` then sym here is
> `FOO` and value is `bar`. I think to resolve the conflict, 420a2bdbead2
> would have to be reverted.

OK, I have done that for today.  (I needed to revert
16f3610168218ed5e2eafa6978bb7f10c175c7a9 as well).

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: build failure after merge of the rust tree
  2021-09-28  5:52   ` Stephen Rothwell
@ 2021-09-28 23:37     ` Stephen Rothwell
  2021-09-29 17:13       ` Masahiro Yamada
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2021-09-28 23:37 UTC (permalink / raw)
  To: Miguel Ojeda, Masahiro Yamada
  Cc: Gary Guo, Richard Weinberger, Adam Bratschi-Kaye, Alex Gaynor,
	Ayaan Zaidi, Boqun Feng, Boris-Chengbiao Zhou, Douglas Su,
	Finn Behrens, Fox Chen, Geoffrey Thomas, Michael Ellerman,
	Sumera Priyadarsini, Sven Van Asbroeck, Wedson Almeida Filho,
	Yuki Okushi, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 4033 bytes --]

Hi All,

On Tue, 28 Sep 2021 15:52:47 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Tue, 28 Sep 2021 05:18:49 +0100 Gary Guo <gary@garyguo.net> wrote:
> >
> > On Tue, 28 Sep 2021 14:09:32 +1000
> > Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >   
> > > Hi all,
> > > 
> > > After merging the rust tree, today's linux-next build (x86_64
> > > allmodconfig) failed like this:
> > > 
> > > scripts/kconfig/confdata.c: In function 'rustc_cfg_print_symbol':
> > > scripts/kconfig/confdata.c:669:9: warning: implicit declaration of
> > > function 'sym_escape_string_value'; did you mean
> > > 'sym_set_string_value'? [-Wimplicit-function-declaration] 669 |   str
> > > = sym_escape_string_value(value); |         ^~~~~~~~~~~~~~~~~~~~~~~ |
> > >         sym_set_string_value scripts/kconfig/confdata.c:669:7:
> > > warning: assignment to 'const char *' from 'int' makes pointer from
> > > integer without a cast [-Wint-conversion] 669 |   str =
> > > sym_escape_string_value(value); |       ^ /usr/bin/ld:
> > > scripts/kconfig/confdata.o: in function `rustc_cfg_print_symbol':
> > > confdata.c:(.text+0x738): undefined reference to
> > > `sym_escape_string_value'
> > > 
> > > Caused by commit
> > > 
> > >   dc08d49444e9 ("Kbuild: add Rust support")
> > > 
> > > interacting with commit
> > > 
> > >   420a2bdbead2 ("kconfig: Refactor sym_escape_string_value")
> > > 
> > > from the kbuild tree.
> > > 
> > > I applied the following patch, but it doesn't seem quite right.    
> > 
> > That's indeed incorrect, if we have `CONFIG_FOO=bar` then sym here is
> > `FOO` and value is `bar`. I think to resolve the conflict, 420a2bdbead2
> > would have to be reverted.  
> 
> OK, I have done that for today.  (I needed to revert
> 16f3610168218ed5e2eafa6978bb7f10c175c7a9 as well).

Today, I have applied the following patch to the kbuild tree.
Masahiro, would you consider adding this to the kbuild tree itself?  Or
is there a betters solution for what the rust tree wants to do?

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 29 Sep 2021 09:30:02 +1000
Subject: [PATCH] kconfig: restore sym_escape_string_value()

This function will be used by the rust tree.

Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Gary Guo <gary@garyguo.net>
Cc: Richard Weinberger <richard@nod.at>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 scripts/kconfig/lkc_proto.h |  1 +
 scripts/kconfig/symbol.c    | 11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h
index 7ce4b666bba8..62e0ed773f41 100644
--- a/scripts/kconfig/lkc_proto.h
+++ b/scripts/kconfig/lkc_proto.h
@@ -18,6 +18,7 @@ extern struct symbol * symbol_hash[SYMBOL_HASHSIZE];
 
 struct symbol * sym_lookup(const char *name, int flags);
 struct symbol * sym_find(const char *name);
+char *sym_escape_string_value(const char *in);
 char *sym_escape_string(struct symbol *sym);
 struct symbol ** sym_re_search(const char *pattern);
 const char * sym_type_name(enum symbol_type type);
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 2dc251b0930e..ca115569d497 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -872,15 +872,13 @@ struct symbol *sym_find(const char *name)
 }
 
 /* The returned pointer must be freed on the caller side */
-char *sym_escape_string(struct symbol *sym)
+char *sym_escape_string_value(const char *in)
 {
-	const char *in, *p;
+	const char *p;
 	size_t reslen;
 	char *res;
 	size_t l;
 
-	in = sym_get_string_value(sym);
-
 	reslen = strlen(in) + strlen("\"\"") + 1;
 
 	p = in;
@@ -917,6 +915,11 @@ char *sym_escape_string(struct symbol *sym)
 	return res;
 }
 
+char *sym_escape_string(struct symbol *sym)
+{
+	return sym_escape_string_value(sym_get_string_value(sym));
+}
+
 struct sym_match {
 	struct symbol	*sym;
 	off_t		so, eo;
-- 
2.33.0

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: linux-next: build failure after merge of the rust tree
  2021-09-28 23:37     ` Stephen Rothwell
@ 2021-09-29 17:13       ` Masahiro Yamada
  2021-09-29 17:25         ` Miguel Ojeda
  0 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2021-09-29 17:13 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Miguel Ojeda, Gary Guo, Richard Weinberger, Adam Bratschi-Kaye,
	Alex Gaynor, Ayaan Zaidi, Boqun Feng, Boris-Chengbiao Zhou,
	Douglas Su, Finn Behrens, Fox Chen, Geoffrey Thomas,
	Michael Ellerman, Sumera Priyadarsini, Sven Van Asbroeck,
	Wedson Almeida Filho, Yuki Okushi, Linux Kernel Mailing List,
	Linux Next Mailing List

On Wed, Sep 29, 2021 at 8:38 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi All,
>
> On Tue, 28 Sep 2021 15:52:47 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > On Tue, 28 Sep 2021 05:18:49 +0100 Gary Guo <gary@garyguo.net> wrote:
> > >
> > > On Tue, 28 Sep 2021 14:09:32 +1000
> > > Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > >
> > > > Hi all,
> > > >
> > > > After merging the rust tree, today's linux-next build (x86_64
> > > > allmodconfig) failed like this:
> > > >
> > > > scripts/kconfig/confdata.c: In function 'rustc_cfg_print_symbol':
> > > > scripts/kconfig/confdata.c:669:9: warning: implicit declaration of
> > > > function 'sym_escape_string_value'; did you mean
> > > > 'sym_set_string_value'? [-Wimplicit-function-declaration] 669 |   str
> > > > = sym_escape_string_value(value); |         ^~~~~~~~~~~~~~~~~~~~~~~ |
> > > >         sym_set_string_value scripts/kconfig/confdata.c:669:7:
> > > > warning: assignment to 'const char *' from 'int' makes pointer from
> > > > integer without a cast [-Wint-conversion] 669 |   str =
> > > > sym_escape_string_value(value); |       ^ /usr/bin/ld:
> > > > scripts/kconfig/confdata.o: in function `rustc_cfg_print_symbol':
> > > > confdata.c:(.text+0x738): undefined reference to
> > > > `sym_escape_string_value'
> > > >
> > > > Caused by commit
> > > >
> > > >   dc08d49444e9 ("Kbuild: add Rust support")
> > > >
> > > > interacting with commit
> > > >
> > > >   420a2bdbead2 ("kconfig: Refactor sym_escape_string_value")
> > > >
> > > > from the kbuild tree.
> > > >
> > > > I applied the following patch, but it doesn't seem quite right.
> > >
> > > That's indeed incorrect, if we have `CONFIG_FOO=bar` then sym here is
> > > `FOO` and value is `bar`. I think to resolve the conflict, 420a2bdbead2
> > > would have to be reverted.
> >
> > OK, I have done that for today.  (I needed to revert
> > 16f3610168218ed5e2eafa6978bb7f10c175c7a9 as well).
>
> Today, I have applied the following patch to the kbuild tree.
> Masahiro, would you consider adding this to the kbuild tree itself?  Or
> is there a betters solution for what the rust tree wants to do?


I dropped those two offending commits from my tree for now
(with a different reason).

I will try my best to avoid complex conflicts next time.






>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Wed, 29 Sep 2021 09:30:02 +1000
> Subject: [PATCH] kconfig: restore sym_escape_string_value()
>
> This function will be used by the rust tree.
>
> Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
> Cc: Gary Guo <gary@garyguo.net>
> Cc: Richard Weinberger <richard@nod.at>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  scripts/kconfig/lkc_proto.h |  1 +
>  scripts/kconfig/symbol.c    | 11 +++++++----
>  2 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h
> index 7ce4b666bba8..62e0ed773f41 100644
> --- a/scripts/kconfig/lkc_proto.h
> +++ b/scripts/kconfig/lkc_proto.h
> @@ -18,6 +18,7 @@ extern struct symbol * symbol_hash[SYMBOL_HASHSIZE];
>
>  struct symbol * sym_lookup(const char *name, int flags);
>  struct symbol * sym_find(const char *name);
> +char *sym_escape_string_value(const char *in);
>  char *sym_escape_string(struct symbol *sym);
>  struct symbol ** sym_re_search(const char *pattern);
>  const char * sym_type_name(enum symbol_type type);
> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> index 2dc251b0930e..ca115569d497 100644
> --- a/scripts/kconfig/symbol.c
> +++ b/scripts/kconfig/symbol.c
> @@ -872,15 +872,13 @@ struct symbol *sym_find(const char *name)
>  }
>
>  /* The returned pointer must be freed on the caller side */
> -char *sym_escape_string(struct symbol *sym)
> +char *sym_escape_string_value(const char *in)
>  {
> -       const char *in, *p;
> +       const char *p;
>         size_t reslen;
>         char *res;
>         size_t l;
>
> -       in = sym_get_string_value(sym);
> -
>         reslen = strlen(in) + strlen("\"\"") + 1;
>
>         p = in;
> @@ -917,6 +915,11 @@ char *sym_escape_string(struct symbol *sym)
>         return res;
>  }
>
> +char *sym_escape_string(struct symbol *sym)
> +{
> +       return sym_escape_string_value(sym_get_string_value(sym));
> +}
> +
>  struct sym_match {
>         struct symbol   *sym;
>         off_t           so, eo;
> --
> 2.33.0
>
> --
> Cheers,
> Stephen Rothwell



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: build failure after merge of the rust tree
  2021-09-29 17:13       ` Masahiro Yamada
@ 2021-09-29 17:25         ` Miguel Ojeda
  0 siblings, 0 replies; 6+ messages in thread
From: Miguel Ojeda @ 2021-09-29 17:25 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Stephen Rothwell, Gary Guo, Richard Weinberger,
	Adam Bratschi-Kaye, Alex Gaynor, Ayaan Zaidi, Boqun Feng,
	Boris-Chengbiao Zhou, Douglas Su, Finn Behrens, Fox Chen,
	Geoffrey Thomas, Michael Ellerman, Sumera Priyadarsini,
	Sven Van Asbroeck, Wedson Almeida Filho, Yuki Okushi,
	Linux Kernel Mailing List, Linux Next Mailing List

On Wed, Sep 29, 2021 at 7:14 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> I dropped those two offending commits from my tree for now
> (with a different reason).
>
> I will try my best to avoid complex conflicts next time.

Thanks Masahiro -- let me know if you need anything from my side or if
you prefer another solution etc.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-29 17:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28  4:09 linux-next: build failure after merge of the rust tree Stephen Rothwell
2021-09-28  4:18 ` Gary Guo
2021-09-28  5:52   ` Stephen Rothwell
2021-09-28 23:37     ` Stephen Rothwell
2021-09-29 17:13       ` Masahiro Yamada
2021-09-29 17:25         ` Miguel Ojeda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.