Build link error bundled pjproject : relocation against symbol cant be used when shared object

After try to compile bundled pjproject got that error:

/usr/bin/ld: res_pjsip_session.o: relocation R_X86_64_PC32 against symbol ast_sip_session_media_state_reset can not be used when making a shared object; recompile with -fPIC

But i already compiled with PIC as output show:

[  598s] x86_64-linux-gnu-gcc -o res_pjsip_session.o -c res_pjsip_session.c -MD -MT res_pjsip_session.o -MF .res_pjsip_session.o.d -MP -pthread -I/usr/src/packages/BUILD/include -fgnu89-inline -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2   -I/usr/include/libxml2  -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations       -fPIC -DAST_MODULE=\"res_pjsip_session\" -DAST_MODULE_SELF_SYM=__internal_res_pjsip_session_self  -DPJ_AUTOCONF=1 -fgnu89-inline -fPIE -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -I/usr/src/packages/BUILD/third-party/pjproject/source/pjlib/include -I/usr/src/packages/BUILD/third-party/pjproject/source/pjlib-util/include -I/usr/src/packages/BUILD/third-party/pjproject/source/pjnath/include -I/usr/src/packages/BUILD/third-party/pjproject/source/pjmedia/include -I/usr/src/packages/BUILD/third-party/pjproject/source/pjsip/include  
[  600s] /usr/src/packages/BUILD/build_tools/make_linker_version_script res_pjsip_session "" "/usr/src/packages/BUILD"
[  600s] x86_64-linux-gnu-gcc -o -pthread -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed    -shared -Wl,--version-script,res_pjsip_session.exports,--warn-common  res_pjsip_session.o  
[  600s] /usr/bin/ld: res_pjsip_session.o: relocation R_X86_64_PC32 against symbol `ast_sip_session_media_state_reset' can not be used when making a shared object; recompile with -fPIC
[  600s] /usr/bin/ld: final link failed: Bad value
[  600s] collect2: error: ld returned 1 exit status
[  600s] /usr/src/packages/BUILD/Makefile.rules:179: recipe for target '' failed
[  600s] make[3]: *** [] Error 1
[  600s] make[3]: Leaving directory '/usr/src/packages/BUILD/res'
[  600s] Makefile:383: recipe for target 'res' failed
[  600s] make[2]: *** [res] Error 2
[  600s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  600s] dh_auto_build: make -j1 AST_FORTIFY_SOURCE= DEBUG= OPTIMIZE= NOISY_BUILD=yes ASTDATADIR=/usr/share/asterisk ASTVARRUNDIR=/var/run/asterisk returned exit code 2

From asterisk a interesting comment:

Malcolm Davenport added a comment - 2 minutes ago

NOTE IMPORTANT: quite stupid do not build agains well updated external pjproject! nonsense!

You may feel that this comment and other, similar comments you’ve made on the community forums are benign and are merely expressing your frustration. Others may take offense to them. I encourage you to be more considerate with your phrasing.

! make a importnat note: when you ask to vendor, to communituy and ask due a problem common response are "upgrade and use lasted"

are the bundled pjproject lasted and upgraded version? or a just hacked by asterisk?

quite frustrating? yes obviously! sorry BUT ITS THE TRUE!

That makes it look like I said that “NOTE IMPORTANT…”

My actual comment is what begins with the “You may feel…” and was in response to your “NOTE IMPORTANT…” up to your “nonsense!”

The Jira ticket you opened is here:

There’s no good reason for duplicating things here and there. My comment was made there, because your posting here didn’t include your “NOTE IMPORTANT” comment.

And, as there are more pertinent notes on the Jira ticket. I’m closing this thread.