Re: Missing fcrypt causes Lintian test failure

2019-12-08 Thread Felix Lechner
Hi Aurelien,

On Sun, Dec 8, 2019 at 3:08 PM Aurelien Jarno  wrote:
>
> Of course you might want to actually query both packages so that lintian
> also works for backports.

Thank you for your detailed guidance. The following worked great everywhere:


https://salsa.debian.org/lintian/lintian/commit/afb4535d51e1c22bbd19af19ac1e4a2d48debce5

Because libc6-dev depends on libcrypt1-dev in unstable, there was no
need to adjust the test's build prerequisites. Thank you for that too.

Kind regards
Felix Lechner



Re: Missing fcrypt causes Lintian test failure

2019-12-08 Thread Aurelien Jarno
Hi,

On 2019-12-07 13:42, Felix Lechner wrote:
> Hi,
> 
> Starting in `libc6 2.29-5`, the Lintian test
> `t/tags/checks/binaries/binaries-obsolete-des` fails in `unstable`:
> 
> cc -g -O2 
> -fdebug-prefix-map=/builds/lintian/lintian/debian/test-out/packages/tags/checks/binaries/binaries-obsolete-des/binaries-obsolete-des-1.0=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro
> -Wl,-z,now uses-fcrypt.o -o uses-fcrypt -lcrypt
> /usr/bin/ld: uses-fcrypt.o: in function `main':
> ./uses-fcrypt.c:19: undefined reference to `fcrypt'
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makefile:34: uses-fcrypt] Error 1

Sorry about breaking lintian with that change.

> Perhaps is it time to remove the test (and the tag
> `obsolete-des-encryption`). Was `fcrypt` dropped entirely, or is it
> still provided by `libcrypt`?

Yes, fcrypt is still provided by libcrypt, and like libc it is 
not available to newly linked binaries, just for old binaries. That's
why you need some tricks to link against it.

> I do not understand the impact of this commit:
> 
> 
> https://salsa.debian.org/glibc-team/glibc/commit/e1dc23943b0a5c9e0612f8e1364a37f12b6710ef
> 
> Here is the code that did not link:
> 
> /* This program uses the obsolete function 'fcrypt',
>which is an alias for 'crypt'.  */
> 
> #include 
> #include 
> 
> /* The prototype may already have been removed from crypt.h.  */
> extern char *fcrypt(const char *, const char *);
> 
> /* It may already not be possible to link new programs that use
>'fcrypt' without special magic.  */
> #ifdef SYMVER
> __asm__ (".symver fcrypt, fcrypt@" SYMVER);
> #endif
> 
> int
> main(void)
> {
> puts(fcrypt("password", "Dn"));
> return 0;
> }

The code itself works. However for that it needs to have SYMVER defined
to the correct version. This is done in the Makefile, and it assumes
that libcrypto.so is provided by libc6. The following patch makes the
code to link correctly:

--- t/tags/checks/binaries/binaries-obsolete-des/orig/Makefile.orig 
2019-12-08 23:05:20.520887001 +
+++ t/tags/checks/binaries/binaries-obsolete-des/orig/Makefile  2019-12-08 
23:05:11.092888400 +
@@ -5,7 +5,7 @@
 # around, but we have to know the exact "symbol version" associated with
 # the obsolete functions, which has to be dug out of libcrypt.so with nm.
 
-LIBCRYPT_FILE := $(shell dpkg -L libc6-dev | grep 'libcrypt\.so$$')
+LIBCRYPT_FILE := $(shell dpkg -L libcrypt1-dev | grep 'libcrypt\.so$$')
 SYMVER := $(shell nm --dynamic --with-symbol-versions $(LIBCRYPT_FILE) | \
 grep ' setkey@' | cut -d@ -f2)
 
Of course you might want to actually query both packages so that lintian
also works for backports.

Regards,
Aurelien

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net



Processed: glibc+libxcrypt breaks cross-toolchain-base

2019-12-08 Thread Debian Bug Tracking System
Processing control commands:

> affects -1 + src:cross-toolchain-base
Bug #946396 [src:glibc] glibc+libxcrypt breaks cross-toolchain-base
Added indication that 946396 affects src:cross-toolchain-base

-- 
946396: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946396
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#946396: glibc+libxcrypt breaks cross-toolchain-base

2019-12-08 Thread Helmut Grohne
Source: glibc
Version: 2.29-5
Severity: serious
Justification: installation failure
Control: affects -1 + src:cross-toolchain-base

Since glibc added dependencies on libxcrypt, building
cross-toolchain-base produces packages that are not installable:

| $ dpkg-deb -I libc6-dev-arm64-cross_2.29-5cross1_all.deb
|  new Debian package, version 2.0.
|  size 2261068 bytes: control archive=12892 bytes.
|  833 bytes,17 lines  control
|40350 bytes,   515 lines  md5sums
|  Package: libc6-dev-arm64-cross
|  Version: 2.29-5cross1
|  Section: libdevel
|  Priority: optional
|  Architecture: all
|  Maintainer: GNU Libc Maintainers 
|  Source: cross-toolchain-base (42)
|  Provides: libc-dev-arm64-cross, libc6-dev-arm64-dcv1
|  Depends: libc6-arm64-cross (= 2.29-5cross1), linux-libc-dev-arm64-cross, 
libcrypt1-dev-arm64-cross
|  Conflicts: libc0.1-dev-arm64-cross, libc0.3-dev-arm64-cross, 
libc6.1-dev-arm64-cross
|  Description: GNU C Library: Development Libraries and Header Files (for 
cross-compiling)
|   This package was generated by dpkg-cross for cross compiling.
|   .
|   Contains the symlinks, headers, and object files needed to compile
|   and link programs which use the standard C library.
|  Built-Using: binutils (= 2.33.1-5), linux (= 5.3.15-1), gcc-9 (= 9.2.1-21), 
glibc (= 2.29-5)
|  Multi-Arch: foreign
| $

However, there is no libcrypt1-dev-arm64-cross package produced by
anything in the archive. For this reason glibc/2.29-5 should not migrate
to testing until there is a solution to this problem.

Helmut