Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Portable rootless ZSH



Thank you for the response Bart!

I passed thru pipeline you described before and your clarifications have helped me to understand the details now.

I don't understand one thing. I want to build rootless binary.
* When I wrote that there is a way to build the binary on old version of packages I mean that library version checking raises the error only if the current packages version is older than used when compile. This workaround allows me to imitate "rootless" and I've tested my binary on modern linux distros versions and it works.
* But when you wrote about prefix-like flags I think you understand that prefix-like flags requres absolute path from root like /usr/share. It's not rootless behaviour. Yes we can change prefixes for lib paths on building but we can't make it relative. I'm wrong?

What step in your way gives us relativity?

Thanks!

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, October 13, 2019 2:22 AM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> On Sat, Oct 12, 2019 at 2:23 PM Coden codenb@xxxxxxxxxxxxxx wrote:
>
> > > ./zsh: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./zsh)
> >
> > The solution is to build zsh on older version of packages (in Ubuntu 14 for example).
>
> I don't think that's actually the solution you want. You should be
> able to static-link the glibc from whatever packages you are building.
>
> I'm surprised nobody mentioned the following miscellaneous details
> yet, but they are all things you should be doing if you are building a
> standalone zsh:
>
> First, you will want to run configure with the --disable-dynamic
> option. You should also look at other configure options such as:
> --bindir
> --datadir
> --enable-etcdir
> --enable-fndir
> --enable-scriptdir
> --exec-prefix
> --prefix
> --program-prefix
>
> Set all of those options to the appropriate paths from which you want
> your standalone shell to be run, find its function library, etc.
>
> Also at configure time you should make sure that LDFLAGS is set to the
> appropriate value to to static linking. That will solve your glibc
> issue. You may also be able to set this at the time you run "make".
>
> AFTER running "configure" but before "make" you should edit
> config.modules and change all of the "link=dynamic" entries to either
> "link=static" if you want that module included in your standalone
> shell, or to "link=no" if you want to exclude the module entirely.
> There are additional instructions at the top of the config.modules
> file.
>
> When you run "make" to build the shell, watch the loading step to be
> sure the correct LDFLAGS has been used.
>
> If you've done all the static linking stuff right, "./zsh" should run
> fine, but still probably won't find its function library (e.g.
> completions). For that to work, you need to "make install" and test
> running that installed binary. You should then be able to build a
> tarball or similar package from the finished install tree (including
> all the function directories etc.), copy that to any binary-compatible
> system, unpack it, and zsh should run there as well.
>
> If everything so far has worked, you may want to rebuild with maximum
> compiler optimization and "strip" the resulting binary to make the
> package as small as possible. Even so a standalone zsh is going to be
> several times larger than bash.




Messages sorted by: Reverse Date, Date, Thread, Author