Open kemonats opened 9 months ago
Thanks for bringing it to our attention.
Regarding the (1):
-ffreestanding
as they are being run in C freestanding environment-ffreestanding
option is not enough for gcc to avoid memset
problems (see my comment here: https://github.com/phoenix-rtos/plo/pull/167#issuecomment-1072521885) - it explicitly requires mem*
functions to be implemented even in freestanding environment
If you plan to change your
gcc
compiler version to>= 10
then you may experience the following problems:the compiler, in the case of a simple loop writing a constant value to cells of memory may use
memset()
function, which is not defined. For example, such loops:https://github.com/phoenix-rtos/phoenix-rtos-kernel/blob/1c700bbab4851a4d9010ddc4ff1b14fcada19295/lib/printf.c#L114-L115
https://github.com/phoenix-rtos/phoenix-rtos-kernel/blob/1c700bbab4851a4d9010ddc4ff1b14fcada19295/hal/armv7a/pmap.c#L546-L549
Solution:
-ffreestanding
option to theCFLAGS
inMakefile.common
or in theMakefile
in thekernel
andplo
repository.since version
10
gcc
, the default option is-fno-common
(9
has-fcommon
set as default) This causes a problem with linking thelibjffs2
library. This is caused by the definition of theinit_user_ns
variable asglobal
in the header file: https://github.com/phoenix-rtos/phoenix-rtos-filesystems/blob/8af595a6b37129b4a6cb7e0cb93705c4d6b3476b/jffs2/phoenix-rtos.h#L139Solution:
init_user_ns
variable in one of the source files, and in the header file declare this variable.asextern
.-fcommon
option.