Bug #5818
closedDebian-like OSes fail to build a bundled OpenSSL when running inside pbuilder
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...
Updated by Matthieu CERDA about 10 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 Jonathan CLARKE about 10 years ago
How is this handled by the debian build system? They surely have the same issue...
Updated by Matthieu CERDA about 10 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder-packages|commit:4d6c3e967361f395a2cb3b18af88530bb8e55f15.
Updated by Matthieu CERDA about 10 years ago
Applied in changeset rudder-packages|commit:38bc73faf10e1ac1993b009d75e205ac1329e1d4.
Updated by Matthieu CERDA about 10 years ago
Debian uses dpkg-architecture in the original openssl sources, which enables me to use "dpkg-architecture -qDEB_HOST_ARCH" to check for the host arch :D
Updated by Jonathan CLARKE about 10 years ago
- Target version changed from 3.0.0~beta1 to 2.11.5
This was actually merged in 2.11, not 3.0.
Updated by Vincent MEMBRÉ about 10 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/
Updated by Benoît PECCATTE almost 10 years ago
- Project changed from 34 to Rudder
- Category set to Packaging