Re: [PATCH] powerpc/vdso: Drop -mstack-protector-guard flags in 32-bit files with clang

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Le 30/10/2024 à 19:41, Nathan Chancellor a écrit :
Under certain conditions, the 64-bit '-mstack-protector-guard' flags may
end up in the 32-bit vDSO flags, resulting in build failures due to the
structure of clang's argument parsing of the stack protector options,
which validates the arguments of the stack protector guard flags
unconditionally in the frontend, choking on the 64-bit values when
targeting 32-bit:

   clang: error: invalid value 'r13' in 'mstack-protector-guard-reg=', expected one of: r2
   clang: error: invalid value 'r13' in 'mstack-protector-guard-reg=', expected one of: r2
   make[3]: *** [arch/powerpc/kernel/vdso/Makefile:85: arch/powerpc/kernel/vdso/vgettimeofday-32.o] Error 1
   make[3]: *** [arch/powerpc/kernel/vdso/Makefile:87: arch/powerpc/kernel/vdso/vgetrandom-32.o] Error 1

Remove these flags by adding them to the CC32FLAGSREMOVE variable, which
already handles situations similar to this. Additionally, reformat and
align a comment better for the expanding CONFIG_CC_IS_CLANG block.

Is the problem really exclusively for 32-bit VDSO on 64-bit kernel ?
In any case, it is just wrong to have anything related to stack protection in VDSO, for this reason we have the following in Makefile:

ccflags-y += $(call cc-option, -fno-stack-protector)

If it is not enough, should we have more complete ?

Christophe




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux