Skip to content
New issue

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

rust/Kconfig: disable Rust support if CONFIG_MODVERSIONS=y #379

Merged
merged 1 commit into from Jun 14, 2021

Conversation

TheSven73
Copy link
Collaborator

In recent weeks, there have been a few reports of Rust build errors
for defconfigs which have CONFIG_MODVERSIONS=y. See #378 for example.

According to #59, Rust-for-Linux currently doesn't support MODVERSIONS.
To prevent confusion and build errors in the future, disable Rust
support if CONFIG_MODVERSIONS=y.

Signed-off-by: Sven Van Asbroeck thesven73@gmail.com

In recent weeks, there have been a few reports of Rust build errors
for defconfigs which have CONFIG_MODVERSIONS=y. See torvalds#378 for example.

According to torvalds#59, Rust-for-Linux currently doesn't support MODVERSIONS.
To prevent confusion and build errors in the future, disable Rust
support if CONFIG_MODVERSIONS=y.

Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>
@ksquirrel
Copy link
Member

Review of 9ac30a9061f3:

  • ✔️ Commit 9ac30a9: Looks fine!

@ojeda ojeda merged commit cbd2a83 into Rust-for-Linux:rust Jun 14, 2021
@TheSven73 TheSven73 deleted the rust-for-linux-modversions branch June 14, 2021 18:19
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Jan 11, 2023
Currently modversion uses a fixed size array of size (64 - sizeof(long))
to store symbol names, thus placing a hard limit on length of symbols.
Rust symbols (which encodes crate and module names) can be quite a bit
longer. The length limit in kallsyms is increased to 512 for this reason.

It's a waste of space to simply expand the fixed array size to 512 in
modversion info entries. I therefore make it variably sized, with offset
to the next entry indicated by the initial "next" field.

In addition to supporting longer-than-56/60 byte symbols, this patch also
reduce the size for short symbols by getting rid of excessive 0 paddings.
There are still some zero paddings to ensure "next" and "crc" fields are
properly aligned.

This patch does have a tiny drawback that it makes ".mod.c" files generated
a bit less easy to read, as code like

	"\x08\x00\x00\x00\x78\x56\x34\x12"
	"symbol\0\0"

is generated as opposed to

	{ 0x12345678, "symbol" },

because the structure is now variable-length. But hopefully nobody reads
the generated file :)

Link: b8a94bf ("kallsyms: increase maximum kernel symbol length to 512")
Link: Rust-for-Linux#379

Signed-off-by: Gary Guo <gary@garyguo.net>
tobhe pushed a commit to UbuntuAsahi/linux that referenced this pull request May 15, 2023
BugLink: https://bugs.launchpad.net/bugs/2007654

Currently modversion uses a fixed size array of size (64 - sizeof(long))
to store symbol names, thus placing a hard limit on length of symbols.
Rust symbols (which encodes crate and module names) can be quite a bit
longer. The length limit in kallsyms is increased to 512 for this reason.

It's a waste of space to simply expand the fixed array size to 512 in
modversion info entries. I therefore make it variably sized, with offset
to the next entry indicated by the initial "next" field.

In addition to supporting longer-than-56/60 byte symbols, this patch also
reduce the size for short symbols by getting rid of excessive 0 paddings.
There are still some zero paddings to ensure "next" and "crc" fields are
properly aligned.

This patch does have a tiny drawback that it makes ".mod.c" files generated
a bit less easy to read, as code like

	"\x08\x00\x00\x00\x78\x56\x34\x12"
	"symbol\0\0"

is generated as opposed to

	{ 0x12345678, "symbol" },

because the structure is now variable-length. But hopefully nobody reads
the generated file :)

Link: b8a94bf ("kallsyms: increase maximum kernel symbol length to 512")
Link: Rust-for-Linux#379

Signed-off-by: Gary Guo <gary@garyguo.net>
(backported from https://lore.kernel.org/lkml/20230111161155.1349375-1-gary@garyguo.net/)
[ fix build error on s390x: always use a variable with TO_NATIVE() ]
[ add dummy NULL entry at the end of the modversion array ]
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
tobhe pushed a commit to UbuntuAsahi/linux that referenced this pull request Jun 12, 2023
BugLink: https://bugs.launchpad.net/bugs/2007654

Currently modversion uses a fixed size array of size (64 - sizeof(long))
to store symbol names, thus placing a hard limit on length of symbols.
Rust symbols (which encodes crate and module names) can be quite a bit
longer. The length limit in kallsyms is increased to 512 for this reason.

It's a waste of space to simply expand the fixed array size to 512 in
modversion info entries. I therefore make it variably sized, with offset
to the next entry indicated by the initial "next" field.

In addition to supporting longer-than-56/60 byte symbols, this patch also
reduce the size for short symbols by getting rid of excessive 0 paddings.
There are still some zero paddings to ensure "next" and "crc" fields are
properly aligned.

This patch does have a tiny drawback that it makes ".mod.c" files generated
a bit less easy to read, as code like

	"\x08\x00\x00\x00\x78\x56\x34\x12"
	"symbol\0\0"

is generated as opposed to

	{ 0x12345678, "symbol" },

because the structure is now variable-length. But hopefully nobody reads
the generated file :)

Link: b8a94bf ("kallsyms: increase maximum kernel symbol length to 512")
Link: Rust-for-Linux#379

Signed-off-by: Gary Guo <gary@garyguo.net>
(backported from https://lore.kernel.org/lkml/20230111161155.1349375-1-gary@garyguo.net/)
[ fix build error on s390x: always use a variable with TO_NATIVE() ]
[ add dummy NULL entry at the end of the modversion array ]
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Joshua-Riek pushed a commit to Joshua-Riek/linux that referenced this pull request Oct 24, 2023
BugLink: https://bugs.launchpad.net/bugs/2007654

Currently modversion uses a fixed size array of size (64 - sizeof(long))
to store symbol names, thus placing a hard limit on length of symbols.
Rust symbols (which encodes crate and module names) can be quite a bit
longer. The length limit in kallsyms is increased to 512 for this reason.

It's a waste of space to simply expand the fixed array size to 512 in
modversion info entries. I therefore make it variably sized, with offset
to the next entry indicated by the initial "next" field.

In addition to supporting longer-than-56/60 byte symbols, this patch also
reduce the size for short symbols by getting rid of excessive 0 paddings.
There are still some zero paddings to ensure "next" and "crc" fields are
properly aligned.

This patch does have a tiny drawback that it makes ".mod.c" files generated
a bit less easy to read, as code like

	"\x08\x00\x00\x00\x78\x56\x34\x12"
	"symbol\0\0"

is generated as opposed to

	{ 0x12345678, "symbol" },

because the structure is now variable-length. But hopefully nobody reads
the generated file :)

Link: b8a94bf ("kallsyms: increase maximum kernel symbol length to 512")
Link: Rust-for-Linux#379

Signed-off-by: Gary Guo <gary@garyguo.net>
(backported from https://lore.kernel.org/lkml/20230111161155.1349375-1-gary@garyguo.net/)
[ fix build error on s390x: always use a variable with TO_NATIVE() ]
[ add dummy NULL entry at the end of the modversion array ]
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi pushed a commit to arighi/sched_ext that referenced this pull request Jan 10, 2024
BugLink: https://bugs.launchpad.net/bugs/2007654

Currently modversion uses a fixed size array of size (64 - sizeof(long))
to store symbol names, thus placing a hard limit on length of symbols.
Rust symbols (which encodes crate and module names) can be quite a bit
longer. The length limit in kallsyms is increased to 512 for this reason.

It's a waste of space to simply expand the fixed array size to 512 in
modversion info entries. I therefore make it variably sized, with offset
to the next entry indicated by the initial "next" field.

In addition to supporting longer-than-56/60 byte symbols, this patch also
reduce the size for short symbols by getting rid of excessive 0 paddings.
There are still some zero paddings to ensure "next" and "crc" fields are
properly aligned.

This patch does have a tiny drawback that it makes ".mod.c" files generated
a bit less easy to read, as code like

	"\x08\x00\x00\x00\x78\x56\x34\x12"
	"symbol\0\0"

is generated as opposed to

	{ 0x12345678, "symbol" },

because the structure is now variable-length. But hopefully nobody reads
the generated file :)

Link: b8a94bf ("kallsyms: increase maximum kernel symbol length to 512")
Link: Rust-for-Linux/linux#379

Signed-off-by: Gary Guo <gary@garyguo.net>
(backported from https://lore.kernel.org/lkml/20230111161155.1349375-1-gary@garyguo.net/)
[ fix build error on s390x: always use a variable with TO_NATIVE() ]
[ add dummy NULL entry at the end of the modversion array ]
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi pushed a commit to arighi/sched_ext that referenced this pull request Jan 25, 2024
BugLink: https://bugs.launchpad.net/bugs/2007654

Currently modversion uses a fixed size array of size (64 - sizeof(long))
to store symbol names, thus placing a hard limit on length of symbols.
Rust symbols (which encodes crate and module names) can be quite a bit
longer. The length limit in kallsyms is increased to 512 for this reason.

It's a waste of space to simply expand the fixed array size to 512 in
modversion info entries. I therefore make it variably sized, with offset
to the next entry indicated by the initial "next" field.

In addition to supporting longer-than-56/60 byte symbols, this patch also
reduce the size for short symbols by getting rid of excessive 0 paddings.
There are still some zero paddings to ensure "next" and "crc" fields are
properly aligned.

This patch does have a tiny drawback that it makes ".mod.c" files generated
a bit less easy to read, as code like

	"\x08\x00\x00\x00\x78\x56\x34\x12"
	"symbol\0\0"

is generated as opposed to

	{ 0x12345678, "symbol" },

because the structure is now variable-length. But hopefully nobody reads
the generated file :)

Link: b8a94bf ("kallsyms: increase maximum kernel symbol length to 512")
Link: Rust-for-Linux/linux#379

Signed-off-by: Gary Guo <gary@garyguo.net>
(backported from https://lore.kernel.org/lkml/20230111161155.1349375-1-gary@garyguo.net/)
[ fix build error on s390x: always use a variable with TO_NATIVE() ]
[ add dummy NULL entry at the end of the modversion array ]
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi pushed a commit to arighi/sched_ext that referenced this pull request Feb 4, 2024
BugLink: https://bugs.launchpad.net/bugs/2007654

Currently modversion uses a fixed size array of size (64 - sizeof(long))
to store symbol names, thus placing a hard limit on length of symbols.
Rust symbols (which encodes crate and module names) can be quite a bit
longer. The length limit in kallsyms is increased to 512 for this reason.

It's a waste of space to simply expand the fixed array size to 512 in
modversion info entries. I therefore make it variably sized, with offset
to the next entry indicated by the initial "next" field.

In addition to supporting longer-than-56/60 byte symbols, this patch also
reduce the size for short symbols by getting rid of excessive 0 paddings.
There are still some zero paddings to ensure "next" and "crc" fields are
properly aligned.

This patch does have a tiny drawback that it makes ".mod.c" files generated
a bit less easy to read, as code like

	"\x08\x00\x00\x00\x78\x56\x34\x12"
	"symbol\0\0"

is generated as opposed to

	{ 0x12345678, "symbol" },

because the structure is now variable-length. But hopefully nobody reads
the generated file :)

Link: b8a94bf ("kallsyms: increase maximum kernel symbol length to 512")
Link: Rust-for-Linux/linux#379

Signed-off-by: Gary Guo <gary@garyguo.net>
(backported from https://lore.kernel.org/lkml/20230111161155.1349375-1-gary@garyguo.net/)
[ fix build error on s390x: always use a variable with TO_NATIVE() ]
[ add dummy NULL entry at the end of the modversion array ]
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi pushed a commit to arighi/sched_ext that referenced this pull request Feb 7, 2024
BugLink: https://bugs.launchpad.net/bugs/2007654

Currently modversion uses a fixed size array of size (64 - sizeof(long))
to store symbol names, thus placing a hard limit on length of symbols.
Rust symbols (which encodes crate and module names) can be quite a bit
longer. The length limit in kallsyms is increased to 512 for this reason.

It's a waste of space to simply expand the fixed array size to 512 in
modversion info entries. I therefore make it variably sized, with offset
to the next entry indicated by the initial "next" field.

In addition to supporting longer-than-56/60 byte symbols, this patch also
reduce the size for short symbols by getting rid of excessive 0 paddings.
There are still some zero paddings to ensure "next" and "crc" fields are
properly aligned.

This patch does have a tiny drawback that it makes ".mod.c" files generated
a bit less easy to read, as code like

	"\x08\x00\x00\x00\x78\x56\x34\x12"
	"symbol\0\0"

is generated as opposed to

	{ 0x12345678, "symbol" },

because the structure is now variable-length. But hopefully nobody reads
the generated file :)

Link: b8a94bf ("kallsyms: increase maximum kernel symbol length to 512")
Link: Rust-for-Linux/linux#379

Signed-off-by: Gary Guo <gary@garyguo.net>
(backported from https://lore.kernel.org/lkml/20230111161155.1349375-1-gary@garyguo.net/)
[ fix build error on s390x: always use a variable with TO_NATIVE() ]
[ add dummy NULL entry at the end of the modversion array ]
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arighi pushed a commit to arighi/sched_ext that referenced this pull request Feb 7, 2024
BugLink: https://bugs.launchpad.net/bugs/2007654

Currently modversion uses a fixed size array of size (64 - sizeof(long))
to store symbol names, thus placing a hard limit on length of symbols.
Rust symbols (which encodes crate and module names) can be quite a bit
longer. The length limit in kallsyms is increased to 512 for this reason.

It's a waste of space to simply expand the fixed array size to 512 in
modversion info entries. I therefore make it variably sized, with offset
to the next entry indicated by the initial "next" field.

In addition to supporting longer-than-56/60 byte symbols, this patch also
reduce the size for short symbols by getting rid of excessive 0 paddings.
There are still some zero paddings to ensure "next" and "crc" fields are
properly aligned.

This patch does have a tiny drawback that it makes ".mod.c" files generated
a bit less easy to read, as code like

	"\x08\x00\x00\x00\x78\x56\x34\x12"
	"symbol\0\0"

is generated as opposed to

	{ 0x12345678, "symbol" },

because the structure is now variable-length. But hopefully nobody reads
the generated file :)

Link: b8a94bf ("kallsyms: increase maximum kernel symbol length to 512")
Link: Rust-for-Linux/linux#379

Signed-off-by: Gary Guo <gary@garyguo.net>
(backported from https://lore.kernel.org/lkml/20230111161155.1349375-1-gary@garyguo.net/)
[ fix build error on s390x: always use a variable with TO_NATIVE() ]
[ add dummy NULL entry at the end of the modversion array ]
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants