<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=FR link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-GB>I got these anoying linking errors trying buildind build2 in « phase2 » on CYGWIN, based on the <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><a href="https://github.com/build2/build2-toolchain.git%20build2/build2">https://github.com/build2/build2-toolchain.git build2/build2</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I found it quite close to these observations:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><a href="https://gcc.gnu.org/ml/gcc-bugs/2015-01/msg02097.html">https://gcc.gnu.org/ml/gcc-bugs/2015-01/msg02097.html</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><a href="https://stackoverflow.com/questions/28023728/using-extern-thread-local-in-c11-on-cygwin-amd64">https://stackoverflow.com/questions/28023728/using-extern-thread-local-in-c11-on-cygwin-amd64</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>and then canceled the problem by using “__thread” instead of “thread_local”<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>(see git patch attached).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>The patch is actually in  file “libbutl/ft/lang.hxx” to cancel   <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB> define of « __cpp_thread_local »  and so allow consistancy accross libbutl and « b » exec.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>surely this is not right but it works for my selfish needs.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>(I am new to this jazz, it seems to me a lot frustrating work is implied to decipher this “build2” and not much added value to the core project. Anyway I dived in because I like this “odb” stuff, but still I am wondering why  one did not stick to m4 macros as everything is there since the beginning of ages !)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I have attached also my first reciepies for building with a cygwin machine.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>Note all the added defines needed to get to this stage. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Cheerio.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>The link error:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>...<o:p></o:p></span></p><p class=MsoNormal>++ -Og -std=c++1z -L /usr/local/lib -o build2/b build2/b.o -Wl,--whole-archive build2/libb.u.a -Wl,--no-whole-archive ../libbutl/libbutl/libbutl.a -lpthread ../libpkgconf/libpkgconf/libpkgconf.a -lpthread -lpthread</p><p class=MsoNormal>build2/b.o:b.cxx:(.text$_ZZN6build214fail_mark_baseC4EPKcPKvENKUlRKN4butl11diag_recordEE_clES8_[_ZZN6build214fail_mark_baseC4EPKcPKvENKUlRKN4butl11diag_recordEE_clES8_]+0xc): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini TLS init function for build2::diag_frame::stack</p><p class=MsoNormal>build2/b.o:b.cxx:(.text$_ZZN6build214fail_mark_baseC4EPKcPKvENKUlRKN4butl11diag_recordEE_clES8_[_ZZN6build214fail_mark_baseC4EPKcPKvENKUlRKN4butl11diag_recordEE_clES8_]+0x16): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini TLS init function for build2::diag_frame::stack</p><p class=MsoNormal>build2/libb.u.a(algorithm.o):algorithm.cxx:(.text+0x200): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini TLS init function for build2::diag_frame::stack</p><p class=MsoNormal>build2/libb.u.a(algorithm.o):algorithm.cxx:(.text+0x20a): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini TLS init function for build2::diag_frame::stack</p><p class=MsoNormal>build2/libb.u.a(algorithm.o):algorithm.cxx:(.text+0x225): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini TLS init function for build2::diag_frame::stack</p><p class=MsoNormal>build2/libb.u.a(algorithm.o):algorithm.cxx:(.text+0x22f): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini TLS init function for build2::diag_frame::stack</p><p class=MsoNormal>build2/libb.u.a(algorithm.o):algorithm.cxx:(.text+0x28b): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini TLS init function for build2::diag_frame::stack</p><p class=MsoNormal>build2/libb.u.a(algorithm.o):algorithm.cxx:(.text+0x295): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini TLS init function for build2::diag_frame::stack</p><p class=MsoNormal>build2/libb.u.a(algorithm.o):algorithm.cxx:(.text+0x2ca): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini TLS init function for build2::diag_frame::stack</p><p class=MsoNormal>build2/libb.u.a(algorithm.o):algorithm.cxx:(.text+0x2d4): relocalisation tronquée pour concorder avec la taille : R_X86_64_PC32 vers le symbole indéfini TLS init function for build2::diag_frame::stack</p><p class=MsoNormal>build2/libb.u.a(algorithm.o):algorithm.cxx:(.text+0x8e5): débordement de relocalisation additionnelle omise à partir de la sortie</p><p class=MsoNormal>collect2: error: ld a retourné le statut de sortie 1</p><p class=MsoNormal>skipped updating 20 targets</p><p class=MsoNormal>info: failed to update build2/exe{b}</p><p class=MsoNormal>make: *** [build2.mk:32: phase2.0] Error 1</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>the patch…</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>diff --git a/libbutl/ft/lang.hxx b/libbutl/ft/lang.hxx</p><p class=MsoNormal>index 4f0663c..2391fc7 100644</p><p class=MsoNormal>--- a/libbutl/ft/lang.hxx</p><p class=MsoNormal>+++ b/libbutl/ft/lang.hxx</p><p class=MsoNormal>@@ -22,8 +22,11 @@</p><p class=MsoNormal> #      define __cpp_thread_local 201103</p><p class=MsoNormal> #    endif</p><p class=MsoNormal> #  else</p><p class=MsoNormal>-#    define __cpp_thread_local 201103</p><p class=MsoNormal>+#    if !defined(CYGWIN_)</p><p class=MsoNormal>+#      define __cpp_thread_local 201103</p><p class=MsoNormal>+#    endif</p><p class=MsoNormal> #  endif</p><p class=MsoNormal>+</p><p class=MsoNormal> #endif</p><p class=MsoNormal> </p><p class=MsoNormal> #endif // LIBBUTL_FT_LANG_HXX</p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>The build reciepes :<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>#!/usr/bin/make -f<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>#phase 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>phase1.0 bootstrap build2/b-boot.exe:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                $(MAKE) -C /usr/src/git.codesynthesis.com/build2-toolchain/build2 \<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                 -f bootstrap.gmake CXX=g++ CPPFLAGS="-I/usr/local/include  -I/usr/include  -DCYGWIN "  libbutl=../libbutl<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>phase2.0:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                cd /usr/src/git.codesynthesis.com/build2-toolchain/build2 \<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                ; build2/b-boot --verbose 2 \<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                               config.cxx=g++ \<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                               config.cxx.poptions="-D_DEFAULT_SOURCE -DCYGWIN -D__CYGWIN__ -D_POSIX_C_SOURCE=200809 -D_XOPEN_SOURCE=700" \<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                               config.cxx.coptions=-Og  \<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                               config.bin.lib=static \<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                               build2/exe{b}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>tbc...<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal>Provenance : <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Courrier</a> pour Windows 10</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>