[asterisk-bugs] [JIRA] (ASTERISK-28411) Build link error bundled pjproject : relocation against symbol cant be used when shared object

PICCORO Lenz McKAY (JIRA) noreply at issues.asterisk.org
Thu May 9 10:10:47 CDT 2019


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=247117#comment-247117 ] 

PICCORO Lenz McKAY edited comment on ASTERISK-28411 at 5/9/19 10:09 AM:
------------------------------------------------------------------------

updated issue with environment, please see it

about the compile command line:

* `-fPIE` was suggested by the compiler the firts time, but still error it happened
* ` - pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed`  are just only to do not link unneeded things.. that's do not break anything

in the linking case:

* `-fgnu89-inline -fPIE -fstack-protector-strong` don't make sense.. compiling without that got same error
* `-Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 ` this force security suppost do not affect compilation but i just try lateer that last change.. and post feedback here!


was (Author: mckaygerhard):
updated issue with environment, please see it

about the compile command line:

* `-fPIE` was suggested by the compiler the firts time, but still error happened
* `-pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed`  are just only to do not link unneed things.. that0s do not break anything

in the linking case:

* `-fgnu89-inline -fPIE -fstack-protector-strong` dont make sesnse.. copiling without that got same error
* `-Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 ` this force security suppost do not affect compilation but i just try lateer that last change.. and post feedback here!

> Build link error bundled pjproject : relocation against symbol cant be used when shared object
> ----------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-28411
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28411
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_pjsip, Third-Party/pjproject
>    Affects Versions: 16.0.0, 16.1.0, 16.1.1, 16.2.0, 16.2.1
>         Environment: OS: Debian in Proliant MX110GT tower
> GCC: 6 (also tried with gcc 4.9 and 4.6, same result) 
> Processor : Xeon 64bit
> RAM: 16G
>            Reporter: PICCORO Lenz McKAY
>            Assignee: Unassigned
>            Severity: Minor
>              Labels: pjsip
>
> 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, 
> NOTE IMPORTANT: quite stupid do not build agains well updated external pjproject! nonsense!
> {code}
> [  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 res_pjsip_session.so -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 'res_pjsip_session.so' failed
> [  600s] make[3]: *** [res_pjsip_session.so] 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
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list