On Tue, Jan 18, 2022 at 07:22:00PM +0100, Florian Weimer wrote:
>> On aarch64 I actually got a slightly different error
message:
>>
>> ld: criu/pie/restorer.o: in function `lsm_set_label':
>> /drone/src/criu/pie/restorer.c:174: undefined reference to `strlen'
>>
>> Line 174 is: "for (len = 0; label[len]; len++)"
>>
>> Although there is no direct use of strlen(), it seems GCC 12 uses
>> strlen() for that line which did not happen with GCC 11. Using
>> '-ffreestanding' makes the compilation work with GCC 12 and CI still
>> looks happy. Thanks.
>
>
https://gcc.gnu.org/r12-4283-g6f966f06146be76
> Note, gcc has been doing something similar for years for memcpy and memset.
> -fno-tree-loop-distribute-patterns
> will work too.
Shouldn't it be -ffreestanding?
-ffreestanding works too. Both of these options disable the pattern
matching, -fno-tree-loop-distribute-patterns is a targetted option that
disables just these kind of optimizations, -ffreestanding has various
further effects, it implies -fno-builtin, changes some preprocessor macros
and generally will disable far more optimizations than
-fno-tree-loop-distribute-patterns will.
Jakub