xdp-project / xdp-tools

Utilities and example programs for use with XDP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build failure: `error: ‘%s’ directive argument is null [-Werror=format-overflow=]`

fnordahl opened this issue · comments

Hello,

With compiler defaults in Ubuntu (see below) we get the following build error on ppc64le with xdp-tools 1.3:

In file included from libxdp.c:37:
libxdp.c: In function ‘xdp_multiprog__pin.part.0’:
libxdp_internal.h:38:37: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
   38 |                 libxdp_print(level, "libxdp: " fmt, ##__VA_ARGS__); \
      |                                     ^~~~~~~~~~
libxdp.c: In function ‘xdp_multiprog__unpin.part.0’:
libxdp_internal.h:38:37: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
   38 |                 libxdp_print(level, "libxdp: " fmt, ##__VA_ARGS__); \
      |                                     ^~~~~~~~~~

While this outcome depends on compiler optimization settings, it does appear to me that it might point to a potential problem in the code.

Any thoughts?

Full buildlog: https://launchpadlibrarian.net/652820300/buildlog_ubuntu-lunar-ppc64el.xdp-tools_1.3.0-2ubuntu1_BUILDING.txt.gz
Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/xdp-tools/+bug/2008214

gcc -Q --help=target:

The following options are target specific:
  -G<number>                  		8
  -m32                        		[disabled]
  -m64                        		[enabled]
  -mabi=altivec               		[enabled]
  -mabi=d32                   		[enabled]
  -mabi=d64                   		[disabled]
  -mabi=elfv1                 		[disabled]
  -mabi=elfv2                 		[disabled]
  -mabi=ibmlongdouble         		[enabled]
  -mabi=ieeelongdouble        		[disabled]
  -mabi=no-altivec            		[disabled]
  -mabi=vec-default           		[enabled]
  -mabi=vec-extabi            		[disabled]
  -mads                       		[disabled]
  -maix-struct-return         		[enabled]
  -malign-                    		natural
  -malign-branch-targets      		
  -mallow-movmisalign         		[enabled]
  -maltivec                   		[enabled]
  -malways-hint               		
  -mavoid-indexed-addresses   		[disabled]
  -mbig                       		[disabled]
  -mbig-endian                		[disabled]
  -mbionic                    		[disabled]
  -mbit-align                 		[disabled]
  -mbit-word                  		[disabled]
  -mblock-compare-inline-limit= 	63
  -mblock-compare-inline-loop-limit= 	-1
  -mblock-move-inline-limit=  		64
  -mblock-ops-unaligned-vsx   		[enabled]
  -mblock-ops-vector-pair     		[disabled]
  -mbss-plt                   		[disabled]
  -mcall-ABI                  		linux
  -mcmodel=                   		medium
  -mcmpb                      		[enabled]
  -mcompat-align-parm         		[disabled]
  -mcpu=                      		power9
  -mcrypto                    		[enabled]
  -mdebug=                    		
  -mdirect-move               		[enabled]
  -mdlmzb                     		[disabled]
  -meabi                      		[disabled]
  -mefficient-unaligned-vsx   		[enabled]
  -memb                       		[disabled]
  -mfloat128                  		[enabled]
  -mfloat128-convert          		[disabled]
  -mfloat128-hardware         		[enabled]
  -mfp-in-toc                 		[disabled]
  -mfprnd                     		[enabled]
  -mfriz                      		
  -mfull-toc                  		[disabled]
  -mfused-madd                		-ffp-contract=fast
  -mgen-cell-microcode        		[ignored]
  -mglibc                     		[enabled]
  -mgnu-attribute             		[enabled]
  -mhard-dfp                  		[enabled]
  -mhard-float                		[enabled]
  -mhtm                       		[enabled]
  -mieee128-constant          		[enabled]
  -minsert-sched-nops=        		
  -misel                      		[enabled]
  -mlittle                    		[enabled]
  -mlittle-endian             		[enabled]
  -mlong-double-              		127
  -mlongcall                  		[disabled]
  -mlra                       		[ignored]
  -mmfcrf                     		[enabled]
  -mmfpgpr                    		[disabled]
  -mminimal-toc               		[disabled]
  -mmma                       		[disabled]
  -mmodulo                    		[enabled]
  -mmulhw                     		[disabled]
  -mmultiple                  		[disabled]
  -mmusl                      		[disabled]
  -mmvme                      		[disabled]
  -mnewlib                    		[disabled]
  -mno-fp-in-toc              		[enabled]
  -mno-mfpgpr                 		[ignored]
  -mno-string                 		[ignored]
  -mno-sum-in-toc             		[disabled]
  -mno-toc                    		[disabled]
  -mno-traceback              		[disabled]
  -mno-update                 		[disabled]
  -moptimize-swaps            		[enabled]
  -mpcrel                     		[disabled]
  -mpcrel-opt                 		[disabled]
  -mpltseq                    		[enabled]
  -mpointers-to-nested-functions 	[enabled]
  -mpopcntb                   		[enabled]
  -mpopcntd                   		[enabled]
  -mpower10                   		[disabled]
  -mpower10-fusion            		[disabled]
  -mpower8-fusion             		[disabled]
  -mpower8-fusion-sign        		[disabled]
  -mpower8-vector             		[enabled]
  -mpower9-minmax             		[enabled]
  -mpower9-misc               		[enabled]
  -mpower9-vector             		[enabled]
  -mpowerpc                   		[ignored]
  -mpowerpc-gfxopt            		[enabled]
  -mpowerpc-gpopt             		[enabled]
  -mpowerpc64                 		[enabled]
  -mprefixed                  		[disabled]
  -mprioritize-restricted-insns= 	0
  -mprivileged                		[disabled]
  -mprofile-kernel            		[disabled]
  -mprototype                 		[disabled]
  -mquad-memory               		[disabled]
  -mquad-memory-atomic        		[enabled]
  -mreadonly-in-sdata         		[enabled]
  -mrecip                     		[disabled]
  -mrecip-precision           		[enabled]
  -mrecip=                    		
  -mregnames                  		[disabled]
  -mrelative-jumptables       		[enabled]
  -mrelocatable               		[disabled]
  -mrelocatable-lib           		[disabled]
  -mrop-protect               		[disabled]
  -msave-toc-indirect         		[enabled]
  -msched-costly-dep=         		
  -msched-epilog              		[enabled]
  -msched-groups              		
  -msched-prolog              		[enabled]
  -msdata                     		[disabled]
  -msdata=[none,data,sysv,eabi] 	none
  -msecure-plt                		[enabled]
  -mshlib                     		[disabled]
  -msim                       		[disabled]
  -msingle-pic-base           		[disabled]
  -msoft-float                		[disabled]
  -mspeculate-indirect-jumps  		[enabled]
  -msplat-float-constant      		[enabled]
  -msplat-word-constant       		[enabled]
  -mstack-protector-guard-offset= 	
  -mstack-protector-guard-reg= 		
  -mstack-protector-guard=    		tls
  -mstrict-align              		[disabled]
  -mstring                    		[disabled]
  -mstring-compare-inline-limit= 	64
  -msum-in-toc                		[enabled]
  -msvr4-struct-return        		[disabled]
  -mtls-size=[16,32]          		32
  -mtoc                       		[disabled]
  -mtraceback=[full,part,no]  		[default]
  -mtune=                     		power9
  -muclibc                    		[disabled]
  -munroll-only-small-loops   		[disabled]
  -mupdate                    		[enabled]
  -mveclibabi=                		
  -mvrsave                    		[disabled]
  -mvrsave=no                 		-mvrsave
  -mvrsave=yes                		-mvrsave
  -mvsx                       		[enabled]
  -mvsx-align-128             		[disabled]
  -mvsx-timode                		[ignored]
  -mwarn-altivec-long         		[enabled]
  -mxl-compat                 		[disabled]
  -myellowknife               		[disabled]

  Valid arguments to -malign-:
    natural power

  Known code models (for use with the -mcmodel= option):
    large medium small

  Known CPUs (for use with the -mcpu= and -mtune= options):
    401 403 405 405fp 440 440fp 464 464fp 476 476fp 505 601 602 603 603e 604 604e 620 630 740 7400 7450 750 801 821 823 8540 8548 860 970 G3 G4 G5 a2 cell e300c2 e300c3
    e500mc e500mc64 e5500 e6500 ec603e native power10 power3 power4 power5 power5+ power6 power6x power7 power8 power9 powerpc powerpc64 powerpc64le rs64 titan

  Valid arguments to -mstack-protector-guard=:
    global tls

gcc -dumpspecs:

*asm:
%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)

*asm_debug:
%{%:debug-level-gt(0):%{gstabs*:--gstabs;:%{g*:%{%:dwarf-version-gt(4):--gdwarf-5;%:dwarf-version-gt(3):--gdwarf-4;%:dwarf-version-gt(2):--gdwarf-3;:--gdwarf2}}}} %{ffile-prefix-map=*:--debug-prefix-map %*} %{fdebug-prefix-map=*:--debug-prefix-map %*}

*asm_debug_option:


*asm_final:
%{gsplit-dwarf: 
       objcopy --extract-dwo 	 %{c:%{o*:%*}%{!o*:%w%b%O}}%{!c:%U%O} 	 %b.dwo 
       objcopy --strip-dwo 	 %{c:%{o*:%*}%{!o*:%w%b%O}}%{!c:%U%O}     }

*asm_options:
%{-target-help:%:print-asm-header()} %{v} %{w:-W} %{I*} %(asm_debug_option) %{gz|gz=zlib:--compress-debug-sections=zlib} %{gz=none:--compress-debug-sections=none} %{gz=zlib-gnu:--compress-debug-sections=zlib-gnu} %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}

*invoke_as:
%{!fwpa*:   %{fcompare-debug=*|fdump-final-insns=*:%:compare-debug-dump-opt()}   %{!S:-o %|.s |
 as %(asm_options) %m.s %A }  }

*cpp:
%{posix: -D_POSIX_SOURCE} %{mads         : %(cpp_os_ads)         ;   myellowknife : %(cpp_os_yellowknife) ;   mmvme        : %(cpp_os_mvme)        ;   msim         : %(cpp_os_sim)         ;   mcall-freebsd: %(cpp_os_freebsd)     ;   mcall-linux  : %(cpp_os_linux)       ;   mcall-netbsd : %(cpp_os_netbsd)      ;   mcall-openbsd: %(cpp_os_openbsd)     ;                : %(cpp_os_default)     }

*cpp_options:
%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{%:debug-level-gt(0):%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} %{save-temps*:-fpch-preprocess} %(distro_defaults)

*cpp_debug_options:
%<dumpdir %<dumpbase %<dumpbase-ext %{d*} %:dumps()

*cpp_unique_options:
%{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %@{I*&F*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{Mmodules} %{Mno-modules} %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}} %{remap} %{%:debug-level-gt(2):-dD} %{!iplugindir*:%{fplugin*:%:find-plugindir()}} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}

*trad_capable_cpp:
cc1 -E %{traditional|traditional-cpp:-traditional-cpp}

*cc1:
%{G*} %(cc1_cpu)%{meabi: %{!mcall-*: -mcall-sysv }} %{!meabi: %{!mno-eabi:     %{mrelocatable: -meabi }     %{mcall-freebsd: -mno-eabi }     %{mcall-i960-old: -meabi }     %{mcall-linux: -mno-eabi }     %{mcall-netbsd: -mno-eabi }     %{mcall-openbsd: -mno-eabi }}} %{msdata: -msdata=default} %{mno-sdata: -msdata=none} %{!mbss-plt: %{!msecure-plt: %(cc1_secure_plt_default)}}%{profile:-p}

*cc1_options:
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %{!iplugindir*:%{fplugin*:%:find-plugindir()}} %1 %{!Q:-quiet} %(cpp_debug_options) %{m*} %{aux-info*} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{Qy:} %{-help:--help} %{-target-help:--target-help} %{-version:--version} %{-help=*:--help=%*} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}} %{fsyntax-only:-o %j} %{-param*} %{coverage:-fprofile-arcs -ftest-coverage} %{fprofile-arcs|fprofile-generate*|coverage:   %{!fprofile-update=single:     %{pthread:-fprofile-update=prefer-atomic}}}

*cc1plus:


*link_gcc_c_sequence:
%{mads|myellowknife|mmvme|msim:%G %L %G;!mcall-*|mcall-linux:%{static|static-pie:--start-group} %G %{!nolibc:%L}    %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}};:%G %L %G}

*distro_defaults:
%{!fno-asynchronous-unwind-tables:-fasynchronous-unwind-tables} %{!fno-stack-protector:%{!fstack-protector-all:%{!ffreestanding:%{!nostdlib:%{!fstack-protector:-fstack-protector-strong}}}}} %{!Wformat:%{!Wformat=2:%{!Wformat=0:%{!Wall:-Wformat} %{!Wno-format-security:-Wformat-security}}}} %{!fno-stack-clash-protection:-fstack-clash-protection}

*link_ssp:
%{fstack-protector|fstack-protector-all|fstack-protector-strong|fstack-protector-explicit:}

*endfile:
%{mads         : %(endfile_ads)         ;   myellowknife : %(endfile_yellowknife) ;   mmvme        : %(endfile_mvme)        ;   msim         : %(endfile_sim)         ;   mcall-freebsd: %(endfile_freebsd)     ;   mcall-linux  : %(endfile_linux)       ;   mcall-netbsd : %(endfile_netbsd)      ;   mcall-openbsd: %(endfile_openbsd)     ;                : %(crtsavres_default) %(endfile_default)     }

*link:
%{!r:--build-id} %{!static|static-pie:--eh-frame-hdr} %{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} %{R*} %(link_shlib) %{!T*: %(link_start) } %{!static: %{!mbss-plt: %(link_secure_plt)}} %(link_os)

*lib:
%{mads         : %(lib_ads)         ;   myellowknife : %(lib_yellowknife) ;   mmvme        : %(lib_mvme)        ;   msim         : %(lib_sim)         ;   mcall-freebsd: %(lib_freebsd)     ;   mcall-linux  : %(lib_linux)       ;   mcall-netbsd : %(lib_netbsd)      ;   mcall-openbsd: %(lib_openbsd)     ;                : %(lib_default)     }

*link_gomp:


*libgcc:
%{static|static-libgcc|static-pie:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!static-pie:%{!shared-libgcc:-lgcc --push-state --as-needed -lgcc_s --pop-state}%{shared-libgcc:-lgcc_s%{!shared: -lgcc}}}}}

*startfile:
%{mads         : %(startfile_ads)         ;   myellowknife : %(startfile_yellowknife) ;   mmvme        : %(startfile_mvme)        ;   msim         : %(startfile_sim)         ;   mcall-freebsd: %(startfile_freebsd)     ;   mcall-linux  : %(startfile_linux)       ;   mcall-netbsd : %(startfile_netbsd)      ;   mcall-openbsd: %(startfile_openbsd)     ;                : %(startfile_default)     }

*cross_compile:
0

*version:
12.2.0

*multilib:
. !m64 !m32;.:../lib:powerpc64le-linux-gnu m64 !m32;.:../lib32:powerpcle-linux-gnu !m64 m32;

*multilib_defaults:
m64

*multilib_extra:


*multilib_matches:
m64 m64;m32 m32;

*multilib_exclusions:


*multilib_options:
m64/m32

*multilib_reuse:


*linker:
collect2

*linker_plugin_file:


*lto_wrapper:


*lto_gcc:


*post_link:


*link_libgcc:
%D

*md_exec_prefix:


*md_startfile_prefix:


*md_startfile_prefix_1:


*startfile_prefix_spec:


*sysroot_spec:
--sysroot=%R

*sysroot_suffix_spec:


*sysroot_hdrs_suffix_spec:


*self_spec:


*cpp_default:


*asm_cpu:
%{mcpu=native: %(asm_cpu_native);   mcpu=power10: -mpower10;   mcpu=power9: -mpower9;   mcpu=power8|mcpu=powerpc64le: %{mpower9-vector: -mpower9;: -mpower8};   mcpu=power7: -mpower7;   mcpu=power6x: -mpower6 %{!mvsx:%{!maltivec:-maltivec}};   mcpu=power6: -mpower6 %{!mvsx:%{!maltivec:-maltivec}};   mcpu=power5+: -mpower5;   mcpu=power5: -mpower5;   mcpu=power4: -mpower4;   mcpu=power3: -mppc64;   mcpu=powerpc: -mppc;   mcpu=powerpc64: -mppc64;   mcpu=a2: -ma2;   mcpu=cell: -mcell;   mcpu=rs64: -mppc64;   mcpu=401: -mppc;   mcpu=403: -m403;   mcpu=405: -m405;   mcpu=405fp: -m405;   mcpu=440: -m440;   mcpu=440fp: -m440;   mcpu=464: -m440;   mcpu=464fp: -m440;   mcpu=476: -m476;   mcpu=476fp: -m476;   mcpu=505: -mppc;   mcpu=601: -m601;   mcpu=602: -mppc;   mcpu=603: -mppc;   mcpu=603e: -mppc;   mcpu=ec603e: -mppc;   mcpu=604: -mppc;   mcpu=604e: -mppc;   mcpu=620: -mppc64;   mcpu=630: -mppc64;   mcpu=740: -mppc;   mcpu=750: -mppc;   mcpu=G3: -mppc;   mcpu=7400: -mppc %{!mvsx:%{!maltivec:-maltivec}};   mcpu=7450: -mppc %{!mvsx:%{!maltivec:-maltivec}};   mcpu=G4: -mppc %{!mvsx:%{!maltivec:-maltivec}};   mcpu=801: -mppc;   mcpu=821: -mppc;   mcpu=823: -mppc;   mcpu=860: -mppc;   mcpu=970: -mpower4 %{!mvsx:%{!maltivec:-maltivec}};   mcpu=G5: -mpower4 %{!mvsx:%{!maltivec:-maltivec}};   mcpu=8540: -me500;   mcpu=8548: -me500;   mcpu=e300c2: -me300;   mcpu=e300c3: -me300;   mcpu=e500mc: -me500mc;   mcpu=e500mc64: -me500mc64;   mcpu=e5500: -me5500;   mcpu=e6500: -me6500;   mcpu=titan: -mtitan;   !mcpu*: %{mpower9-vector: -mpower9; 	    mpower8-vector|mcrypto|mdirect-move|mhtm: -mpower8; 	    mvsx: -mpower7; 	    mpowerpc64: -mppc64;: %(asm_default)};   :%eMissing -mcpu option in ASM_CPU_SPEC?
} %{mvsx: -mvsx -maltivec; maltivec: -maltivec} -many

*asm_cpu_native:
%:local_cpu_detect(asm)

*asm_default:
-mpower8

*cc1_cpu:
%{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}  %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}

*crtsavres_default:


*lib_ads:
--start-group -lads -lc --end-group

*lib_yellowknife:
--start-group -lyk -lc --end-group

*lib_mvme:
--start-group -lmvme -lc --end-group

*lib_sim:
--start-group -lsim -lc --end-group

*lib_freebsd:
							  %{!shared:		    %{!pg: %{pthread:-lpthread} -lc}					    %{pg:  %{pthread:-lpthread_p} -lc_p}				  }		  %{shared:								    %{pthread:-lpthread} -lc						  }

*lib_linux:
%{mnewlib: --start-group -llinux -lc --end-group;      :%{pthread:-lpthread} %{shared:-lc}    %{!shared:%{profile:-lc_p}%{!profile:-lc}}}

*lib_netbsd:
-lc

*lib_openbsd:
%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}

*lib_default:
%(lib_linux)

*startfile_ads:
ecrti.o%s crt0.o%s crtbegin.o%s

*startfile_yellowknife:
ecrti.o%s crt0.o%s crtbegin.o%s

*startfile_mvme:
ecrti.o%s crt0.o%s crtbegin.o%s

*startfile_sim:
ecrti.o%s sim-crt0.o%s crtbegin.o%s

*startfile_freebsd:
%{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} 		       %{!p:%{profile:gcrt1.o%s} 			 %{!profile:                             %{pie: Scrt1.o%s;:crt1.o%s}}}}}    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}

*startfile_linux:
%{shared:;      pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s};      static:crt1.o%s;      static-pie:rcrt1.o%s;      !no-pie:Scrt1.o%s;      :crt1.o%s} %{mnewlib:ecrti.o%s;:crti.o%s}    %{static:crtbeginT.o%s;      shared|static-pie|!no-pie:crtbeginS.o%s;      :crtbegin.o%s}    %{fvtable-verify=none:%s;      fvtable-verify=preinit:vtv_start_preinit.o%s;      fvtable-verify=std:vtv_start.o%s} %{fopenacc|fopenmp:crtoffloadbegin%O%s}

*startfile_netbsd:
ncrti.o%s crt0.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}

*startfile_openbsd:
%{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}

*startfile_default:
%(startfile_linux)

*endfile_ads:
crtend.o%s ecrtn.o%s

*endfile_yellowknife:
crtend.o%s ecrtn.o%s

*endfile_mvme:
crtend.o%s ecrtn.o%s

*endfile_sim:
crtend.o%s ecrtn.o%s

*endfile_freebsd:
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s

*endfile_linux:
%{!static:%{fvtable-verify=none:%s;      fvtable-verify=preinit:vtv_end_preinit.o%s;      fvtable-verify=std:vtv_end.o%s}}    %{static:crtend.o%s;      shared|static-pie|!no-pie:crtendS.o%s;      :crtend.o%s} %{mnewlib:ecrtn.o%s;:crtn.o%s} %{fopenacc|fopenmp:crtoffloadend%O%s}

*endfile_netbsd:
%{!shared:crtend.o%s} %{shared:crtendS.o%s} ncrtn.o%s

*endfile_openbsd:
%{!shared:crtend.o%s} %{shared:crtendS.o%s}

*endfile_default:
%(endfile_linux)

*link_shlib:
%{shared:-shared} %{!shared: %{static:-static}}   %{static-pie:-static -pie --no-dynamic-linker -z text}

*link_start:
%{mads         : %(link_start_ads)         ;   myellowknife : %(link_start_yellowknife) ;   mmvme        : %(link_start_mvme)        ;   msim         : %(link_start_sim)         ;   mcall-freebsd: %(link_start_freebsd)     ;   mcall-linux  : %(link_start_linux)       ;   mcall-netbsd : %(link_start_netbsd)      ;   mcall-openbsd: %(link_start_openbsd)     ;                : %(link_start_default)     }

*link_start_ads:
-T ads.ld%s

*link_start_yellowknife:
-T yellowknife.ld%s

*link_start_mvme:
-Ttext 0x40000

*link_start_sim:


*link_start_freebsd:


*link_start_linux:


*link_start_netbsd:


*link_start_openbsd:
-Ttext 0x400074

*link_start_default:
%(link_start_linux)

*link_os:
%{mads         : %(link_os_ads)         ;   myellowknife : %(link_os_yellowknife) ;   mmvme        : %(link_os_mvme)        ;   msim         : %(link_os_sim)         ;   mcall-freebsd: %(link_os_freebsd)     ;   mcall-linux  : %(link_os_linux)       ;   mcall-netbsd : %(link_os_netbsd)      ;   mcall-openbsd: %(link_os_openbsd)     ;                : %(link_os_default)     }

*link_os_ads:


*link_os_yellowknife:


*link_os_mvme:


*link_os_sim:
-m elf32ppcsim

*link_os_freebsd:
  %{p:%nconsider using '-pg' instead of '-p' with gprof(1)}   %{v:-V}   %{assert*} %{R*} %{rpath*} %{defsym*}   %{shared:-Bshareable %{h*} %{soname*}}   %{!shared:     %{!static:       %{rdynamic: -export-dynamic}       -dynamic-linker %(fbsd_dynamic_linker) }     %{static:-Bstatic}}   %{symbolic:-Bsymbolic}

*link_os_linux:
%{m32:%(link_os_linux_spec32)}%{!m32:%(link_os_linux_spec64)}

*link_os_netbsd:
%{!shared: %{!static:   %{rdynamic:-export-dynamic}   -dynamic-linker /usr/libexec/ld.elf_so}}

*link_os_openbsd:


*link_os_default:
%(link_os_linux)

*cc1_secure_plt_default:
-msecure-plt

*link_secure_plt:
%{m32: --secure-plt}

*cpp_os_ads:


*cpp_os_yellowknife:


*cpp_os_mvme:


*cpp_os_sim:


*cpp_os_freebsd:
  -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__   -Acpu=powerpc -Amachine=powerpc

*cpp_os_linux:
%{pthread:-D_REENTRANT}

*cpp_os_netbsd:
-D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__

*cpp_os_openbsd:
%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}

*cpp_os_default:
%(cpp_os_linux) %(include_extra)

*fbsd_dynamic_linker:
/usr/libexec/ld-elf.so.1

*asm_spec_common:
%(asm_cpu) %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}%{mlittle|mlittle-endian: -mlittle;mbig|mbig-endian: -mbig;mcall-i960-old: -mlittle;: -mlittle}

*asm_spec32:
-a32 %{mrelocatable} %{mrelocatable-lib} %{fno-pie|fno-PIE|fno-pic|fno-PIC:;:-K PIC} %{memb|msdata=eabi: -memb}

*asm_spec64:
-a64

*link_os_linux_spec32:
%{mlittle|mlittle-endian: -m elf32lppclinux;mbig|mbig-endian: -m elf32ppclinux;mcall-i960-old: -m elf32lppclinux;: -m elf32lppclinux} --hash-style=gnu %{!fsanitize=*:--as-needed} %{!shared: %{!static:   %{!static-pie:     %{rdynamic:-export-dynamic}     -dynamic-linker %{muclibc:/lib/ld-uClibc.so.0;:%{mbionic:/system/bin/linker;:%{mmusl:/lib/ld-musl-powerpc%{mlittle|mlittle-endian:le;mbig|mbig-endian:;mcall-i960-old:le;:le}%{msoft-float:-sf}.so.1;:%(dynamic_linker_prefix)/lib/ld.so.1}}}}}}   %(link_os_extra_spec32)

*link_os_linux_spec64:
%{mlittle|mlittle-endian: -m elf64lppc;mbig|mbig-endian: -m elf64ppc;mcall-i960-old: -m elf64lppc;: -m elf64lppc} --hash-style=gnu %{!fsanitize=*:--as-needed} %{!shared: %{!static:   %{!static-pie:     %{rdynamic:-export-dynamic}     -dynamic-linker %{muclibc:/lib/ld64-uClibc.so.0;:%{mbionic:/system/bin/linker64;:%{mmusl:/lib/ld-musl-powerpc64%{mlittle|mlittle-endian:le;mbig|mbig-endian:;mcall-i960-old:le;:le}%{msoft-float:-sf}.so.1;:%{mabi=elfv1:%(dynamic_linker_prefix)/lib64/ld64.so.1;:%(dynamic_linker_prefix)/lib64/ld64.so.2}}}}}}}   %(link_os_extra_spec64)

*link_os_extra_spec32:


*link_os_extra_spec64:


*link_os_new_dtags:


*include_extra:


*dynamic_linker_prefix:


*link_command:
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %{!fno-use-linker-plugin:%{!fno-lto:     -plugin %(linker_plugin_file)     -plugin-opt=%(lto_wrapper)     -plugin-opt=-fresolution=%u.res         %{flinker-output=*:-plugin-opt=-linker-output-known}     %{!nostdlib:%{!nodefaultlibs:%:pass-through-libs(%(link_gcc_c_sequence))}}     }}%{flto|flto=*:%<fcompare-debug*}     %{flto} %{fno-lto} %{flto=*} %l %{static|shared|r:;!no-pie:-pie -z now} %{fuse-ld=*:-fuse-ld=%*}  %{gz|gz=zlib:--compress-debug-sections=zlib} %{gz=none:--compress-debug-sections=none} %{gz=zlib-gnu:--compress-debug-sections=zlib-gnu}  -z relro %X %{o*} %{e*} %{N} %{n} %{r}    %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}}     %{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) %{fvtable-verify=none:} %{fvtable-verify=std:   %e-fvtable-verify=std is not supported in this configuration} %{fvtable-verify=preinit:   %e-fvtable-verify=preinit is not supported in this configuration} %{!nostdlib:%{!r:%{!nodefaultlibs:%{%:sanitize(address):%{!shared:libasan_preinit%O%s} %{static-libasan:%{!shared:-Bstatic --whole-archive -lasan --no-whole-archive -Bdynamic}}%{!static-libasan:--push-state --no-as-needed -lasan --pop-state}}     %{%:sanitize(hwaddress):%{static-libhwasan:%{!shared:-Bstatic --whole-archive -lhwasan --no-whole-archive -Bdynamic}}%{!static-libhwasan:--push-state --no-as-needed -lhwasan --pop-state}}     %{%:sanitize(thread):%{!shared:libtsan_preinit%O%s} %{static-libtsan:%{!shared:-Bstatic --whole-archive -ltsan --no-whole-archive -Bdynamic}}%{!static-libtsan:--push-state --no-as-needed -ltsan --pop-state}}     %{%:sanitize(leak):%{!shared:liblsan_preinit%O%s} %{static-liblsan:%{!shared:-Bstatic --whole-archive -llsan --no-whole-archive -Bdynamic}}%{!static-liblsan:--push-state --no-as-needed -llsan --pop-state}}}}} %o      %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):	%:include(libgomp.spec)%(link_gomp)}    %{fgnu-tm:%:include(libitm.spec)%(link_itm)}    %(mflib)  %{fsplit-stack: -fuse-ld=gold --wrap=pthread_create}    %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} %{!nostdlib:%{!r:%{!nodefaultlibs:%{%:sanitize(address): %{static-libasan|static:%:include(libsanitizer.spec)%(link_libasan)}    %{static:%ecannot specify -static with -fsanitize=address}}    %{%:sanitize(hwaddress): %{static-libhwasan|static:%:include(libsanitizer.spec)%(link_libhwasan)}	%{static:%ecannot specify -static with -fsanitize=hwaddress}}    %{%:sanitize(thread): %{static-libtsan|static:%:include(libsanitizer.spec)%(link_libtsan)}    %{static:%ecannot specify -static with -fsanitize=thread}}    %{%:sanitize(undefined):%{static-libubsan:-Bstatic} %{!static-libubsan:--push-state --no-as-needed} -lubsan  %{static-libubsan:-Bdynamic} %{!static-libubsan:--pop-state} %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}}    %{%:sanitize(leak): %{static-liblsan|static:%:include(libsanitizer.spec)%(link_liblsan)}}}}}     %{!nostdlib:%{!r:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}}    %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*}  
%(post_link) }}}}}}

The same build failure can be produced on amd64 by adding '-O3' to CFLAGS.

Temporarily replacing pr_* functions with printf does indicate calls to xdp_program__name(prog) in xdp_multiprog__pin and xdp_multiprog__unpin potentially returning NULL.

So the question then becomes, under what circumstances can prog_name be NULL, and is this an issue of initial input validation or validation of return from call to xdp_program__name?

@tohojo thanks a lot for the quick turnaround, your proposal in #295 does indeed fix the build issue, and I trust your judgement on possible values for the data.

For the record a successful build with the patch can be viewed here: https://launchpadlibrarian.net/652970399/buildlog_ubuntu-lunar-ppc64el.xdp-tools_1.3.0-2ubuntu2_BUILDING.txt.gz