Bug#1014114: installation of crypt.h in the multiarch location breaks the GCC and LLVM multilib builds

2022-07-08 Thread Matthias Klose

On 30.06.22 14:21, Marco d'Itri wrote:

On Jun 30, Matthias Klose  wrote:


installation of crypt.h in the multiarch location breaks the GCC and LLVM
multilib builds.

For libsanitizer, crypt.h is needed to determine the size of a struct, the
library itself is not needed.  Moving it to the MA location makes it
unavailable for the non-multilib builds.

Unfortunately the changelog doesn't mention anything why it was moved.

So either it should be moved back to /usr/include, or we need multilib
builds for libxcrypt.

It was discussed in #1004102 (and is documented in the git commit),
where Helmut was positive that this would not cause any issues. Helmut?

(Why can't we retire multilib for good?)


because it's still needed, and we don't have the cross compilers as a 
replacement ready. As Helmut suggested, we need support for foreign dependencies 
and build dependencies.


Please can we revert this?

Matthias



Bug#1014114: installation of crypt.h in the multiarch location breaks the GCC and LLVM multilib builds

2022-07-05 Thread Helmut Grohne
Control: clone -1 -2
Control: retitle -2 bootstrap dependency cycle between gcc and libxcrypt: 
libsanitizer requires struct crypt_data from crypt.h
Control: tags -2 =
Control: severity -2 important
Control: reassign -2 src:libxcrypt,src:gcc-12
Control: user helm...@debian.org
Control: usertags -2 + rebootstrap

Hi,

On Mon, Jul 04, 2022 at 08:51:05PM +0200, Helmut Grohne wrote:
> A gcc build (cross compiler stage3 or native) requires a target
> architecture crypt.h. Trying to do without breaks libsanitizer (no
> multilib involved). Example from
> https://jenkins.debian.net/job/rebootstrap_ppc64_gcc12_nobiarch/5/consoleText
> 
> | /bin/bash ../libtool  --tag=CXX   --mode=compile 
> /tmp/buildd/gcc3/gcc-12-12.1.0/build/./gcc/xgcc -shared-libgcc 
> -B/tmp/buildd/gcc3/gcc-12-12.1.0/build/./gcc -nostdinc++ 
> -L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/src 
> -L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/src/.libs
>  
> -L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/libsupc++/.libs
>  -B/usr/powerpc64-linux-gnu/bin/ -B/usr/powerpc64-linux-gnu/lib/ -isystem 
> /usr/powerpc64-linux-gnu/include -isystem 
> /usr/powerpc64-linux-gnu/sys-include -isystem 
> /tmp/buildd/gcc3/gcc-12-12.1.0/build/sys-include-D_GNU_SOURCE -D_DEBUG 
> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  
> -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -I. 
> -I../../../../src/libsanitizer/sanitizer_common -I..  -I 
> ../../../../src/libsanitizer/include -I ../../../../src/libsanitizer -isystem 
> ../../../../src/libsanitizer/include/system  -Wall -W -Wno-unused-parameter 
> -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions 
> -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden 
> -Wno-variadic-macros -I../../libstdc++-v3/include 
> -I../../libstdc++-v3/include/powerpc64-linux-gnu 
> -I../../../../src/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++14  
> -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE -I 
> ../../../../src/libsanitizer/../libbacktrace -I ../libbacktrace -I 
> ../../../../src/libsanitizer/../include -include 
> ../../../../src/libsanitizer/libbacktrace/backtrace-rename.h -g -O2 
> -D_GNU_SOURCE -MT sanitizer_platform_limits_posix.lo -MD -MP -MF 
> .deps/sanitizer_platform_limits_posix.Tpo -c -o 
> sanitizer_platform_limits_posix.lo 
> ../../../../src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
> | libtool: compile:  /tmp/buildd/gcc3/gcc-12-12.1.0/build/./gcc/xgcc 
> -shared-libgcc -B/tmp/buildd/gcc3/gcc-12-12.1.0/build/./gcc -nostdinc++ 
> -L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/src 
> -L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/src/.libs
>  
> -L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/libsupc++/.libs
>  -B/usr/powerpc64-linux-gnu/bin/ -B/usr/powerpc64-linux-gnu/lib/ -isystem 
> /usr/powerpc64-linux-gnu/include -isystem 
> /usr/powerpc64-linux-gnu/sys-include -isystem 
> /tmp/buildd/gcc3/gcc-12-12.1.0/build/sys-include -D_GNU_SOURCE -D_DEBUG 
> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
> -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -I. 
> -I../../../../src/libsanitizer/sanitizer_common -I.. -I 
> ../../../../src/libsanitizer/include -I ../../../../src/libsanitizer -isystem 
> ../../../../src/libsanitizer/include/system -Wall -W -Wno-unused-parameter 
> -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions 
> -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden 
> -Wno-variadic-macros -I../../libstdc++-v3/include 
> -I../../libstdc++-v3/include/powerpc64-linux-gnu 
> -I../../../../src/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++14 
> -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE -I 
> ../../../../src/libsanitizer/../libbacktrace -I ../libbacktrace -I 
> ../../../../src/libsanitizer/../include -include 
> ../../../../src/libsanitizer/libbacktrace/backtrace-rename.h -g -O2 
> -D_GNU_SOURCE -MT sanitizer_platform_limits_posix.lo -MD -MP -MF 
> .deps/sanitizer_platform_limits_posix.Tpo -c 
> ../../../../src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
>   -fPIC -DPIC -o .libs/sanitizer_platform_limits_posix.o
> | 
> ../../../../src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:155:10:
>  fatal error: crypt.h: No such file or directory
> |   155 | #include 
> |   |  ^
> | compilation terminated.
> | make[6]: *** [Makefile:616: sanitizer_platform_limits_posix.lo] Error 1
> | make[6]: Leaving directory 
> '/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libsanitizer/sanitizer_common'
> | make[5]: *** [Makefile:533: all-recursive] Error 1
> | make[5]: Leaving directory 
> '/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libsanitizer'
> | make[4]: *** [Makefile:420: all] Error 2
> | make[4]: Leaving directory 
> 

Bug#1014114: installation of crypt.h in the multiarch location breaks the GCC and LLVM multilib builds

2022-07-04 Thread Helmut Grohne
Hi,

On Thu, Jun 30, 2022 at 05:15:32PM +0200, Helmut Grohne wrote:
> > > For libsanitizer, crypt.h is needed to determine the size of a struct, the
> > > library itself is not needed.  Moving it to the MA location makes it
> > > unavailable for the non-multilib builds.
> 
> Again, the lack of precision is not constructive. Linking to a failure
> would help a lot here.

I now understand that the libsanitizer aspect is separate to the
multilib aspect. Therefore, my proposed solution is a non-solution and
adding multilib packages is a non-solution as well. It is way worse and
completely messed up.

A gcc build (cross compiler stage3 or native) requires a target
architecture crypt.h. Trying to do without breaks libsanitizer (no
multilib involved). Example from
https://jenkins.debian.net/job/rebootstrap_ppc64_gcc12_nobiarch/5/consoleText

| /bin/bash ../libtool  --tag=CXX   --mode=compile 
/tmp/buildd/gcc3/gcc-12-12.1.0/build/./gcc/xgcc -shared-libgcc 
-B/tmp/buildd/gcc3/gcc-12-12.1.0/build/./gcc -nostdinc++ 
-L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/src 
-L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/src/.libs
 
-L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/libsupc++/.libs
 -B/usr/powerpc64-linux-gnu/bin/ -B/usr/powerpc64-linux-gnu/lib/ -isystem 
/usr/powerpc64-linux-gnu/include -isystem /usr/powerpc64-linux-gnu/sys-include 
-isystem /tmp/buildd/gcc3/gcc-12-12.1.0/build/sys-include-D_GNU_SOURCE 
-D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  
-DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -I. 
-I../../../../src/libsanitizer/sanitizer_common -I..  -I 
../../../../src/libsanitizer/include -I ../../../../src/libsanitizer -isystem 
../../../../src/libsanitizer/include/system  -Wall -W -Wno-unused-parameter 
-Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions 
-fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden 
-Wno-variadic-macros -I../../libstdc++-v3/include 
-I../../libstdc++-v3/include/powerpc64-linux-gnu 
-I../../../../src/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++14  
-DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE -I 
../../../../src/libsanitizer/../libbacktrace -I ../libbacktrace -I 
../../../../src/libsanitizer/../include -include 
../../../../src/libsanitizer/libbacktrace/backtrace-rename.h -g -O2 
-D_GNU_SOURCE -MT sanitizer_platform_limits_posix.lo -MD -MP -MF 
.deps/sanitizer_platform_limits_posix.Tpo -c -o 
sanitizer_platform_limits_posix.lo 
../../../../src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
| libtool: compile:  /tmp/buildd/gcc3/gcc-12-12.1.0/build/./gcc/xgcc 
-shared-libgcc -B/tmp/buildd/gcc3/gcc-12-12.1.0/build/./gcc -nostdinc++ 
-L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/src 
-L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/src/.libs
 
-L/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libstdc++-v3/libsupc++/.libs
 -B/usr/powerpc64-linux-gnu/bin/ -B/usr/powerpc64-linux-gnu/lib/ -isystem 
/usr/powerpc64-linux-gnu/include -isystem /usr/powerpc64-linux-gnu/sys-include 
-isystem /tmp/buildd/gcc3/gcc-12-12.1.0/build/sys-include -D_GNU_SOURCE 
-D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -I. 
-I../../../../src/libsanitizer/sanitizer_common -I.. -I 
../../../../src/libsanitizer/include -I ../../../../src/libsanitizer -isystem 
../../../../src/libsanitizer/include/system -Wall -W -Wno-unused-parameter 
-Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions 
-fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden 
-Wno-variadic-macros -I../../libstdc++-v3/include 
-I../../libstdc++-v3/include/powerpc64-linux-gnu 
-I../../../../src/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++14 
-DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE -I 
../../../../src/libsanitizer/../libbacktrace -I ../libbacktrace -I 
../../../../src/libsanitizer/../include -include 
../../../../src/libsanitizer/libbacktrace/backtrace-rename.h -g -O2 
-D_GNU_SOURCE -MT sanitizer_platform_limits_posix.lo -MD -MP -MF 
.deps/sanitizer_platform_limits_posix.Tpo -c 
../../../../src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
  -fPIC -DPIC -o .libs/sanitizer_platform_limits_posix.o
| 
../../../../src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:155:10:
 fatal error: crypt.h: No such file or directory
|   155 | #include 
|   |  ^
| compilation terminated.
| make[6]: *** [Makefile:616: sanitizer_platform_limits_posix.lo] Error 1
| make[6]: Leaving directory 
'/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libsanitizer/sanitizer_common'
| make[5]: *** [Makefile:533: all-recursive] Error 1
| make[5]: Leaving directory 
'/tmp/buildd/gcc3/gcc-12-12.1.0/build/powerpc64-linux-gnu/libsanitizer'
| make[4]: *** 

Bug#1014114: installation of crypt.h in the multiarch location breaks the GCC and LLVM multilib builds

2022-07-03 Thread Helmut Grohne
Hi Marco,

On Sun, Jul 03, 2022 at 02:37:27AM +0200, Marco d'Itri wrote:
> I do not want to add any more complexity than what is strictly required 
> to support musl, which is not even a real port.

I note that this complexity is not due to musl. It is due to libcrypt2
regardless of the architecture. It just happens that musl is the first
user of libcrypt2. If we later decide to transition existing
architectures to libcrypt2, they'll be fully hit by this in the very
same way. So keep in mind: If you move to libcrypt2 you have a choice of
breaking multilib or multiarch or adding multlib packages.

> If moving crypt.h to the multiarch path only when building with musl is 
> a solution then let's do that.

I'm attaching a patch for your convenience, but I'd prefer understanding
the actual problem before papering over it like this.

Helmut
diff --minimal -Nru libxcrypt-4.4.28/debian/changelog 
libxcrypt-4.4.28/debian/changelog
--- libxcrypt-4.4.28/debian/changelog   2022-06-30 00:45:46.0 +0200
+++ libxcrypt-4.4.28/debian/changelog   2022-07-03 08:23:18.0 +0200
@@ -1,3 +1,11 @@
+libxcrypt (1:4.4.28-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Ship crypt.h non-multiarch for obsolete-api builds to unbreak multilib.
+(Closes: #1014114)
+
+ -- Helmut Grohne   Sun, 03 Jul 2022 08:23:18 +0200
+
 libxcrypt (1:4.4.28-1) unstable; urgency=medium
 
   [ Helmut Grohne ]
diff --minimal -Nru libxcrypt-4.4.28/debian/rules libxcrypt-4.4.28/debian/rules
--- libxcrypt-4.4.28/debian/rules   2022-06-30 00:44:22.0 +0200
+++ libxcrypt-4.4.28/debian/rules   2022-07-03 08:23:16.0 +0200
@@ -31,12 +31,13 @@
 DS  := $(CURDIR)/debian/libxcrypt-source
 
 CONFFLAGS = --disable-werror --prefix=/usr \
-  --disable-xcrypt-compat-files --enable-obsolete-api=glibc \
-  --includedir=/usr/include/$(DEB_HOST_MULTIARCH)
-CONFFLAGS_deb  = $(CONFFLAGS) \
+  --disable-xcrypt-compat-files --enable-obsolete-api=glibc
+CONFFLAGS_deb1  = $(CONFFLAGS) \
   $(shell DEB_BUILD_MAINT_OPTIONS="hardening=+bindnow" \
 dpkg-buildflags --export=configure || true) \
   --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
+CONFFLAGS_deb2 = $(subst api=glibc,api=no,$(CONFFLAGS_deb1)) \
+  --includedir=/usr/include/$(DEB_HOST_MULTIARCH)
 CONFFLAGS_udeb = $(CONFFLAGS) \
   $(subst -O2,-Os -fomit-frame-pointer,$(shell 
DEB_BUILD_MAINT_OPTIONS="hardening=-all" \
 dpkg-buildflags --export=configure || true)) \
@@ -51,11 +52,11 @@
dh_clean debian/copyright
 
 build-deb1/config.status:
-   dh_auto_configure --builddir=build-deb1 -- $(CONFFLAGS_deb)
+   dh_auto_configure --builddir=build-deb1 -- $(CONFFLAGS_deb1)
sh debian/patch_libtool build-deb1
 
 build-deb2/config.status:
-   dh_auto_configure --builddir=build-deb2 -- $(subst 
api=glibc,api=no,$(CONFFLAGS_deb))
+   dh_auto_configure --builddir=build-deb2 -- $(CONFFLAGS_deb2)
 
 build-udeb/config.status:
dh_auto_configure --builddir=build-udeb -- $(CONFFLAGS_udeb)


Bug#1014114: installation of crypt.h in the multiarch location breaks the GCC and LLVM multilib builds

2022-07-02 Thread Marco d'Itri
On Jun 30, Helmut Grohne  wrote:

> Assuming that, we basically have the two options above:
>  * Move crypt.h back for all multilib architectures only.
>  * Add multilib packages.
> 
> Marco, do you have any preference here?
I do not want to add any more complexity than what is strictly required 
to support musl, which is not even a real port.
If moving crypt.h to the multiarch path only when building with musl is 
a solution then let's do that.

-- 
ciao,
Marco


signature.asc
Description: PGP signature


Bug#1014114: installation of crypt.h in the multiarch location breaks the GCC and LLVM multilib builds

2022-06-30 Thread Marco d'Itri
On Jun 30, Matthias Klose  wrote:

> installation of crypt.h in the multiarch location breaks the GCC and LLVM
> multilib builds.
> 
> For libsanitizer, crypt.h is needed to determine the size of a struct, the
> library itself is not needed.  Moving it to the MA location makes it
> unavailable for the non-multilib builds.
> 
> Unfortunately the changelog doesn't mention anything why it was moved.
> 
> So either it should be moved back to /usr/include, or we need multilib
> builds for libxcrypt.
It was discussed in #1004102 (and is documented in the git commit), 
where Helmut was positive that this would not cause any issues. Helmut?

(Why can't we retire multilib for good?)

-- 
ciao,
Marco


signature.asc
Description: PGP signature


Bug#1014114: installation of crypt.h in the multiarch location breaks the GCC and LLVM multilib builds

2022-06-30 Thread Matthias Klose

Package: libcrypt-dev
Version: 4.4.28-1
Severity: serious

installation of crypt.h in the multiarch location breaks the GCC and LLVM 
multilib builds.


For libsanitizer, crypt.h is needed to determine the size of a struct, the 
library itself is not needed.  Moving it to the MA location makes it unavailable 
for the non-multilib builds.


Unfortunately the changelog doesn't mention anything why it was moved.

So either it should be moved back to /usr/include, or we need multilib builds 
for libxcrypt.