Skip to content

orc/orccpu-powerpc.c: fix build with kernel < 4.11

Fabrice Fontaine requested to merge (removed):master into master

Build with powerpc and kernel < 4.11 is broken since version 0.4.30 and a999325a:

FAILED: orc/liborc-0.4.so.0.32.0.p/orccpu-powerpc.c.o
/home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/powerpc-linux-gcc -Iorc/liborc-0.4.so.0.32.0.p -Iorc -I../orc -I. -I.. -fdiagnostics-color=always -pipe -Wall -Winvalid-pch -std=gnu99 -O3 -DHAVE_CONFIG_H -fvisibility=hidden -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fPIC -pthread -DORC_ENABLE_UNSTABLE_API -D_GNU_SOURCE -DBUILDING_ORC -MD -MQ orc/liborc-0.4.so.0.32.0.p/orccpu-powerpc.c.o -MF orc/liborc-0.4.so.0.32.0.p/orccpu-powerpc.c.o.d -o orc/liborc-0.4.so.0.32.0.p/orccpu-powerpc.c.o -c ../orc/orccpu-powerpc.c
../orc/orccpu-powerpc.c: In function 'orc_check_powerpc_proc_auxv':
../orc/orccpu-powerpc.c:164:21: error: 'AT_L1D_CACHESIZE' undeclared (first use in this function); did you mean 'AT_DCACHEBSIZE'?
  164 |       if (buf[i] == AT_L1D_CACHESIZE) {
      |                     ^~~~~~~~~~~~~~~~
      |                     AT_DCACHEBSIZE
../orc/orccpu-powerpc.c:164:21: note: each undeclared identifier is reported only once for each function it appears in
../orc/orccpu-powerpc.c:168:21: error: 'AT_L2_CACHESIZE' undeclared (first use in this function); did you mean 'AT_ICACHEBSIZE'?
  168 |       if (buf[i] == AT_L2_CACHESIZE) {
      |                     ^~~~~~~~~~~~~~~
      |                     AT_ICACHEBSIZE
../orc/orccpu-powerpc.c:172:21: error: 'AT_L3_CACHESIZE' undeclared (first use in this function); did you mean 'AT_ICACHEBSIZE'?
  172 |       if (buf[i] == AT_L3_CACHESIZE) {
      |                     ^~~~~~~~~~~~~~~
      |                     AT_ICACHEBSIZE

Indeed, AT_{L1D,L2,L3}_CACHESIZE is only defined since kernel 4.11 and https://github.com/torvalds/linux/commit/98a5f361b8625c6f4841d6ba013bbf0e80d08147

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com

Edited by Fabrice Fontaine

Merge request reports

Loading