On Wed, 2024-12-04 at 10:41 +0100, Viktor Malik wrote: [...] > I was not quick enough to reply before this got merged, sorry about that. > > This will break situations when we want to pass extra flags to the > libbpf sub-make from the command line, e.g. to build samples as PIE: > > $ make TPROGS_USER_CFLAGS="-fpie" TPROGS_USER_LDFLAGS="-pie" > [...] > /usr/bin/ld: /bpf/samples/bpf/libbpf/libbpf.a(libbpf-in.o): > relocation R_X86_64_32 against `.rodata.str1.1' can not be used when > making a PIE object; recompile with -fPIE > /usr/bin/ld: failed to set dynamic section sizes: bad value > > I think that we should add > > COMMON_CFLAGS = $(TPROGS_USER_CFLAGS) > > somewhere to the top of the Makefile. Hi Viktor, This makes sense. Surprisingly enough, your example with -pie compiles successfully for me, both using clang and gcc. I'll post an update adding the suggested line. Thanks, Eduard