Debian-like OSes fail to build a bundled OpenSSL when running inside pbuilder
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: *** [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...
Updated by Matthieu CERDA over 7 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Matthieu CERDA to Jonathan CLARKE
- % Done changed from 0 to 100
- Pull Request set to https://github.com/Normation/rudder-packages/pull/532
Updated by Vincent MEMBRÉ over 7 years ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 2.11.5, which was released today (16/12/14)
- Announcement 2.11
- Changelog 2.11
- Download information: https://www.rudder-project.org/site/get-rudder/downloads/