[Ns-bugs] [Bug 1253] relocation R_X86_64_PC32 against undefined symbol
code@nsnam.ece.gatech.edu
code at nsnam.ece.gatech.edu
Mon Aug 29 13:17:17 PDT 2011
https://www.nsnam.org/bugzilla/show_bug.cgi?id=1253
--- Comment #12 from John Abraham <jabraham3 at mail.gatech.edu> 2011-08-29 16:17:17 EDT ---
(In reply to comment #10)
> 1) The main point of static builds is to _not_ use fpic so, if you use it, you
> are basically silently ignoring the configure-time option. Not good. So, what
> is needed if this really does not work is to output a configure-time warning
> saying that the static build+python bindings are not compatible and disable one
> of the two automatically to proceed
>
> 2) Anyway, erm, the build command looks really weird:
> '/usr/bin/g++', 'optimized/src/point-to-point-layout/bindings/ns3module_4.o',
> '-o',
> '/home/john/ns-3.12-rc2/ns-allinone-3.12-RC2/ns-3.12/build/optimized/bindings/python/ns/point_to_point_layout.so',
> '-Wl,--whole-archive,-Bstatic', '-lns3-core', '-lns3-network',
> '-lns3-config-store', '-lns3-internet', '-lns3-propagation',
> '-lns3-point-to-point', '-lns3-csma', '-lns3-emu', '-lns3-bridge',
> '-lns3-tap-bridge', '-lns3-virtual-net-device', '-lns3-applications',
> '-lns3-nix-vector-routing', '-lns3-olsr', '-lns3-aodv', '-lns3-dsdv',
> '-lns3-mobility', '-lns3-wifi', '-lns3-netanim', '-lns3-stats', '-lns3-uan',
> '-lns3-spectrum', '-lns3-mesh', '-lns3-test', '-lns3-ns3tcp', '-lns3-ns3wifi',
> '-lns3-flow-monitor', '-lns3-wimax', '-lns3-lte', '-lns3-mpi',
> '-lns3-topology-read', '-lns3-energy', '-lns3-tools', '-lns3-visualizer',
> '-lns3-point-to-point-layout', '-lns3-csma-layout', '-lns3-template',
> '-Wl,-Bdynamic,--no-whole-archive', '-shared', '-Wl,-Bsymbolic-functions',
> '-pthread', '-pthread', '-Loptimized', '-L/usr/lib',
> '-L/usr/lib/x86_64-linux-gnu', '-Wl,--whole-archive,-Bstatic',
> '-Wl,-Bdynamic,--no-whole-archive', '-lm', '-lpthread', '-ldl', '-lutil',
> '-lpython2.7', '-lsqlite3', '-lxml2', '-lgtk-x11-2.0', '-lgdk-x11-2.0',
> '-latk-1.0', '-lgio-2.0', '-lpangoft2-1.0', '-lpangocairo-1.0',
> '-lgdk_pixbuf-2.0', '-lcairo', '-lpango-1.0', '-lfreetype', '-lfontconfig',
> '-lgobject-2.0', '-lgmodule-2.0', '-lgthread-2.0', '-lrt', '-lglib-2.0',
> '-lgsl', '-lgslcblas']
>
> This is building an executable that has a .so as extension ? wtf ? Can you try
> to run this command by hand and add a -shared option to it right after g++ ?
>
> What you want here is a shared library that will be dynamically loaded later
> but that was not built with -fPIC. So, the link line needs a -shared.
I tried this
/usr/bin/g++ -shared
./build/optimized/src/point-to-point-layout/bindings/ns3module_4.o -o
/home/john/ns-3.12-rc2/ns-allinone-3.12-RC2/ns-3.12/build/optimized/bindings/python/ns/point_to_point_layout.so
-Wl --whole-archive -Bstatic -L
/home/john/ns-3.12-rc2/ns-allinone-3.12-RC2/ns-3.12/build/optimized -lns3-core
-lns3-network -lns3-config-store -lns3-internet -lns3-propagation
-lns3-point-to-point -lns3-csma -lns3-emu -lns3-bridge -lns3-tap-bridge
-lns3-virtual-net-device -lns3-applications -lns3-nix-vector-routing
-lns3-olsr -lns3-aodv -lns3-dsdv -lns3-mobility -lns3-wifi -lns3-netanim
-lns3-stats -lns3-uan -lns3-spectrum -lns3-mesh -lns3-test -lns3-ns3tcp
-lns3-ns3wifi -lns3-flow-monitor -lns3-wimax -lns3-lte -lns3-mpi
-lns3-topology-read -lns3-energy -lns3-tools -lns3-visualizer
-lns3-point-to-point-layout -lns3-csma-layout -lns3-template -Wl -Bdynamic
--no-whole-archive -shared -Wl -Bsymbolic-functions -pthread -pthread
-Loptimized -L/usr/lib -L/usr/lib/x86_64-linux-gnu -Wl --whole-archive
-Bstatic -Wl -Bdynamic --no-whole-archive -lm -lpthread -ldl -lutil
-lpython2.7 -lsqlite3 -lxml2 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
-lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo
-lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0
-lgthread-2.0 -lrt -lglib-2.0
john at john-VirtualBox:~/ns-3.12-rc2/ns-allinone-3.12-RC2/ns-3.12$
john at john-VirtualBox:~/ns-3.12-rc2/ns-allinone-3.12-RC2/ns-3.12$
john at john-VirtualBox:~/ns-3.12-rc2/ns-allinone-3.12-RC2/ns-3.12$ ls -l
build/optimized/bindings/python/ns/
total 21632
-rw-r--r-- 1 john john 518 2011-08-27 16:36 core.py
-rw-r--r-- 1 john john 1 2011-08-27 16:36 __init__.py
-rwxr-xr-x 1 john john 22141379 2011-08-29 16:10 point_to_point_layout.so
john at john-VirtualBox:~/ns-3.12-rc2/ns-allinone-3.12-RC2/ns-3.12$
I'm following this, the problem is with the "--enable-static" option, wouldn't
"-shared" be similar to adding fPIC again?
--
Configure bugmail: https://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Ns-bugs
mailing list