Problem compiling "olsrd" package

Hello everyone, I am using OpenWrt 19.07. I got the following error while compiling the "olsrd" package.

error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O)

After doing some research, I saw that it might be related to the compilation flags and I changed the TARGET_CFLAGS += $(FPIC) to TARGET_CFLAGS += -O2 in the makefile of the "olsrd" package. But this time I got the following error.

collect2: error: ld returned 1 exit status

What could be the solution to these problems?

  • Is there a reason you're using an EOL version of OpenWrt?
  • And did you follow Building a single package?
  • On what host are you trying to build it (OS)?