Actions
Bug #5818
closedDebian-like OSes fail to build a bundled OpenSSL when running inside pbuilder
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:
Description
The reason is simple: on a 32-bit pbuilder environment running on a 64 bit machine, uname -m returns x86_64.
This is not an issue, as most programs just use the default architecture given by GCC.
However, OpenSSL's "config" script tries to be smart and autodetect the OS/arch, notably using uname:
# First get uname entries that we use below [ "$MACHINE" ] || MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown" [ "$RELEASE" ] || RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown" [ "$SYSTEM" ] || SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown" [ "$BUILD" ] || VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
Of course, config finishes like:
Configured for linux-x86_64.
And the build breaks as a 64 bit GCC is not here:
gcc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -fPIC -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -c -o cryptlib.o cryptlib.c In file included from /usr/include/features.h:378, from /usr/include/stdlib.h:25, from cryptlib.h:62, from cryptlib.c:117: /usr/include/gnu/stubs.h:9:27: error: gnu/stubs-64.h: No such file or directory make[1]: *** [cryptlib.o] Error 1
We need to ask explicitely for a 32 (linux-elf) or 64 bit (linux-x86_64) installation when building it.
The best approach I got on old deb-like OSes is to look at the arch of a "well-known" binary ( a shell, let's say, bash ? ) to decide, since nothing like "dpkg --get-architecture" is here on old OSes...
Actions