Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jan 2024 10:55:14 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Mario Marietto <marietto2008@gmail.com>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>,  freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: set : illegal option -o pipefail error while trying to upgrade pkg.
Message-ID:  <CANCZdfqu8dZXaRjdsn-hS2238yNZ1d36ZG8hJRx285=xBjNdHg@mail.gmail.com>
In-Reply-To: <CANCZdfrBnC-G0kG0%2BuwQKZWz2Va--Db-z3TS2td2yWisMGOx8Q@mail.gmail.com>
References:  <CA%2B1FSijXJUDtkmf0KKEtCJ_cFhg4Htc_a=q1BWt9mtGV1T7oLw@mail.gmail.com> <CANCZdfqTdrPqswGPiku5f4ror2pxUr8MwpQPDqC15uYY8MkfkQ@mail.gmail.com> <CANCZdfp8skF24LVKcp1ygZL_zrrSAZ%2B=%2BvorhvXcE2BQCBOQFA@mail.gmail.com> <CA%2B1FSigBeH1Wm7C02OJvJ8YT6uMMOkZUEinOuaNyhKVBULfGcw@mail.gmail.com> <CA%2B1FSihbBxOmKa4gvNErrrfi4Se9yP7YB3C-=W4VTqLAYaoAqQ@mail.gmail.com> <CA%2B1FSii3zCfP=3L5BypzCPPTwsVJ2QFyXB%2Bb3VeFDBJm3eeuFQ@mail.gmail.com> <CA%2B1FSijnTFspSkdp5YA7fnaQvgUjhc=P9NEPTw4NRGOQSDCnag@mail.gmail.com> <CANCZdfrBnC-G0kG0%2BuwQKZWz2Va--Db-z3TS2td2yWisMGOx8Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Sun, Jan 28, 2024 at 10:53 AM Warner Losh <imp@bsdimp.com> wrote:

> OK. On your 10.x arm system, you need to build /bin/sh using sources from
> FreeBSD 13.
> Binaries from 12 or 13 won't work on your 10.x system: libc doesn't have
> the right symbols.
> But source build against a 10.x system should work. That was my
> suggestion. Too bad
> pipefail didn't arrive until 14. So you'll need to build that on your 14
> system.
>
... need to build stable/14 on your 10.x system this should say. Rather an
important
detail I didn't catch on first proofreading.


>
> But it turns out that's a bit of a hassle. Well, not a huge hassle, I had
> to do the following.
> First, set up a FreeBSD 10.4 armv6 chroot and install qemu-user-static. See
> https://gist.github.com/bsdimp/0f2f294c7441ebf68a8ffebab935bd2c for
> details.
> Or you could just run the RPI-B image on a real RPI-B. It would be more of
> a hassle and only marginally faster.
>
> Next, I created a worktree and a side branch (using the same paths in the
> gist
> above, note my origin is freebsd but the default is origin):
> % cd git/freebsd-src
> % mkdir ~/arm10/imp
> % git worktree add -b arm10-14 ~/arm10/imp/stable-14 freebsd/stable/14
> I then had to apply these patches:
> https://people.freebsd.org/~imp/14-sh-on-10.diff
> which coped with history / libedit overhaul and O_VERIFY being added to
> the system. OK, truth be told I iterated a bunch to get the patch... I had
> no
> reason to think these changes were needed before I started...
>
> Next, I got into the emulated arm tree:
> % sudo chroot ~/arm10 /bin/sh
> # cd /imp/stable-14/
> # patch -p1 < 14-sh-on-10.diff
> # make SSP_CFLAGS= WITHOUT_TESTS=t WITHOUT_MAN=t DEBUG_FILES_CFLAGS=
> WARNS=0
> ... lots of output, ignore the warnings
> # set -o pipefail
> set: Illegal option -o pipefail
> # /usr/obj/imp/stable-14/arm.armv6/bin/sh/sh
> # set -o pipefail
> # ^D
> #
>
> So success! But all that's a hassle, so I also uploaded the sh to
> https://people.freebsd.org/~imp/sh14-on-10.armv6
> so you can just try it. I don't know if this will fix the problem that put
> us down
> this rabbit hole in the first place or not. But maybe some of the above is
> helpful
> or useful for other reasons.
>
> Hope this helps.
>
> Warner
>
> On Sun, Jan 28, 2024 at 7:33 AM Mario Marietto <marietto2008@gmail.com>
> wrote:
>
>> Using sh of FreeBSD 12.04 :
>>
>> /bin/sh : Undefined symbol "stat@FBSD_1.5"
>>
>> nothing to do.
>>
>> On Sun, Jan 28, 2024 at 3:17 PM Mario Marietto <marietto2008@gmail.com>
>> wrote:
>>
>>> I've used FreeBSD 13.2 and I've got the same error message :
>>>
>>> /lib/libc.so.7: version FBSD_1.6 required by /bin/sh not found
>>>
>>> Let's see with FreeBSD 12.04...
>>>
>>> On Sun, Jan 28, 2024 at 2:04 PM Mario Marietto <marietto2008@gmail.com>
>>> wrote:
>>>
>>>> Hello Warner,
>>>>
>>>> Thanks for your help. But unfortunately your solution didn't work.
>>>> After having followed your instructions carefully :
>>>>
>>>> Save a copy of /bin/sh. Check out stable/13 (or 12 if the following
>>>>> fails). Cd to src/bin/sh. Type make all. You may need -m
>>>>> /path/to/src/share/mk if it makes complaints. Create a test area, I'll call
>>>>> it /destdir. Also mkdir /destdir/bin too. Then make install
>>>>> DESTDIR=/destdir. You may need to do this as root. Ignore the failures for
>>>>> the man pages and maybe tests. You should have a /destdir/bin/sh. See if it
>>>>> runs. If so, copy it to /bin and try the upgrade again.
>>>>
>>>>
>>>> It asked me to copy some new libraries from FreeBSD 14.0 to the
>>>> /usr/lib32 and /lib directories of the FreeBSD 10.4 system. I copied all
>>>> the libraries requested and at the end,it gave the following error :
>>>>
>>>> /lib/libc.so.7: version FBSD_1.6 required by /bin/sh not found
>>>>
>>>> so,I have changed the flag that does not allow me to rename it with the
>>>> command :
>>>>
>>>> # chflags noschg libc.so.7
>>>>
>>>> and I've copied the libc.so.7 file that's on the directory /lib of the
>>>> FreeBSD 14 to the same directory of the FreeBSD 10.4 system and I've
>>>> rebooted. Unfortunately it hasn't been accepted. The error is the following
>>>> one :
>>>>
>>>> /lib/libc.so.7 : unsupported relocation type 37 in non-PLT relocations
>>>>
>>>> What has been my mistake ? Maybe using FreeBSD 14 is wrong ?
>>>>
>>>> On Sun, Jan 28, 2024 at 9:47 AM Mario Marietto <marietto2008@gmail.com>
>>>> wrote:
>>>>
>>>>> # set -o pipefail
>>>>> set : variable name must begin with a letter.
>>>>>
>>>>> On Sun, Jan 28, 2024 at 5:43 AM Warner Losh <imp@bsdimp.com> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, Jan 27, 2024, 5:54 PM Warner Losh <imp@bsdimp.com> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Jan 27, 2024, 5:12 PM Mario Marietto <marietto2008@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hello.
>>>>>>>>
>>>>>>>> I'm trying to upgrade as much as I can FreeBSD 10.4 because it is
>>>>>>>> the only one version that can compile some of the old arm 32 bit code I
>>>>>>>> need to use for one of my projects. As you already know,packages don't work
>>>>>>>> at all,but ports almost work. I was trying to install xfce4 from ports,but
>>>>>>>> the compilation stopped when it didn't accept this file :
>>>>>>>>
>>>>>>>>
>>>>>>>> http://distcache.FreeBSD.org/ports-distfiles/trousers-0.3.14.tar.gz
>>>>>>>>
>>>>>>>>
>>>>>>>> at this point,I decided to upgrade the system with :
>>>>>>>>
>>>>>>>>
>>>>>>>> # freebsd-update fetch
>>>>>>>> # freebsd-update install
>>>>>>>>
>>>>>>>>
>>>>>>>> and the ports tree with :
>>>>>>>>
>>>>>>>>
>>>>>>>> # portsnap fetch extract
>>>>>>>> # portsnap fetch update
>>>>>>>>
>>>>>>>>
>>>>>>>> At this point it asked me to update pkg,so I did :
>>>>>>>>
>>>>>>>>
>>>>>>>> # cd /usr/ports/ports-mgmt/pkg
>>>>>>>> # make
>>>>>>>>
>>>>>>>>
>>>>>>>> but unfortunately I got this error that I'm not able to fix :
>>>>>>>>
>>>>>>>>
>>>>>>>> set : illegal option -o pipefail
>>>>>>>>
>>>>>>>>
>>>>>>>> and I can't do anything anymore. I'm stuck here. Can someone help
>>>>>>>> me to fix it ? thanks.
>>>>>>>>
>>>>>>>
>>>>>>> Save a copy of /bin/sh. Check out stable/13 (or 12 if the following
>>>>>>> fails). Cd to src/bin/sh. Type make all. You may need -m
>>>>>>> /path/to/src/share/mk if make complains. Create a test area, I'll call it
>>>>>>> /destdir. Also mkdir /destdir/bin too. Then make install  DESTDIR=/destdir.
>>>>>>> You may need to do this as root. Ignore the failures for the man pages and
>>>>>>> maybe tests. You should have a /destdir/bin/sh. See if it runs. If so copy
>>>>>>> it to /bin and try the upgrade again.
>>>>>>>
>>>>>>> I think 12 has pipefail. I dont think 11 does. 13 definitely has it.
>>>>>>> The error message is from the shell.
>>>>>>>
>>>>>>
>>>>>>
>>>>>> The command "set -o pipefail" is how you'll know if it will work....
>>>>>> or stands a good chance of working.
>>>>>>
>>>>>>
>>>>>> Warner
>>>>>>>
>>>>>>>
>>>>>
>>>>> --
>>>>> Mario.
>>>>>
>>>>
>>>>
>>>> --
>>>> Mario.
>>>>
>>>
>>>
>>> --
>>> Mario.
>>>
>>
>>
>> --
>> Mario.
>>
>

[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 28, 2024 at 10:53 AM Warner Losh &lt;<a href="mailto:imp@bsdimp.com">imp@bsdimp.com</a>&gt; wrote:<br></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>OK. On your 10.x arm system, you need to build /bin/sh using sources from FreeBSD 13.</div><div>Binaries from 12 or 13 won&#39;t work on your 10.x system: libc doesn&#39;t have the right symbols.</div><div>But source build against a 10.x system should work. That was my suggestion. Too bad</div><div>pipefail didn&#39;t arrive until 14. So you&#39;ll need to build that on your 14 system.<br></div></div></blockquote><div>... need to build stable/14 on your 10.x system this should say. Rather an important</div><div>detail I didn&#39;t catch on first proofreading.<br></div><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><div><br></div><div>But it turns out that&#39;s a bit of a hassle. Well, not a huge hassle, I had to do the following.</div><div>First, set up a FreeBSD 10.4 armv6 chroot and install qemu-user-static. See</div><div><a href="https://gist.github.com/bsdimp/0f2f294c7441ebf68a8ffebab935bd2c" target="_blank">https://gist.github.com/bsdimp/0f2f294c7441ebf68a8ffebab935bd2c</a>; for details.</div><div>Or you could just run the RPI-B image on a real RPI-B. It would be more of</div><div>a hassle and only marginally faster.<br></div><div><br></div><div>Next, I created a worktree and a side branch (using the same paths in the gist</div><div>above, note my origin is freebsd but the default is origin):</div><div>% cd git/freebsd-src</div><div>% mkdir ~/arm10/imp<br></div><div>% git worktree add -b arm10-14 ~/arm10/imp/stable-14 freebsd/stable/14</div><div>I then had to apply these patches:</div><div><a href="https://people.freebsd.org/~imp/14-sh-on-10.diff" target="_blank">https://people.freebsd.org/~imp/14-sh-on-10.diff</a></div><div>which coped with history / libedit overhaul and O_VERIFY being added to</div><div>the system. OK, truth be told I iterated a bunch to get the patch... I had no</div><div>reason to think these changes were needed before I started... <br></div><div><br></div><div>Next, I got into the emulated arm tree:</div><div>% sudo chroot ~/arm10 /bin/sh</div><div># cd /imp/stable-14/</div><div># patch -p1 &lt; 14-sh-on-10.diff</div><div># make SSP_CFLAGS= WITHOUT_TESTS=t WITHOUT_MAN=t DEBUG_FILES_CFLAGS= WARNS=0</div><div>... lots of output, ignore the warnings<br></div><div># set -o pipefail</div><div>set: Illegal option -o pipefail</div><div># /usr/obj/imp/stable-14/arm.armv6/bin/sh/sh</div><div># set -o pipefail</div><div># ^D</div><div>#<br></div><div><br></div><div>So success! But all that&#39;s a hassle, so I also uploaded the sh to</div><div><a href="https://people.freebsd.org/~imp/sh14-on-10.armv6" target="_blank">https://people.freebsd.org/~imp/sh14-on-10.armv6</a></div><div>so you can just try it. I don&#39;t know if this will fix the problem that put us down</div><div>this rabbit hole in the first place or not. But maybe some of the above is helpful</div><div>or useful for other reasons.</div><div><br></div><div>Hope this helps.<br></div><div><br></div><div>Warner</div><div><br></div><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 28, 2024 at 7:33 AM Mario Marietto &lt;<a href="mailto:marietto2008@gmail.com" target="_blank">marietto2008@gmail.com</a>&gt; wrote:<br></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>Using sh of FreeBSD 12.04 :</div><div><br></div><div><span><div>/bin/sh : Undefined symbol &quot;stat@FBSD_1.5&quot;</div><div><br></div><div>nothing to do.<br></div></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 28, 2024 at 3:17 PM Mario Marietto &lt;<a href="mailto:marietto2008@gmail.com" target="_blank">marietto2008@gmail.com</a>&gt; wrote:<br></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>I&#39;ve used FreeBSD 13.2 and I&#39;ve got the same error message :</div><div><br></div><div><div>/lib/libc.so.7: version FBSD_1.6 required by /bin/sh not found</div><div><br></div><div>Let&#39;s see with FreeBSD 12.04...<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 28, 2024 at 2:04 PM Mario Marietto &lt;<a href="mailto:marietto2008@gmail.com" target="_blank">marietto2008@gmail.com</a>&gt; wrote:<br></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>Hello Warner,</div><div><br></div><div>Thanks for your help. But unfortunately your solution didn&#39;t work. After having followed your instructions carefully :</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>Save a copy of /bin/sh. Check out stable/13 (or 12 if 
the following fails). Cd to src/bin/sh. Type make all. You may need -m 
/path/to/src/share/mk if it makes complaints. Create a test area, I&#39;ll call 
it /destdir. Also mkdir /destdir/bin too. Then make install  
DESTDIR=/destdir. You may need to do this as root. Ignore the failures 
for the man pages and maybe tests. You should have a /destdir/bin/sh. 
See if it runs. If so, copy it to /bin and try the upgrade again.</span></blockquote><div><br></div><div>It asked me to copy some new libraries from FreeBSD 14.0 to the /usr/lib32 and /lib directories of the FreeBSD 10.4 system. I copied all the libraries requested and at the end,it gave the following error :<br></div><div><br></div><div>/lib/libc.so.7: version FBSD_1.6 required by /bin/sh not found</div><div><br></div><div>so,I have changed the flag that does not allow me to rename it with the command :</div><div><br></div><div><pre># chflags noschg libc.so.7<br><br></pre></div><div>and I&#39;ve copied the libc.so.7 file that&#39;s on the directory /lib of the FreeBSD 14 to the same directory of the FreeBSD 10.4 system and I&#39;ve rebooted. Unfortunately it hasn&#39;t been accepted. The error is the following one :</div><div><br></div><div>/lib/libc.so.7 : unsupported relocation type 37 in non-PLT relocations</div><div><br></div><div>What has been my mistake ? Maybe using FreeBSD 14 is wrong ? <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 28, 2024 at 9:47 AM Mario Marietto &lt;<a href="mailto:marietto2008@gmail.com" target="_blank">marietto2008@gmail.com</a>&gt; wrote:<br></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># set -o pipefail</div><div>set : variable name must begin with a letter.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 28, 2024 at 5:43 AM Warner Losh &lt;<a href="mailto:imp@bsdimp.com" target="_blank">imp@bsdimp.com</a>&gt; wrote:<br></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="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 27, 2024, 5:54 PM Warner Losh &lt;<a href="mailto:imp@bsdimp.com" target="_blank">imp@bsdimp.com</a>&gt; wrote:<br></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="auto"><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sat, Jan 27, 2024, 5:12 PM Mario Marietto &lt;<a href="mailto:marietto2008@gmail.com" rel="noreferrer noreferrer" target="_blank">marietto2008@gmail.com</a>&gt; wrote:<br></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 style="max-width:800px"><div><p>Hello.</p><p>I&#39;m
 trying to upgrade as much as I can FreeBSD 10.4 because it is the only one
 version that can compile some of the old arm 32 bit code I need to use 
for one of my projects. As you already know,packages don&#39;t work at 
all,but ports almost work. I was trying to install xfce4 from ports,but 
the compilation stopped when it didn&#39;t accept this file :</p><p><br></p><p><a href="http://distcache.FreeBSD.org/ports-distfiles/trousers-0.3.14.tar.gz" rel="noopener nofollow ugc noreferrer noreferrer noreferrer" target="_blank">http://distcache.FreeBSD.org/ports-distfiles/trousers-0.3.14.tar.gz</a></p><p><br></p><p>at this point,I decided to upgrade the system with :</p><p><br></p><pre><code># freebsd-update fetch
# freebsd-update install
</code></pre><p><br></p><p>and the ports tree with :</p><p><br></p><pre><code># portsnap fetch extract
# portsnap fetch update
</code></pre><p><br></p><p>At this point it asked me to update pkg,so I did :</p><p><br></p><pre><code># cd /usr/ports/ports-mgmt/pkg
# make
</code></pre><p><br></p><p>but unfortunately I got this error that I&#39;m not able to fix :</p><p><br></p><pre><code>set : illegal option -o pipefail
</code></pre><p><br></p><p>and I can&#39;t do anything anymore. I&#39;m stuck here. Can someone help me to fix it ?  thanks.</p></div></div></div></blockquote></div><div dir="auto"><br></div><div dir="auto">Save a copy of /bin/sh. Check out stable/13 (or 12 if the following fails). Cd to src/bin/sh. Type make all. You may need -m /path/to/src/share/mk if make complains. Create a test area, I&#39;ll call it /destdir. Also mkdir /destdir/bin too. Then make install  DESTDIR=/destdir. You may need to do this as root. Ignore the failures for the man pages and maybe tests. You should have a /destdir/bin/sh. See if it runs. If so copy it to /bin and try the upgrade again.</div><div dir="auto"><br></div><div dir="auto">I think 12 has pipefail. I dont think 11 does. 13 definitely has it. The error message is from the shell.</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">The command &quot;set -o pipefail&quot; is how you&#39;ll know if it will work.... or stands a good chance of working.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto">Warner </div><div dir="auto"><br></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
</blockquote></div></div>
</blockquote></div></div></div>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Mario.<br></div>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Mario.<br></div>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Mario.<br></div>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Mario.<br></div>
</blockquote></div></div></div>
</blockquote></div></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqu8dZXaRjdsn-hS2238yNZ1d36ZG8hJRx285=xBjNdHg>