<div dir="ltr"><div><div>So would it be reasonable to have scons run "g++ -no-pie" and parse the output to determine whether or not the option is supported?<br><br></div>On a system where it is supported:<br><br><span style="font-family:monospace,monospace">james@breq:~$ g++ -no-pie<br>g++: fatal error: no input files<br>compilation terminated.</span><br><br></div>On a system where is is not supported:<br><br><span style="font-family:monospace,monospace">james@ixrat:~$ g++ -no-pie<br>g++: error: unrecognized command line option ‘-no-pie’<br>g++: fatal error: no input files<br>compilation terminated.</span><br><br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 20, 2017 at 8:41 AM, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes, I can confirm that adding "-no-pie" in CXXLINKFLAGS does indeed work. I can just type plain "scons" and it compiles correctly.<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 20, 2017 at 2:35 AM, Ralph Versteegen <span dir="ltr"><<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Bah. I wasn't expecting that to work. fbc apparently only does a PIC build when building a dynamic library, not when building an executable. I think what's going on here is that fbc calls ld directly, while linkgcc=1 uses gcc to indirectly call the linker. I guess it's gcc itself which is telling ld to do a PIE build. I want to fix linkgcc=1.</div><div><br></div><div>So could you please try editing SConscript to replace</div><div>CXXLINKFLAGS = []</div><div>with</div><div>CXXLINKFLAGS = ["-no-pie"]</div><div>and see if that works (running just plain "scons")<br></div></div><div class="m_4939412182342574414HOEnZb"><div class="m_4939412182342574414h5"><div class="gmail_extra"><br><div class="gmail_quote">On 20 December 2017 at 16:23, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ah, yes! scons linkgcc=0 did the trick. :)<br></div><div class="m_4939412182342574414m_-4376133641646252914HOEnZb"><div class="m_4939412182342574414m_-4376133641646252914h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 19, 2017 at 1:10 AM, Ralph Versteegen <span dir="ltr"><<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hmm. Most of the errors are in libfbmt.a. But a couple of the relocation errors are in .bas modules,  "<span class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-im m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-HOEnZb m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-adL">relocation R_X86_64_32 against `.rodata.str1.1' " and I don't understand why - if gcc is defaulting to PIC, </span></div><div><span class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-im m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-HOEnZb m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-adL">As fir why gcc say</span>s "...can not be used when making a shared object"<span class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-im m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-HOEnZb m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-adL"></span>, I'm guessing that's a gcc bug, since PIC is normally only required when creating a dynamic library on non-x86, so configuring gcc to force it also for executables might activate the same codepath.<br></div><div><span class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-im m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-HOEnZb m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-adL"><br></span></div><span class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-im m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-HOEnZb m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-adL">Anyway, see if any of the following work:<br>scons linkgcc=0<br>FBFLAGS=-pic scons linkgcc=0<br>FBFLAGS="-Wl -no-pie" scons<br></span></div><span class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-im m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-HOEnZb m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-adL">(I suggest linkgcc=0 because linkgcc=1 always links libfbmt.a, never libfbmtpic.a which is compiled with -fPIC)<br></span><div><div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5">On 19 December 2017 at 16:47, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5">I should have mentioned I already tried scons -c and it didn't help :(</div></div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-m_-6767485051122573212gmail-m_1335519775417554170HOEnZb"><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-m_-6767485051122573212gmail-m_1335519775417554170h5"><div><br></div><div><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5"><br>On Monday, December 18, 2017, Ralph Versteegen <<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5"><div dir="ltr">Run "scons -c" to delete the old object files. Since they were compiled without -fPIC, which is now the default in debian 9, they can't be linked into a PIE executable.<br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5">On 19 December 2017 at 14:05, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5"><div dir="ltr"><div>So I made a copy of the 64 bit Linux VM, and upgraded it from Debian 8 to Debian 9.<br><br></div>hspeak compiles fine now as a 64 bit binary, but I can no longer compile ohrrpgce-game and ohrrpgce-custom<br><br><pre>when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/bin/../lib/freebasi<wbr>c/linux-x86_64/libfbmt.a(io_pr<wbr>int_wstr.o): relocation R_X86_64_32 against undefined symbol `__fb_ctx' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/bin/../lib/freebasi<wbr>c/linux-x86_64/libfbmt.a(io_pr<wbr>intvoid_wstr.o): relocation R_X86_64_32 against `.rodata.str4.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/bin/../lib/freebasi<wbr>c/linux-x86_64/libfbmt.a(sys_g<wbr>etexename.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/bin/../lib/freebasi<wbr>c/linux-x86_64/libfbmt.a(file_<wbr>print_wstr.o): relocation R_X86_64_32 against undefined symbol `__fb_ctx' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/bin/../lib/freebasi<wbr>c/linux-x86_64/libfbmt.a(io_pr<wbr>intpad_wstr.o): relocation R_X86_64_32 against `.rodata.str4.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/bin/../lib/freebasi<wbr>c/linux-x86_64/libfbmt.a(dev_s<wbr>crn_write_wstr.o): relocation R_X86_64_32S against symbol `fb_DevScrnWriteWstr' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/bin/../lib/freebasi<wbr>c/linux-x86_64/libfbmt.a(io_pr<wbr>intbuff_wstr.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/bin/../lib/freebasi<wbr>c/linux-x86_64/libfbmt.a(array<wbr>_erase.o): relocation R_X86_64_PC32 against symbol `free@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
scons: *** [ohrrpgce-game] Error 1
scons: building terminated because of errors.<br><br></pre></div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5">On Sun, Dec 17, 2017 at 10:21 AM, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5"><div dir="ltr"><div><div>Today I will try upgrading Debian on a copy of the 64-bit VM,<br></div> Hopefully that will resolve it.<br><br>---<br></div>James<br><br></div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5">On Sat, Dec 16, 2017 at 4:00 PM, Ralph Versteegen <span dir="ltr"><<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5"><div><div>-no-pie is actually passed by SConscript.  I can't find any mention in my emails about a -no-pie problem on debian. The problem we had was that -no-pie was supported (nor necessary) for clang on OSX. <br></div><br></div><div>The -no-pie flag was added in r9542:<br>"""<br>scons: Fix hspeak builds on Arch Linux and others where gcc defaults to <span>PIE</span><br>
<br>
The Euphoria 4.1 builds we recommend (and which are also used by the Arch<br>
opeeuphoria package on AUR) haven't been built for <span>PIE<br>"""<br></span></div><div><span>Apparently this flag is also necessary on (recent?) Debian and Ubuntu, as they also default to PIE.<br></span></div><div><span><br></span></div><div><span>It's not clear, but from searching around it appears that this flag used to be called -nopie until gcc 6 switched to -no-pie. So try that. I have the man page for gcc 4.8 here, and it doesn't say either way.<br>Also, there is -fno-pie which is a compiler flag while -no-pie is a linker flag (also understood by gcc). So you could also try that and see whether it works. (I assume that -no-pie passed to gcc implies -fno-pie)<br></span></div></div></div><div><div class="gmail_extra"><br><div class="gmail_quote"><div><div><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5">On 16 December 2017 at 12:3</div></div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-m_-6767485051122573212gmail-yj6qo m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-m_-6767485051122573212gmail-ajU"><div id="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-m_-6767485051122573212gmail-:jl" class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-m_-6767485051122573212gmail-ajR"><img class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772m_-343708914086352196gmail-m_7817560943715790264gmail-m_-6767485051122573212gmail-ajT" src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif"></div></div><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5">2, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br></div></div></div></div><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div><div><div dir="ltr"><div>So now I remember why I have the 32-bit version of Euphoria installed on the Linux nightly build machine.<br><br></div>The hspeak build fails because gcc doesn't understand --no-pie<br><div><br><div><br>gcc -o /home/james/src/ohr/wip/hspeak init-.o hspeak.o main-.o hspeak_0.o hspeak_1.o hspeak_2.o hspeak_3.o hspeak_4.o hsspiffy.o file.o sort.o get.o graphics.o machine.o math.o types.o unicode.o ucstypes.o io_with_unicode.o 0achine.o memory.o dll.o  /usr/share/euphoria/bin/eu.a -m64 -ldl -lm -lpthread -no-pie<br>gcc: error: unrecognized command line option '-no-pie'<br>hspeak.mak:97: recipe for target '/home/james/src/ohr/wip/hspea<wbr>k' failed<br>make: *** [/home/james/src/ohr/wip/hspea<wbr>k] Error 1<br>make: Leaving directory '/home/james/src/ohr/wip/build<wbr>/hspeak'<br>scons: done building targets.<br>james@ixrat:~/src/ohr/wip$ euc -v<br>Euphoria to C Translator v4.1.0 development<br>   64-bit Linux, Using System Memory<br>   Revision Date: 2015-02-02 14:18:53, Id: 5861:57179171dbed<br>james@ixrat:~/src/ohr/wip$ gcc --version<br>gcc (Debian 4.9.2-10) 4.9.2<br>Copyright (C) 2014 Free Software Foundation, Inc.<br>This is free software; see the source for copying conditions.  There is NO<br>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br><br><br></div><div>I am wondering if the easiest way to resolve this might be to upgrade the virtual machine from Debian 8.x to 9.x and hopefully get a version of gcc that does not have this problem.<br><br></div><div>For now, I am leaving the 64-bit version of euphoria installed on the vm, so the 64-bit nightly builds are going to remain broken until I have figured out a solution.<br><br>---<br></div><div>James<br></div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a rel="noreferrer" href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
<br></blockquote></div></div></div><br></div></div></div><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5">
<br>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
<br></div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5"><br>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
<br></div></div></blockquote></div><br></div>
</blockquote></div>
</div></div><div><div class="m_4939412182342574414m_-4376133641646252914m_-8060550945233247772h5"><br>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
<br></div></div></blockquote></div><br></div></div></div></div>
<br>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>