Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 639748 - [freeswitch overlay] net-voip/freeswitch - ld: -r and -pie may not be used together
Summary: [freeswitch overlay] net-voip/freeswitch - ld: -r and -pie may not be used to...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major with 1 vote (vote)
Assignee: Michael Seifert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-04 11:10 UTC by Joe M
Modified: 2018-02-21 05:07 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Freeswitch build failure log (freeswitch.log,600.43 KB, text/x-log)
2018-02-04 01:22 UTC, Joe M
Details
Build error with --enable-zrtp on debian 9 and similar newer gcc versions (0001-FS-10471-build-fix-build-error-on-debian-9-with-enab.patch,829 bytes, patch)
2018-02-04 04:02 UTC, Joe M
Details | Diff
The attached FS-10471 fix is not helping (zrtp-compilation-fix.patch,1.76 KB, patch)
2018-02-04 05:37 UTC, Joe M
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joe M 2017-12-04 11:10:11 UTC
Hello,

Freeswitch does not build when using the 17.0 profile.

/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: -r and -pie may not be used together
collect2: error: ld returned 1 exit status
libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I./crypto/include -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops -I./src -Icrypto/include -I./include -I./crypto/include -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops -I./src -Icrypto/include -I./include -I./crypto/include -O2 -march=native -pipe -O2 -march=native -pipe -c crypto/math/math.c  -fPIC -DPIC -o math.o
make[2]: *** [Makefile:75: lbn00.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/net-voip/freeswitch-1.6.19/work/freeswitch-1.6.19/libs/libzrtp/third_party/bnlib'
make[1]: *** [Makefile:1167: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/net-voip/freeswitch-1.6.19/work/freeswitch-1.6.19/libs/libzrtp'
make: *** [Makefile:3903: libs/libzrtp/libzrtp.a] Error 2
.
.
.
.


    [CREATE] vpx.pc
    [AR] libvpx_g.a
    [STRIP] libvpx.a < libvpx_g.a
make[1]: Leaving directory '/var/tmp/portage/net-voip/freeswitch-1.6.19/work/freeswitch-1.6.19/libs/libvpx'
 * ERROR: net-voip/freeswitch-1.6.19::freeswitch failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=net-voip/freeswitch-1.6.19::freeswitch'`,
 * the complete build log and the output of `emerge -pqv '=net-voip/freeswitch-1.6.19::freeswitch'`.
 * The complete build log is located at '/var/log/portage/net-voip:freeswitch-1.6.19:20171204-105041.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/net-voip/freeswitch-1.6.19/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-voip/freeswitch-1.6.19/temp/environment'.
 * Working directory: '/var/tmp/portage/net-voip/freeswitch-1.6.19/work/freeswitch-1.6.19'
 * S: '/var/tmp/portage/net-voip/freeswitch-1.6.19/work/freeswitch-1.6.19'
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="" JAVA_HOME=""
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info =freeswitch-1.6.19
 * !!! User patches were applied to this build!

>>> Failed to emerge net-voip/freeswitch-1.6.19, Log file:

>>>  '/var/log/portage/net-voip:freeswitch-1.6.19:20171204-105041.log'

 * Messages for package net-voip/freeswitch-1.6.19:
 * Log file: /var/log/portage/net-voip:freeswitch-1.6.19:20171204-105041.log

 * ERROR: net-voip/freeswitch-1.6.19::freeswitch failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=net-voip/freeswitch-1.6.19::freeswitch'`,
 * the complete build log and the output of `emerge -pqv '=net-voip/freeswitch-1.6.19::freeswitch'`.
 * The complete build log is located at '/var/log/portage/net-voip:freeswitch-1.6.19:20171204-105041.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/net-voip/freeswitch-1.6.19/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-voip/freeswitch-1.6.19/temp/environment'.
 * Working directory: '/var/tmp/portage/net-voip/freeswitch-1.6.19/work/freeswitch-1.6.19'
 * S: '/var/tmp/portage/net-voip/freeswitch-1.6.19/work/freeswitch-1.6.19'

Thanks
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2017-12-05 15:58:19 UTC
-fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops

Please post your `emerge --info` output in a comment.
Comment 2 Rajil Saraswat 2017-12-16 23:07:24 UTC
I have been to compiling freeswitch manually as well with 17.0 profile. I get similar error,


make[2]: Leaving directory '/home/xx/tmp/fs1.6/freeswitch.git/libs/apr-util'
make[1]: Leaving directory '/home/xx/tmp/fs1.6/freeswitch.git/libs/apr-util'
  CXXLD    libfreeswitch_libyuv.la

*** Warning: Linking the shared library libfreeswitch_libyuv.la against the
*** static library libs/libzrtp/third_party/bnlib/libbn.a is not portable!
cd libs/libzrtp && make
make[1]: Entering directory '/home/xx/tmp/fs1.6/freeswitch.git/libs/libzrtp'
Making all in third_party/bnlib
make[2]: Entering directory '/home/xx/tmp/fs1.6/freeswitch.git/libs/libzrtp/third_party/bnlib'
gcc  -std=c99 -O2 -g3 -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -fPIC -DZRTP_AUTOMAKE=1    -DHAVE_CONFIG_H  -I../../include -I../../include/enterprise -I../../projects/gnu/config -I../../third_party/bgaes -I. -I. -o lbn00.o -Wl,-r -nostdlib lbn00.c -lgcc
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: -r and -pie may not be used together
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:75: lbn00.o] Error 1
make[2]: Leaving directory '/home/xx/tmp/fs1.6/freeswitch.git/libs/libzrtp/third_party/bnlib'
make[1]: *** [Makefile:1167: all-recursive] Error 1
make[1]: Leaving directory '/home/xx/tmp/fs1.6/freeswitch.git/libs/libzrtp'
make: *** [Makefile:3903: libs/libzrtp/libzrtp.a] Error 2
Comment 3 Joe M 2018-01-15 15:21:43 UTC
ugrading to the gcc-6.4.0 helped fix this issue.
Comment 4 Joe M 2018-01-15 15:22:46 UTC
ugrading to gcc-6.4.0 fixed the issue.
Comment 5 Joe M 2018-02-04 01:22:08 UTC
Created attachment 517716 [details]
Freeswitch build failure log

Hello,

This error has cropped up again and is failing the builds.

Thanks
Comment 6 Joe M 2018-02-04 01:23:20 UTC
Hello,

This error has cropped up again.

Please let me know if I can provide more details.

Thanks
Comment 7 Joe M 2018-02-04 02:43:37 UTC
https://freeswitch.org/jira/browse/FS-4260?jql=text%20~%20%22bnlib%22

is the relevant upstream fix. This issue is fixed in Freeswitch 1.8
Comment 8 Joe M 2018-02-04 02:50:48 UTC
This is more relevant

https://freeswitch.org/jira/browse/FS-10471
Comment 9 Joe M 2018-02-04 04:02:37 UTC
Created attachment 517720 [details, diff]
Build error with --enable-zrtp on debian 9 and similar newer gcc versions

from https://freeswitch.org/jira/browse/FS-10471
Comment 10 Joe M 2018-02-04 05:37:01 UTC
Created attachment 517722 [details, diff]
The attached FS-10471 fix is not helping

The original fix is only changing the configure.ac whereas the package is shipping configure too.

This patch fixes both configure.ac and configure
Comment 11 Michael Seifert 2018-02-20 18:43:29 UTC
I integrated Joe M's patch in the 1.6.19-r1 ebuild of the freeswitch overlay.
This allows FreeSwitch to be built using GCC 6.

I was hoping for an upstream release to fix this, but this works, too. Thanks for devising a patch. The Freeswitch build is utterly broken with all the bundled libs, so I appreciate your work!