Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

clang does not compile on aarch64 #69

Open
tpgxyz opened this issue May 27, 2021 · 8 comments
Open

clang does not compile on aarch64 #69

tpgxyz opened this issue May 27, 2021 · 8 comments

Comments

@tpgxyz
Copy link

tpgxyz commented May 27, 2021

kernel 5.12.7 does not want to compile with UKSM patch on aarch64.

  clang -Wp,-MMD,mm/.uksm.o.d -nostdinc -isystem /usr/lib64/clang/12.0.0/include -I./arch/arm64/include -I./arch/arm64/include/generated  -I./include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -mlittle-endian -DKASAN_SHADOW_SCALE_SHIFT= -Qunused-arguments -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -Werror=unknown-warning-option -mgeneral-regs-only -DCONFIG_CC_HAS_K_CONSTRAINT=1 -Wno-psabi -fno-asynchronous-unwind-tables -fno-unwind-tables -mbranch-protection=pac-ret+leaf+bti -Wa,-march=armv8.5-a -DARM64_ASM_ARCH='"armv8.5-a"' -DKASAN_SHADOW_SCALE_SHIFT= -fno-delete-null-pointer-checks -Wno-frame-address -Wno-address-of-packed-member -O2 -Wframe-larger-than=1024 -fstack-protector-strong -Wno-format-invalid-specifier -Wno-gnu -mno-global-merge -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-lto -flto -fvisibility=hidden -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-array-bounds -fno-strict-overflow -fno-stack-check -Werror=date-time -Werror=incompatible-pointer-types -Wno-initializer-overrides -Wno-format -Wno-sign-compare -Wno-format-zero-length -Wno-pointer-to-enum-cast -Wno-tautological-constant-out-of-range-compare    -DKBUILD_MODFILE='"mm/uksm"' -DKBUILD_BASENAME='"uksm"' -DKBUILD_MODNAME='"uksm"' -D__KBUILD_MODNAME=kmod_uksm -c -o mm/uksm.o mm/uksm.c
In file included from mm/uksm.c:66:
In file included from ./include/linux/ksm.h:115:
./include/linux/uksm.h:19:22: warning: section attribute is specified on redeclared variable [-Wsection]
extern unsigned long zero_pfn __read_mostly;
                     ^
./include/linux/pgtable.h:1140:23: note: previous declaration is here
        extern unsigned long zero_pfn;
                             ^
In file included from mm/uksm.c:66:
In file included from ./include/linux/ksm.h:115:
./include/linux/uksm.h:20:22: warning: section attribute is specified on redeclared variable [-Wsection]
extern unsigned long uksm_zero_pfn __read_mostly;
                     ^
./include/linux/pgtable.h:1117:23: note: previous declaration is here
        extern unsigned long uksm_zero_pfn;
                             ^
mm/uksm.c:174:17: error: initializing 'unsigned long *' with an expression of type 'const void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
        unsigned long *src = s1;
                       ^     ~~
2 warnings and 1 error generated.
make[1]: *** [scripts/Makefile.build:271: mm/uksm.o] Error 1
make: *** [Makefile:1854: mm] Error 2
make: *** Waiting for unfinished jobs....
@dolohow
Copy link
Owner

dolohow commented May 28, 2021

Does it compile with 5.12.0?

@tpgxyz
Copy link
Author

tpgxyz commented May 28, 2021

@dolohow Yes of course it compiles on x86_64, but does not on aarch64.

@dolohow
Copy link
Owner

dolohow commented May 28, 2021

Did you try with gcc?

@tpgxyz
Copy link
Author

tpgxyz commented May 28, 2021

Yes it does bulild with gcc on aarch64 with UKSM patch.

@dolohow dolohow changed the title initializing 'unsigned long *' with an expression of type 'const void *' discards qualifiers clang does not compile on aarch64 May 28, 2021
@dolohow
Copy link
Owner

dolohow commented Jun 2, 2021

I will look into this tomorrow, probably.

@dolohow
Copy link
Owner

dolohow commented Sep 26, 2021

Can you try with the latest version?

@tpgxyz
Copy link
Author

tpgxyz commented Oct 15, 2021

Yes it does wotk with LLVM/clang and aarch64

@tpgxyz tpgxyz closed this as completed Oct 15, 2021
@dolohow dolohow reopened this Nov 1, 2021
@Manouchehri
Copy link

Any reason this was reopened?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants