Solved Arduino CLI - Can't compile/upload code from CLI

Hello everyone,

following https://wiki.freebsd.org/Arduino I created the Makefile but upon running make install flash clean cleandepend I get the following error:
Code:
kodcode@inspiron:~/ArduinoMake $ make install flash clean cleandepend
avr-gcc -mmcu=atmega328p -g -std=gnu99 -Os -fno-exceptions -fno-threadsafe-statics -ffunction-sections -fdata-sections -DF_CPU=16000000L -DARDUINO=106 -DARDUINO_MAXIMUM_SIZE=32256 -I. -I/usr/home/kodcode/ArduinoMake -I/usr/local/arduino/hardware/arduino/cores/arduino -I/usr/local/arduino/hardware/arduino/variants/standard -fPIE -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wno-error=address -Wno-error=array-bounds -Wno-error=attributes -Wno-error=bool-compare -Wno-error=cast-align -Wno-error=clobbered -Wno-error=deprecated-declarations -Wno-error=enum-compare -Wno-error=extra -Wno-error=logical-not-parentheses -Wno-error=strict-aliasing -Wno-error=uninitialized -Wno-error=unused-but-set-variable -Wno-error=unused-function -Wno-error=unused-value -Wno-error=empty-body -Wno-error=maybe-uninitialized -Wno-error=nonnull-compare -Wno-error=redundant-decls -Wno-error=shift-negative-value -Wno-error=tautological-compare -Wno-error=unused-const-variable -Wno-error=bool-operation -Wno-error=deprecated -Wno-error=expansion-to-defined -Wno-error=format-overflow -Wno-error=format-truncation -Wno-error=implicit-fallthrough -Wno-error=int-in-bool-context -Wno-error=memset-elt-size -Wno-error=noexcept-type -Wno-error=nonnull -Wno-error=pointer-compare -Wno-error=stringop-overflow -Wno-error=aggressive-loop-optimizations -Wno-error=cast-function-type -Wno-error=catch-value -Wno-error=multistatement-macros -Wno-error=restrict -Wno-error=sizeof-pointer-memaccess -Wno-error=stringop-truncation -mmcu=atmega328p -Wl,--gc-sections -Os -pie   -o blink.elf blink.o  libarduino.a -lm -lc 
/usr/local/lib/gcc/avr/11.2.0/../../../../avr/bin/ld: -pie not supported
collect2: error: ld returned 1 exit status
*** Error code 1

Can someone kindly help with this?

Many thanks in advance,

kodcode
 
Thanks to @koobs for this workaround for now:
make LDFLAGS=-fno-pie install flash clean cleandepend
 
Thanks to Craig Leres for fixing the port now.

Adding
Code:
NO_SHARED=
to bsd.arduino.mk solved it.
 
Top