Skip to content

libbpf: fix const correctness in resolve_full_path for gcc15#474

Merged
amazingfate merged 1 commit intoarmbian:rk-6.1-rkr5.1from
EvilOlaf:gcc15
Apr 25, 2026
Merged

libbpf: fix const correctness in resolve_full_path for gcc15#474
amazingfate merged 1 commit intoarmbian:rk-6.1-rkr5.1from
EvilOlaf:gcc15

Conversation

@EvilOlaf
Copy link
Copy Markdown
Member

vendor header compilation fails when building with resolute as target. This is likely due to gcc15 being default in Resolute. I threw this at llm and this seem to fix the compilation.
This was originally discovered because aic8800 compilation failed due to failing headers.
This also looks quite similar to the mainline upstream fix: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.24&id=ab21cf885fb2af179c44d8beeabd716133b9385d

gcc 15's C library headers use _Generic to return const char * from
strchr() when passed a const char * input. With -Werror=discarded-
qualifiers, assigning this to a char * fails.

next_path only uses the pointer for arithmetic to calculate segment
length, never modifies the string. const char * is the correct type.

Signed-off-by: EvilOlaf <evilolaf@users.noreply.github.com>
@amazingfate
Copy link
Copy Markdown
Collaborator

we may rebase to newer rk sdk release, using upstream fix would make developers treat this patch more clearly when bump ing kernel(drop or keep this patch).

@EvilOlaf
Copy link
Copy Markdown
Member Author

I'd leave this at your discretion. Your insights are most likely deeper than mine.

@igorpecovnik
Copy link
Copy Markdown
Member

This is probably still good to merge? As I don't expect this rebase to happen soon-ish?

@amazingfate
Copy link
Copy Markdown
Collaborator

I just checked there is no related fix in 6.1 lts, and the one for 6.18 in upstream has patched some code not in 6.1 source tree. This PR is fine.

@amazingfate amazingfate merged commit 9389e31 into armbian:rk-6.1-rkr5.1 Apr 25, 2026
1 check passed
@EvilOlaf EvilOlaf deleted the gcc15 branch April 25, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants