0005-fix-static-detection-of-lock-free-atomic-ints.patch 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. From 48be99d20753ecab8817b030b95a7f1260aa777f Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Wed, 5 Sep 2018 12:04:15 +0200
  4. Subject: [PATCH 17/17] fix static detection of lock-free atomic ints
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. When build statically, boost is unable to detect lock-free atomics ints
  9. because it tries to link dynamically with boost_system, see
  10. output/build/boost-1.67.0/bin.v2/config.log (with -d5 option):
  11. Using shell: /bin/sh -c
  12. argv[0] = '/bin/sh'
  13. argv[1] = '-c'
  14. argv[2] = '
  15. "/home/fabrice/buildroot/output/host/bin/arm-linux-g++" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -Wl,-elf2flt -static -Wl,-elf2flt -static -fPIC -pthread -O0 -fno-inline -Wall -pedantic -g -Wextra -Wno-long-long -Wno-unused-parameter -Wunused-function -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_THREAD_BUILD_DLL=1 -I"." -c -o "bin.v2/libs/thread/build/gcc-6.4.0/debug/threading-multi/has_atomic_flag_lockfree_test.o" "libs/thread/src/../build/has_atomic_flag_lockfree_test.cpp"
  16. '
  17. gcc.compile.c++ bin.v2/libs/thread/build/gcc-6.4.0/debug/threading-multi/has_atomic_flag_lockfree_test.o
  18. "/home/fabrice/buildroot/output/host/bin/arm-linux-g++" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -Wl,-elf2flt -static -Wl,-elf2flt -static -fPIC -pthread -O0 -fno-inline -Wall -pedantic -g -Wextra -Wno-long-long -Wno-unused-parameter -Wunused-function -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_THREAD_BUILD_DLL=1 -I"." -c -o "bin.v2/libs/thread/build/gcc-6.4.0/debug/threading-multi/has_atomic_flag_lockfree_test.o" "libs/thread/src/../build/has_atomic_flag_lockfree_test.cpp"
  19. 0.033561 sec system; 0.126314 sec user; 288.682473 sec clock
  20. gcc.compile.c++ bin.v2/libs/system/build/gcc-6.4.0/debug/threading-multi/error_code.o
  21. "/home/fabrice/buildroot/output/host/bin/arm-linux-g++" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -Wl,-elf2flt -static -Wl,-elf2flt -static -fPIC -pthread -O0 -fno-inline -Wall -pedantic -g -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_DYN_LINK=1 -I"." -c -o "bin.v2/libs/system/build/gcc-6.4.0/debug/threading-multi/error_code.o" "libs/system/src/error_code.cpp"
  22. 0.084060 sec system; 0.644133 sec user; 8.858824 sec clock
  23. SEM: <s>gcc-link-semaphore now used by <pbin.v2/libs/system/build/gcc-6.4.0/debug/threading-multi>libboost_system.so.1.67.0
  24. Using shell: /bin/sh -c
  25. argv[0] = '/bin/sh'
  26. argv[1] = '-c'
  27. argv[2] = '
  28. "/home/fabrice/buildroot/output/host/bin/arm-linux-g++" -o "bin.v2/libs/system/build/gcc-6.4.0/debug/threading-multi/libboost_system.so.1.67.0" -Wl,-h -Wl,libboost_system.so.1.67.0 -shared -Wl,--start-group "bin.v2/libs/system/build/gcc-6.4.0/debug/threading-multi/error_code.o" -Wl,-Bstatic -Wl,-Bdynamic -lrt -Wl,--end-group -fPIC -pthread -g -Wl,-elf2flt -static
  29. '
  30. gcc.link.dll bin.v2/libs/system/build/gcc-6.4.0/debug/threading-multi/libboost_system.so.1.67.0
  31. "/home/fabrice/buildroot/output/host/bin/arm-linux-g++" -o "bin.v2/libs/system/build/gcc-6.4.0/debug/threading-multi/libboost_system.so.1.67.0" -Wl,-h -Wl,libboost_system.so.1.67.0 -shared -Wl,--start-group "bin.v2/libs/system/build/gcc-6.4.0/debug/threading-multi/error_code.o" -Wl,-Bstatic -Wl,-Bdynamic -lrt -Wl,--end-group -fPIC -pthread -g -Wl,-elf2flt -static
  32. ld (ld-elf2flt): -shared used without passing a shared library ID
  33. collect2: error: ld a retourné le statut de sortie 1
  34. 0.003123 sec system; 0.004732 sec user; 15.646509 sec clock
  35. ...failed gcc.link.dll bin.v2/libs/system/build/gcc-6.4.0/debug/threading-multi/libboost_system.so.1.67.0...
  36. To fix this, move the exe statement before the boost/thread project
  37. Fixes:
  38. - http://autobuild.buildroot.org/results/f46d38991385cbc2a4fa14eb31074e770cd79803
  39. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  40. [Upstream status: https://github.com/boostorg/thread/commit/f7581a366294c6f5381e0371c242af327c6da655]
  41. ---
  42. build/Jamfile.v2 | 6 +++---
  43. 1 file changed, 3 insertions(+), 3 deletions(-)
  44. diff --git a/libs/thread/build/Jamfile.v2 b/build/Jamfile.v2
  45. index ce8c7f47..26d8b9c3 100644
  46. --- a/libs/thread/build/Jamfile.v2
  47. +++ b/libs/thread/build/Jamfile.v2
  48. @@ -38,6 +38,8 @@ import path ;
  49. import configure ;
  50. import threadapi-feature ;
  51. +exe has_atomic_flag_lockfree : ../build/has_atomic_flag_lockfree_test.cpp ;
  52. +
  53. project boost/thread
  54. : source-location ../src
  55. : requirements <threading>multi
  56. @@ -141,8 +143,6 @@ project boost/thread
  57. <library>/boost/system//boost_system
  58. ;
  59. -exe has_atomic_flag_lockfree : ../build/has_atomic_flag_lockfree_test.cpp ;
  60. -
  61. rule tag ( name : type ? : property-set )
  62. {
  63. local result = $(name) ;
  64. --
  65. 2.17.1