pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: wget does not compile on FreeBSD12 with openssl




Le 01.08.2019 à 02:42, Greg Troxel a écrit :
Pierre Dupond <76nemo76%gmx.ch@localhost> writes:

   [spacing repaired]

1) Is it possible to generate only static (or dynamic) libraries
instead of both when compiling a package with PKGSRC (for instance
when compiling "libunistring")
pkgsrc generally

   - runs the upstream build
   - fixes upstream code to follow norms

Now, you should realize that having dynamic libraries is one of those
norms.  Part of the reaosn is that when a library is fixed (e.g. a
security bug), then programs that use it do not need to be rebuilt.

This is a quite common argument but in my opinion a little bit too
optimistic.

This argument is absolutely true but the opposite argument: if you
introduce a bug

in the new library, you propagate it everywhere is also absolutely true!

My main reason/goals to have statically (or almost statically) linked
programs are:

             * to have stability, a statically linked program will
never change. I reinstall these days a server

               but I use the server which will be replaced by this new
installation since 10 years

              without any upgrade or major problems. Software is old,
but provide what I need. Actually,

              the hardware is a little bit too old and no more
supported, I Upgrade then the hardware and

              the software.

            * Avoid the dependencies hell. In the packages I have
created (and I manage with the pkgsrc tools)

               I have no dependencies at all. The dependencies are
necessary at build time, not at

               running time. It is much easier to remove a package.

             * Fully statically linked executable are generally a
little bigger on disk, not on memory

                An exception to this rule is when a library is used by
a lot of programs (like in a graphical

                 environment). This is not the case for me since I have
no graphical hardware on my server.

                Fully statically linked programs could even take less
memory (due to the demand paging) if

                very few functions of the library are used.

            * Fully statically linked binaries are generally portable
across different versions of the same operating

               system (they will run on Debian and RedHat if the kernel
is sufficiently similar). They run much better

               under an emulation (for instance the linux binary
compatibility on FreeBSD)

            * They are very useful when the system is broken and you
should repare it with a very

               minimal system (only the root partition is available and
it is  located on an other partition than /usr). This

               scheme is uncommon now on Linux, mainly due to the
requirement of systemd, but it

               is still used on other system (Solaris, BSD).

I agree that my situation is quite different from the casual user of the
pkgsrc package.

I recompile everything to have optimisations for my CPU and I do it only
for one

machine.

What I would have hoped is a little more flexibility with the pkgsrc
infrastructure.

It is certainly a wise decision to produce the both versions  of the
libraries, but to have

a general option called "static" or "dynamic" for producing only

one of the form of the library would be useful. To implement that, one
has, most of the time,

only to pass the parameter "--without-shared" or "--without-static" to
the configure script.


I have started to look inside the pkgrsc mechanisms to see if it is
possible to pass a such

parameter. But I have found no obvious solution until now.


Finally I have followed this method which was moderately painful and
complicated

but has givven me what I want:

                    1) For the software I don't care too much (like the
gcc9 compiler),

                         I have installed it from the FreeBSD port

                    2) For the software I want to be optimized
specifically for a CPU

                        I recompile it with pkgsrc

                    3) For the software I want to have statically
linked, I compile it myself

                         directly from the sources but I create a
PKGSRC package and I manipulate it with

                         the pkgsrc tool (pkg_add, pkg_delete, pkg_info).


best regards,

Pierre



Home | Main Index | Thread Index | Old Index