Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jan 2016 17:23:18 +0100
From:      Markus Edemalm <markus@edemalm.se>
To:        Shane Ambler <FreeBSD@ShaneWare.Biz>
Cc:        Polytropon <freebsd@edvax.de>, freebsd-questions@freebsd.org
Subject:   Re: Safe to delete old files in /usr/lib?
Message-ID:  <833B0203-87FA-45F3-82BC-6250CD1EF735@edemalm.se>
In-Reply-To: <568B3CD2.8030708@ShaneWare.Biz>
References:  <D6FAF4F3-EE48-4411-909D-9D13D8B9B620@edemalm.se> <20160104181211.76907a30.freebsd@edvax.de> <F4E4B196-36B4-40FE-A54B-FEA95DA96772@edemalm.se> <20160104185245.5ca2e4f1.freebsd@edvax.de> <BA58A9C5-5BD4-44AD-AFDC-D3BE54036A78@edemalm.se> <20160104203418.aee8df91.freebsd@edvax.de> <568B3CD2.8030708@ShaneWare.Biz>

next in thread | previous in thread | raw e-mail | index | archive | help
> 5 jan. 2016 kl. 04:47 skrev Shane Ambler <FreeBSD@ShaneWare.Biz>:
>=20
> On 05/01/2016 06:04, Polytropon wrote:
>> On Mon, 4 Jan 2016 19:18:02 +0100, Markus Edemalm wrote:
>>>> 4 jan. 2016 kl. 18:52 skrev Polytropon <freebsd@edvax.de>:
>>>>=20
>>>> On Mon, 4 Jan 2016 18:28:14 +0100, Markus Edemalm wrote:
>>>>>> 4 jan. 2016 kl. 18:12 skrev Polytropon <freebsd@edvax.de>:
>>>>>>=20
>>>>>> On Mon, 4 Jan 2016 18:06:00 +0100, Markus Edemalm wrote:
>>>>>>> Hello,
>>>>>>>=20
>>>>>>> My system was first installed as 10.0-RELEASE. I have
>>>>>>> sinceupgraded to 10.1, 10.1-STABLE, 10.2-RELEASE and is now
> >>>>>> at 10.2-RELEASE-p8.
>>>>>>> I=C3=A2=E2=82=AC=E2=84=A2ve rebuild from source and followed the =
steps in the
> >>>>>> handbook. Everything is fine=C3=A2=E2=82=AC=C2=A6 but:
>>>>>>>=20
>>>>>>> I see many files in /usr/lib with old dates, apparently
>>>>>>> they are
> no longer installed during upgrades.
>=20
> Did you clear out /usr/obj
> With the right modifications dates, a binary doesn't need to be =
rebuilt
>=20
> While I think make buildworld should clean it out, some files may get =
missed.

Yes, I always delete /usr/obj before I start. Just like the handbook =
suggests.


>>>>> And, they are all .a files, except for libc++.so and libc.so.
>>>>>=20
>>>>> I added NO_PROFILE=3Dtrue to /etc/make.conf a while back. Is that =
relevant?
>>>>=20
>>>> Hmmm... I always thought that would be the default (no profiling =
libs
>>>> being built and installed). But according to "man src.conf", the
>>>> setting's name is WITHOUT_PROFILE, not NO_PROFILE.

I removed NO_PROFILE=3Dtrue from /etc/make.conf and rebuilt everything =
today.
Now I got the _p.a files installed. But no .a files. For each lib in =
/usr/lib I have, for example:

-r--r--r--   1 root  wheel     29242 Dec  2  2014 librt.a
lrwxr-xr-x   1 root  wheel        10 Jan  5 16:50 librt.so@ -> =
librt.so.1
-r--r--r--   1 root  wheel     23832 Jan  5 16:50 librt.so.1
-r--r--r--   1 root  wheel     32202 Jan  5 16:50 librt_p.a

-r--r--r--   1 root  wheel     30550 Dec  2  2014 libpanelw.a
lrwxr-xr-x   1 root  wheel        14 Jan  5 16:50 libpanelw.so@ -> =
libpanelw.so.5
-r--r--r--   1 root  wheel     11840 Jan  5 16:50 libpanelw.so.5
-r--r--r--   1 root  wheel     31678 Jan  5 16:50 libpanelw_p.a

See the dates? Why do I get fresh _p.a files and no .a files?


>>>=20
>>> Hmm. I forgot about src.conf, I got:
>>>=20
>>> cat /etc/src.conf
>>> WITHOUT_BLUETOOTH=3Dyes
>>> WITHOUT_FLOPPY=3Dyes
>>> WITHOUT_IPFW=3Dyes
>>> WITHOUT_IPFILTER=3Dyes
>>>=20
>>> That may explain why _some_ libs are not being built and installed.
>>> But still, more than 100 .a files with old dates. Doesn=C3=A2=E2=82=AC=
=E2=84=A2t make sense to me at all.
>>=20
>> In this case, a good idea would be to move the old libraries out
>> of /usr/lib (for example into a newly created /usr/lib.old directory)
>> and checking if any application in use produces an error. In that
>> case, the required library could be restored. If no further error
>> appears - forget about those libraries. :-)
>=20
> .a files should be copied into the final binary, so removing .a files
> won't break anything that is already built, but the next make could
> fail with a missing library at link time.
>=20
> I am running 10-stable and run make delete-old after upgrades -

I did:

# make check-old-libs
>>> Checking for old libraries
(nothing found)

# make delete-old-libs
>>> Removing old libraries
Please be sure no application still uses those libraries, else you
can not start such an application. Consult UPDATING for more
information regarding how to cope with the removal/revision bump
of a specific library.
>>> Old libraries removed
(nothing to remove)


> ls /usr/lib/*.a | wc -l
> 292
> ls /usr/lib/*.so | wc -l
> 162
>=20
> find /usr/lib -type l -name "*.a" | wc -l
> 22
>=20
> I do seem to have a few old libs
>=20
> find /usr/lib -not -newermt "2 weeks ago" | wc -l
> 19
>=20
> Downloading base.txz for 10.2-RELEASE -
>=20
> ls usr/lib/*.a | wc -l
> 287
> ls usr/lib/*.so | wc -l
> 162

Here=E2=80=99s my number after todays rebuild:

$ ls /usr/lib/*.a | wc -l
283

$ ls /usr/lib/*_p.a | wc -l
138

$ ls /usr/lib/*.so | wc -l
160


> --=20
> FreeBSD - the place to B...Software Developing
>=20
> Shane Ambler
>=20

/ME




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?833B0203-87FA-45F3-82BC-6250CD1EF735>