You are not logged in.

#1 2014-05-27 17:03:54

StephenTurner
Member
Registered: 2014-05-27
Posts: 4

Missing libutil.a [solved]

I have been trying to compile a program and after some troubleshooting found that i have libcrypt.a but not libutil.a, A quick google search and forum search hasn't turned up answers as to why this would be missing or not required.  My understanding is that its required when you want to compile a static binary of an application?

thanks
Stephen

Last edited by StephenTurner (2014-05-27 20:16:46)

Offline

#2 2014-05-27 17:15:59

loqs
Member
Registered: 2014-03-06
Posts: 19,184

Re: Missing libutil.a [solved]

the default options from /etc/makepkg.conf

OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !upx !debug)

!staticlibs means remove .a files from the package
This can be altered on a per package basis in the packages PKGBUILD such as glibc which provides /usr/lib/crypt.a has

options=('!strip' 'staticlibs')

In its PKGBUILD
edit:
having checked PKGBUILD of glibc the build speciffically removes some .a files

  # remove the static libraries that have a shared counterpart
  # libc, libdl, libm and libpthread are required for toolchain testsuites
  # in addition libcrypt appears widely required
  rm $pkgdir/usr/lib/lib{anl,BrokenLocale,nsl,resolv,rt,util}.a

Last edited by loqs (2014-05-27 17:26:14)

Offline

#3 2014-05-27 17:38:29

StephenTurner
Member
Registered: 2014-05-27
Posts: 4

Re: Missing libutil.a [solved]

a shared counterpart? so then there is a libutil.a already but perhaps not by that name?  Im being told that my build environment is broken because im missing one or more of libcrypt.a libutil.a and possibly lm.a but i dont see that listed in the rm command above.

either way i need libutil.a, what would be the best "arch way" of preventing its removal? or perhaps creating a link to the alternate version if applicable

Last edited by StephenTurner (2014-05-27 17:39:03)

Offline

#4 2014-05-27 17:51:36

loqs
Member
Registered: 2014-03-06
Posts: 19,184

Re: Missing libutil.a [solved]

The shared counterpart is libutil.so (linking libutil.so to libutil.a would definitely not work).  I do not know what you are trying to build but I am inferring you are running some sort of script or Makefile.  See if that has an option to switch to dynamic linking.  Simpler yet see if there is a package build for it already in AUR if not in the main repositories.

Offline

#5 2014-05-27 17:57:08

StephenTurner
Member
Registered: 2014-05-27
Posts: 4

Re: Missing libutil.a [solved]

Im compiling toybox, an alternative to busybox. its still in development but does have stable releases. (not all features included yet though)  It compiles fine dynamically but static is an issue while missing libutil.a. several other distros compile it fine as static such as debian for example.

Why would these libraries be removed if they are required for a static compile of programs?

edit
It just seems that by removing these libraries, our build environment is intentionally crippled. perhaps there is a reason im unaware of?

Last edited by StephenTurner (2014-05-27 17:59:10)

Offline

#6 2014-05-27 19:49:53

loqs
Member
Registered: 2014-03-06
Posts: 19,184

Offline

#7 2014-05-27 20:00:10

StephenTurner
Member
Registered: 2014-05-27
Posts: 4

Re: Missing libutil.a [solved]

Thanks for the link. That answers quite a bit.

Offline

Board footer

Powered by FluxBB