* [dm-crypt] static libraries
@ 2013-01-05 9:05 .. ink ..
2013-01-05 11:05 ` Milan Broz
0 siblings, 1 reply; 8+ messages in thread
From: .. ink .. @ 2013-01-05 9:05 UTC (permalink / raw)
To: dm-crypt
[-- Attachment #1: Type: text/plain, Size: 617 bytes --]
i build 1.6.0-rc1 with the following config options:
./configure --prefix=/usr --enable-cryptsetup-reencrypt
--enable-static-cryptsetup
then i looked at the static libraries with the following command:
find . -iname *.a
and the results where:
./lib/crypto_backend/.libs/libcrypto_backend.a
./lib/verity/.libs/libverity.a
./lib/tcrypt/.libs/libtcrypt.a
./lib/luks1/.libs/libluks1.a
./lib/loopaes/.libs/libloopaes.a
Is the list of static objects complete? it seem incomplete to me as i dont
see a static object to handle plain volumes or other functions.
Shouldnt also there be a libcryptsetup.a static library?
[-- Attachment #2: Type: text/html, Size: 747 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] static libraries
2013-01-05 9:05 [dm-crypt] static libraries .. ink ..
@ 2013-01-05 11:05 ` Milan Broz
2013-01-05 12:12 ` .. ink ..
0 siblings, 1 reply; 8+ messages in thread
From: Milan Broz @ 2013-01-05 11:05 UTC (permalink / raw)
To: .. ink ..; +Cc: dm-crypt
On 01/05/2013 10:05 AM, .. ink .. wrote:
> i build 1.6.0-rc1 with the following config options:
>
> ./configure --prefix=/usr --enable-cryptsetup-reencrypt --enable-static-cryptsetup
>
> then i looked at the static libraries with the following command:
> find . -iname *.a
>
> and the results where:
> ./lib/crypto_backend/.libs/libcrypto_backend.a
> ./lib/verity/.libs/libverity.a
> ./lib/tcrypt/.libs/libtcrypt.a
> ./lib/luks1/.libs/libluks1.a
> ./lib/loopaes/.libs/libloopaes.a
>
> Is the list of static objects complete? it seem incomplete to me as i dont see a static object to handle plain volumes or other functions.
What are you trying to do here?
These are INTERNAL libraries, never ever use them directly.
> Shouldnt also there be a libcryptsetup.a static library?
$ ls -l lib/.libs/libcryptsetup.a
-rw-r--r-- 1 milan milan 567052 Jan 5 11:57 lib/.libs/libcryptsetup.a
This is the only library which is provided externally.
Above compiled with (on Debian)
./configure --enable-static --enable-static-cryptsetup
Milan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] static libraries
2013-01-05 11:05 ` Milan Broz
@ 2013-01-05 12:12 ` .. ink ..
2013-01-05 17:56 ` Milan Broz
0 siblings, 1 reply; 8+ messages in thread
From: .. ink .. @ 2013-01-05 12:12 UTC (permalink / raw)
To: Milan Broz; +Cc: dm-crypt
[-- Attachment #1: Type: text/plain, Size: 665 bytes --]
> What are you trying to do here?
>
> I am trying to see if i can build statically against libcryptsetup. I
doubt the distribution i am using will switch to cryptsetup 1.6 anytime
soon and some users will want truecrypt support. Some sort of a private
version of cryptsetup will be a solution.
the "libcryptsetup.a" library wasnt being produced here and i though the
problem was on your end.It looks like it was on this end and the problem is
now gone.Not sure what the problem was but i suspect it has to do gcrypt
dev package of the distribution not shipping with static libraries.Building
gcrypt from sources with static option seem to have solved the problem.
[-- Attachment #2: Type: text/html, Size: 1029 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] static libraries
2013-01-05 12:12 ` .. ink ..
@ 2013-01-05 17:56 ` Milan Broz
2013-01-05 22:15 ` .. ink ..
0 siblings, 1 reply; 8+ messages in thread
From: Milan Broz @ 2013-01-05 17:56 UTC (permalink / raw)
To: .. ink ..; +Cc: dm-crypt
On 01/05/2013 01:12 PM, .. ink .. wrote:
>
> What are you trying to do here?
>
> I am trying to see if i can build statically against libcryptsetup. I
> doubt the distribution i am using will switch to cryptsetup 1.6
> anytime soon and some users will want truecrypt support. Some sort of
> a private version of cryptsetup will be a solution.
Well, you can link statically that but I think it is not the best option.
First, I would like to see more recent updates in distros as well
(at least in Gentoo and Debian which I am using :)
But anyway, I think you should perhaps rebuild cryptsetup yourself
as private built package update and provide some private repository
on top of your distro.
Building things statically is very problematic. In reality it
can work on some hardened systems (but overhead costs for maintaining
is huge) but not for generic distro.
> the "libcryptsetup.a" library wasnt being produced here and i though
> the problem was on your end.
Well, the problem is that I have problem to decipher your bug reports ;-)
I know you are using library extensively, so I am more grumpy here
when I see report of some problem and I see it is just end
of the chain while the mail is missing original context and info.
Anyway, in general - I read all bug reports and trying to fix them ASAP,
but I need to know some basic information
- what is the original problem like "static libcryptsetup is not built"
- pkg version you are using (and if you know version which works, even better)
- exact error you get (there must be some error while building or configuring library)
- if it is failure of come CLI command, output with --debug
etc
(There is a template when using new issue on project page which should
ask for similar info.)
In this case perhaps configure script is not properly detecting
some missing static libraries.
> It looks like it was on this end and the problem is now gone.
Really? I found there was a problem with missing pkg-config macro in
autoconf, but not sure that caused your problem.
> Not sure what the problem was but i suspect it
> has to do gcrypt dev package of the distribution not shipping with
> static libraries.Building gcrypt from sources with static option seem
> to have solved the problem.
Building static version is generally problem today. It is usually security
disaster in the end (while you are updating some library, you have to also
rebuild all statically linked binaries.)
So many distros do not allow static builds at all today.
I am trying to support static build but it depends on many other static
libraries present in system and autoconf script has several hacks here
(recently libpwquality had wrong pkgconfig spec for static).
Usually maintainers fixes the problem quickly but it takes time until
this is propagated to distros...
IOW building statically is always a challenge. Sometimes even impossible.
Anyway, if you find some situation when configure script doesn't detect
some missing library, let me know (with proper info mentioned above).
Thanks,
Milan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] static libraries
2013-01-05 17:56 ` Milan Broz
@ 2013-01-05 22:15 ` .. ink ..
2013-01-05 22:48 ` .. ink ..
2013-01-06 10:21 ` Milan Broz
0 siblings, 2 replies; 8+ messages in thread
From: .. ink .. @ 2013-01-05 22:15 UTC (permalink / raw)
To: Milan Broz; +Cc: dm-crypt
[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]
> Anyway, if you find some situation when configure script doesn't detect
> some missing library, let me know (with proper info mentioned above).
>
>
i am using version 0.27.1 of pkg-config
http://pastebin.com/ASBk1X6K
Above is a pastebin of a build problem i encountered when trying to build
statically.
The development package of libgrypt does not ship with libgcrypt.a in the
distribution i am using and this necessitated me to build another version
of libgrcypt to have a static library and i installed it in "/home/local"
because thats where i install personal packages.
As you can see from the link,the build see my personal libraries( in
/home/local) as well as those in "/usr".I think it shouldnt see those in
/usr.It should see and use one or the other and not both.
The first time around,the build fail at line number 242,that happened
because i removed "/usr/lib/libgcrypt.a".
Adding the library back and the build failed again at line 281.
I solved the problem by overwriting the gcrypt libraries in /usr/ with my
local build but this is not good. I try not to overwrite packages managed
by my distribution but it look like i did not have a choice here.
Also,in line 173,the check will fail if "libgpg-error.a" is missing.This
may be important because a link btw gcrypt and gpg-error may not be obvious.
line 176 maybe a potential problem too.
[-- Attachment #2: Type: text/html, Size: 1883 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] static libraries
2013-01-05 22:15 ` .. ink ..
@ 2013-01-05 22:48 ` .. ink ..
2013-01-06 10:21 ` Milan Broz
1 sibling, 0 replies; 8+ messages in thread
From: .. ink .. @ 2013-01-05 22:48 UTC (permalink / raw)
To: Milan Broz; +Cc: dm-crypt
[-- Attachment #1: Type: text/plain, Size: 733 bytes --]
The first time around,the build fail at line number 242,that happened
> because i removed "/usr/lib/libgcrypt.a".
>
> Correcting the above line, the line should have read:
The first time around,the build fail at line number 242,that happened
because i removed " /usr/lib/libgpg-error.so"
Adding the library back and the build failed again at line 281.
>
>
I think the problem is that the config script does not check for
"libgpg-error.a" static library.
It may not be possible for me to recreate the original system conditions
that i use to generate the original bug report because i already replaced
distro provided with no static libraries of "libgcrypt" and "libgpg-error"
with my local versions that produce static libraries.
[-- Attachment #2: Type: text/html, Size: 1473 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] static libraries
2013-01-05 22:15 ` .. ink ..
2013-01-05 22:48 ` .. ink ..
@ 2013-01-06 10:21 ` Milan Broz
2013-01-06 10:50 ` .. ink ..
1 sibling, 1 reply; 8+ messages in thread
From: Milan Broz @ 2013-01-06 10:21 UTC (permalink / raw)
To: .. ink ..; +Cc: dm-crypt
On 01/05/2013 11:15 PM, .. ink .. wrote:
>
>
>
> Anyway, if you find some situation when configure script doesn't detect
> some missing library, let me know (with proper info mentioned above).
>
>
> i am using version 0.27.1 of pkg-config
>
> http://pastebin.com/ASBk1X6K
That's exactly error I need to see that something is wrong :)
./configure: line 16992: --static: command not found
(pkgconfig was not properly initialized in autoconf)
> The development package of libgrypt does not ship with libgcrypt.a in
> the distribution i am using and this necessitated me to build another
> version of libgrcypt to have a static library and i installed it in
> "/home/local" because thats where i install personal packages.
Gcrypt supports static libraries but not all distros use them.
The fun is here it uses own libgcrypt-config script which does not
have --static switch to properly detect libraries needed for
static compilation.
IOW see
libgcrypt-config --libs
(In fedora for example it reports -lgpg-error.)
But cryptsetup autoconf tries to handle that but I do not
want workaround for every broken gcrypt install...
As you can see here, it tries gpg-error library
LIBS="$saved_LIBS $LIBGCRYPT_LIBS -static"
AC_CHECK_LIB(gcrypt, gcry_check_version,,
AC_MSG_ERROR([Cannot find static gcrypt library.]),
[-lgpg-error])
So maybe the error message just should mention gpg-error as well.
Milan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] static libraries
2013-01-06 10:21 ` Milan Broz
@ 2013-01-06 10:50 ` .. ink ..
0 siblings, 0 replies; 8+ messages in thread
From: .. ink .. @ 2013-01-06 10:50 UTC (permalink / raw)
To: Milan Broz; +Cc: dm-crypt
[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]
> IOW see
> libgcrypt-config --libs
>
> (In fedora for example it reports -lgpg-error.)
>
>
below if a full list of all libgcrypt-config options in my system.
[ink@mtz ~]$ libgcrypt-config --prefix
/home/local
[ink@mtz ~]$ libgcrypt-config --exec-prefix
/home/local
[ink@mtz ~]$ libgcrypt-config --version
1.5.0
[ink@mtz ~]$ libgcrypt-config --api-version
1
[ink@mtz ~]$ libgcrypt-config --libs
-L/home/local/lib -lgcrypt -lgpg-error
[ink@mtz ~]$ libgcrypt-config --cflags
-I/home/local/include
[ink@mtz ~]$ libgcrypt-config --algorithms
Symmetric cipher algorithms: arcfour blowfish cast5 des aes twofish serpent
rfc2268 seed camellia
Public-key cipher algorithms: dsa elgamal rsa ecc
Message digest algorithms: crc md4 md5 rmd160 sha1 sha256 sha512 tiger
whirlpool
[ink@mtz ~]$ libgcrypt-config --host
i686-pc-linux-gnu
[ink@mtz ~]$
I think the problem is that the build process does not check for the
presence of gpg-error package.
It just assume it to be present and located at "/usr/lib" and as the output
show,the build process still fail even after i installed "libgpg-error.a"
and "libgpg-error.so" but not in "/usr".
I have not tested but i assume even the building dynamically process would
fail if "libgpg-error.so" is found in the path but is not located in
"/usr".As the output show,it ignored the version in "/home/local/lib" and
complain when it couldnt find the library in "/usr/lib"
[-- Attachment #2: Type: text/html, Size: 1986 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-01-06 10:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-05 9:05 [dm-crypt] static libraries .. ink ..
2013-01-05 11:05 ` Milan Broz
2013-01-05 12:12 ` .. ink ..
2013-01-05 17:56 ` Milan Broz
2013-01-05 22:15 ` .. ink ..
2013-01-05 22:48 ` .. ink ..
2013-01-06 10:21 ` Milan Broz
2013-01-06 10:50 ` .. ink ..
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.