0

I have a yocto image for an ARM target. I am building kernel modules on the ARM target and have found an odd problem. Can anyone suggest a solution?

On the target I have run "make scripts prepare modules_prepare". I have an out of tree module and it builds correctly and modules_install inserts the module into the extra folder adding the name of the module to the end of modules.dep. So this tells me that my environment is correct.

I have an in tree module that I included as a module in the kernel config. The module Makefile is identical (apart from the name) for my in tree module however when I type make I get a lot of messages similar to

/tmp/ccz5G4aS.s: Assembler messages:
/tmp/ccz5G4aS.s:1400: Error: selected processor does not support `dsb ' in ARM mode

Using make -pq I have looked at the KBUILD_AFLAGS / KBUILD_CFLAGS and they seem to be the same for the two modules but still the in tree module build fails.

Something must be different but I can't work out how to debug and fix the different between the two module builds. I have a work around idea to try to build the in tree module with a different name but it would be good to fix this properly.

KBUILD_CFLAGS := -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 -fno-dwarf2-cfi-asm -fno-ipa-sra -mabi=aapcs-linux -mfpu=vfp -funwind-tables -marm -Wa,-mno-warn-deprecated -D__LINUX_ARM_ARCH__=7 -march=armv5t -Wa,-march=armv7-a   -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=1024 -fstack-protector-strong -Wno-unused-but-set-variable -Wimplicit-fallthrough -Wno-unused-const-variable -fomit-frame-pointer -g -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned
KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE -mabi=aapcs-linux -mfpu=vfp -funwind-tables -marm -Wa,-mno-warn-deprecated -D__LINUX_ARM_ARCH__=7 -march=armv5t -Wa,-march=armv7-a  -include asm/unified.h -msoft-float -Wa,-gdwarf-2
1
  • It could be an issue with the toolchain and perhaps tinkering with the build flags are not the best way to deal with it. Commented Jun 23 at 10:06

1 Answer 1

0

I have just stumbled upon a better work round for this problem - https://lore.kernel.org/linux-arm-kernel/[email protected]/ - the arch/arm/Makefile can be modified to remove all the cc-option commands that modify the architecture specific and tuning specific compiler options!

I presume that the out of tree module build does not for some reason use the arch/arm/Makefile whilst my in-tree module build uses the Makefile an so has the build problem with gcc v11 and above.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.