0

I've been trying to compile Direct Code Execution (DCE) - an extension to the network simulator ns-3 that can run real programs (VLC, iperf) within the simulator via providing a fake POSIX layer - without success since my upgrade to ubuntu xenial. To compile DCE, you first run ./waf configure and finally you build the program:

$ LANG=C ./waf build  
Waf: Entering directory `/home/teto/dce/build'
[ 10/367] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[116/367] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
[248/367] cxxprogram: build/test/test-tsearch.cc.50.o -> build/bin_dce/test-tsearch
17:53:36 runner ['g++', '-Wl,--no-as-needed', '-pthread', '-pie', '-lrt', '-rdynamic', 'test/test-tsearch.cc.50.o', '-o', '/home/teto/dce/build/bin_dce/test-tsearch', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Llib', '-ltest']
[284/367] cxxprogram: build/example/dce-udp-simple.cc.68.o -> build/bin/dce-udp-simple
17:53:36 runner ['g++', '-Wl,--no-as-needed', '-pthread', '-pthread', '-Wl,-Bdynamic', '-pthread', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-pthread', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', 'example/dce-udp-simple.cc.68.o', '-o', '/home/teto/dce/build/bin/dce-udp-simple', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Llib', '-Llib', '-L/home/teto/ns3off/install/lib', '-L/home/teto/ns3off/install/lib', '-L/home/teto/ns3off/install/lib', '-lns3-dce', '-lns3-netlink', '-lns3-dev-core-debug', '-lrt', '-lns3-dev-internet-debug', '-lns3-dev-bridge-debug', '-lns3-dev-mpi-debug', '-lns3-dev-traffic-control-debug', '-lns3-dev-network-debug', '-lns3-dev-stats-debug', '-lns3-dev-core-debug', '-lrt', '-lns3-dev-network-debug', '-lns3-dev-stats-debug', '-lns3-dev-core-debug', '-lrt']
[286/367] cxxprogram: build/example/ccnx/dce-ccnd-simple.cc.69.o -> build/bin/dce-ccnd-simple
17:53:36 runner ['g++', '-Wl,--no-as-needed', '-pthread', '-pthread', '-Wl,-Bdynamic', '-pthread', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-pthread', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', 'example/ccnx/dce-ccnd-simple.cc.69.o', '-o', '/home/teto/dce/build/bin/dce-ccnd-simple', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Llib', '-Llib', '-L/home/teto/ns3off/install/lib', '-L/home/teto/ns3off/install/lib', '-L/home/teto/ns3off/install/lib', '-lns3-dce', '-lns3-netlink', '-lns3-dev-core-debug', '-lrt', '-lns3-dev-internet-debug', '-lns3-dev-bridge-debug', '-lns3-dev-mpi-debug', '-lns3-dev-traffic-control-debug', '-lns3-dev-network-debug', '-lns3-dev-stats-debug', '-lns3-dev-core-debug', '-lrt', '-lns3-dev-network-debug', '-lns3-dev-stats-debug', '-lns3-dev-core-debug', '-lrt']
[288/367] cxxprogram: build/example/ccnx/dce-ccnd-short-stuff.cc.70.o -> build/bin/dce-ccnd-short-stuff
17:53:36 runner ['g++', '-Wl,--no-as-needed', '-pthread', '-pthread', '-Wl,-Bdynamic', '-pthread', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-pthread', '-Wl,-Bdynamic', '-Wl,-Bdynamic', '-Wl,-Bdynamic', 'example/ccnx/dce-ccnd-short-stuff.cc.70.o', '-o', '/home/teto/dce/build/bin/dce-ccnd-short-stuff', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Llib', '-Llib', '-L/home/teto/ns3off/install/lib', '-L/home/teto/ns3off/install/lib', '-L/home/teto/ns3off/install/lib', '-lns3-dce', '-lns3-netlink', '-lns3-dev-core-debug', '-lrt', '-lns3-dev-internet-debug', '-lns3-dev-bridge-debug', '-lns3-dev-mpi-debug', '-lns3-dev-traffic-control-debug', '-lns3-dev-network-debug', '-lns3-dev-stats-debug', '-lns3-dev-core-debug', '-lrt', '-lns3-dev-network-debug', '-lns3-dev-stats-debug', '-lns3-dev-core-debug', '-lrt']
/usr/bin/ld: test/test-tsearch.cc.50.o(.text+0x2c5): unresolvable R_X86_64_PLTOFF64 relocation against symbol `free@@GLIBC_2.2.5'
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Waf: Leaving directory `/home/teto/dce/build'
Build failed
-> task in 'bin_dce/test-tsearch' failed (exit status 1): 
    {task 140451678565520: cxxprogram test-tsearch.cc.50.o -> test-tsearch}
['g++', '-Wl,--no-as-needed', '-pthread', '-pie', '-lrt', '-rdynamic', 'test/test-tsearch.cc.50.o', '-o', '/home/teto/dce/build/bin_dce/test-tsearch', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Llib', '-ltest']

I admit I've run out of ideas to fix this. It happened first when upgrading my compiler: gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2)

More info on: https://github.com/direct-code-execution/ns-3-dce/issues/46

Here is the result of : ./waf build -v https://transfer.sh/tj7uf/temp

And at https://transfer.sh/qE5Cd/link-step the results of:

LD_DEBUG=all LANG=C /usr/bin/g++ -Wl,--no-as-needed -pthread -pie -lrt -rdynamic test/test-tsearch.cc.50.o -o /home/teto/dce/build/bin_dce/test-tsearch -Wl,-Bstatic -Wl,-Bdynamic -Llib -ltest -lc > link_step 2>&1

(search for R_X86_64_PLTOFF64)

Looking forward to any hint

Cheers

mattator
  • 319
  • 3
  • 12
  • N.B. you can get it to print errors in English (so you don't need to translate them, and can google for them) by setting LANG=C before running the build. That is likely to produce an error more like "unresolved relocation blah blah". You're unlikely to get any good answers unless you provide more information about what you're doing, e.g. the exact linker command that fails. Currently your question is just "I'm doing something and it gives this error" ... you need to explain the "something". – Jonathan Wakely Jun 15 '16 at 23:18
  • Upgraded my message as you advised, did not find any helpful comments though. – mattator Jun 16 '16 at 16:05
  • hum adding -fPIC seems to do the trick. – mattator Jun 16 '16 at 16:22
  • In the end that didn't work. I've edited the message with more logs – mattator Jun 23 '16 at 19:50
  • did you try -Wl,-mcmodel=large ? – mathieu Oct 05 '16 at 11:43
  • btw, changing the linker solved it (seemed like a bug in it). – mattator Apr 08 '19 at 05:37

0 Answers0