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

kernel: fix build errors for clang #54

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

binarycraft007
Copy link

@binarycraft007 binarycraft007 commented Feb 8, 2024

This PR fixes some compile error for clang when I was trying to cross compile kpimg.

KernelPatch/kernel/include/cache.h:48:45: error: value size does not match register size specified by the constraint and modifier
    asm volatile("mrs %0, CurrentEL" : "=r"(el));
                                            ^
KernelPatch/kernel/patch/module/module.c:13:10: note: in file included from KernelPatch/kernel/patch/module/module.c:13:
#include <cache.h>
         ^
KernelPatch/kernel/include/cache.h:48:23: note: use constraint modifier "w"
    asm volatile("mrs %0, CurrentEL" : "=r"(el));
                      ^~~
KernelPatch/kernel/linux/include/linux/rcupdate.h:81:1: error: non-void function does not return a value in all control paths
}
^
KernelPatch/kernel/patch/module/module.c:23:10: note: in file included from KernelPatch/kernel/patch/module/module.c:23:
#include <linux/rcupdate.h>
         ^
KernelPatch/kernel/linux/include/linux/rcupdate.h:139:1: error: non-void function does not return a value in all control paths
}
^
KernelPatch/kernel/patch/module/module.c:23:10: note: in file included from KernelPatch/kernel/patch/module/module.c:23:
#include <linux/rcupdate.h>
         ^
KernelPatch/kernel/linux/include/linux/rcupdate.h:143:1: error: non-void function does not return a value in all control paths
}
^
KernelPatch/kernel/patch/module/module.c:23:10: note: in file included from KernelPatch/kernel/patch/module/module.c:23:
#include <linux/rcupdate.h>
         ^
KernelPatch/kernel/linux/include/linux/rcupdate.h:147:1: error: non-void function does not return a value in all control paths
}
^
KernelPatch/kernel/patch/module/module.c:23:10: note: in file included from KernelPatch/kernel/patch/module/module.c:23:
#include <linux/rcupdate.h>
         ^
KernelPatch/kernel/linux/include/linux/rcupdate.h:151:1: error: non-void function does not return a value in all control paths
}
^
KernelPatch/kernel/patch/module/module.c:23:10: note: in file included from KernelPatch/kernel/patch/module/module.c:23:
#include <linux/rcupdate.h>
         ^
KernelPatch/kernel/linux/include/linux/rcupdate.h:160:1: error: non-void function does not return a value in all control paths
}
^
KernelPatch/kernel/patch/module/module.c:23:10: note: in file included from KernelPatch/kernel/patch/module/module.c:23:
#include <linux/rcupdate.h>
         ^
KernelPatch/kernel/linux/include/linux/rcupdate.h:164:1: error: non-void function does not return a value in all control paths
}
^
KernelPatch/kernel/patch/module/module.c:23:10: note: in file included from KernelPatch/kernel/patch/module/module.c:23:
#include <linux/rcupdate.h>
         ^
KernelPatch/kernel/patch/module/module.c:189:13: error: expected expression
            unsigned long addr = symbol_lookup_name(name);
            ^
KernelPatch/kernel/patch/module/module.c:192:18: error: use of undeclared identifier 'addr'
            if (!addr) {
                 ^
KernelPatch/kernel/patch/module/module.c:197:31: error: use of undeclared identifier 'addr'
            sym[i].st_value = addr;
                              ^

@bmax121
Copy link
Owner

bmax121 commented Feb 15, 2024

have you tested the kpimg

@binarycraft007
Copy link
Author

have you tested the kpimg

patch was successful, os is enable to boot, but the latest apatch version is too old maybe, it doesn't detect kpimg with superkey inputed.

@binarycraft007
Copy link
Author

have you tested the kpimg

hi, just installed the latest apk from apatch github workflow, the kpimg works

@bmax121
Copy link
Owner

bmax121 commented Feb 29, 2024

good, but your modification is no longer applicable to gcc

@sekaiacg
Copy link
Contributor

sekaiacg commented Mar 2, 2024

Can kpm be successfully loaded after using clang to compile kpimg?
I used clang and found that module loading failed.

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