noloader / Build-Scripts

Collection of build scripts useful when testing on downlevel, abandonware and ransomware clients

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

perl fails to build on Centos 5 32-bit

cswoodruff opened this issue · comments

In trying to update OpenSSL, perl will no longer build on Centos 5 32-bit. I'm seeing a dependency error for libdb-6.2.so.


Common flags and options:

  INSTX_BITNESS: 32-bits
   INSTX_PREFIX: /usr/local
   INSTX_LIBDIR: /usr/local/lib
    INSTX_RPATH: '$$ORIGIN/../lib'

PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
       CPPFLAGS: -I/usr/local/include -DNDEBUG
         CFLAGS: -g2 -O2 -fPIC -pthread
       CXXFLAGS: -g2 -O2 -fPIC -pthread
        LDFLAGS: -L/usr/local/lib -Wl,-R,'$$ORIGIN/../lib' -Wl,-R,/usr/local/lib -Wl,--enable-new-dtags
         LDLIBS: -ldl -lpthread

 WGET: /usr/local/bin/wget
 SH_CACERT_PATH: /usr/local/etc/pki
 SH_CACERT_FILE: /usr/local/etc/pki/cacert.pem

If you enter a sudo password, then it will be used for installation.
If you don't enter a password, then ensure INSTX_PREFIX is writable.
To avoid sudo and the password, just press ENTER and they won't be used.
Please enter password for sudo: 

********** Perl **********

--2020-01-27 14:13:19--  http://www.cpan.org/src/5.0/perl-5.28.2.tar.gz
Resolving www.cpan.org (www.cpan.org)... 151.101.26.217, 2a04:4e42:6::729
Connecting to www.cpan.org (www.cpan.org)|151.101.26.217|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17715666 (17M) [application/x-gzip]
Saving to: ‘perl-5.28.2.tar.gz’

2020-01-27 14:13:21 (6.82 MB/s) - ‘perl-5.28.2.tar.gz’ saved [17715666/17715666]

First let's make sure your kit is complete.  Checking...
Locating common programs...
Checking compatibility between /bin/echo and builtin echo (if any)...
Symbolic links are supported.
Checking how to test for symbolic links...
You can test for symbolic links with 'test -h'.
Checking for cross-compile
No targethost for running compiler tests against defined, running locally
Good, your tr supports [:lower:] and [:upper:] to convert case.
Using [:upper:] and [:lower:] to convert case.
aix_3         dragonfly       irix_5   		openbsd       sunos_4_1   
aix_4         dynixptx        irix_6_0   	opus          super-ux   
aix   	      dynix   	      irix_6_1   	os2   	      svr4   
altos486      epix   	      irix_6   		os390         svr5   
amigaos       esix4   	      isc_2   		os400         ti1500   
atheos        fps   	      isc   		posix-bc      ultrix_4   
aux_3         freebsd         linux-android   	qnx   	      umips   
bitrig        freemint        linux   		riscos        unicosmk   
bsdos         gnukfreebsd     lynxos   		sco_2_3_0     unicos   
catamount     gnuknetbsd      midnightbsd   	sco_2_3_1     unisysdynix   
convexos      gnu   	      mips   		sco_2_3_2     utekv   
cxux          greenhills      mirbsd   		sco_2_3_3     uwin   
cygwin        haiku   	      mpc   		sco_2_3_4     vos   
darwin        hpux   	      ncr_tower   	sco   
dcosx         i386   	      netbsd   		solaris_2   
dec_osf       interix         newsos4   	stellar   
dos_djgpp     irix_4          nonstopux   	sunos_4_0   
Which of these apply, if any? [linux]  
Operating system name? [linux]  
Operating system version? [2.6.18-398.el5]  
Installation prefix to use? (~name ok) [/usr/local]  
AFS does not seem to be running...
What installation prefix should I use for installing files? (~name ok)
[/usr/local]  
Getting the current patchlevel...
Build a threading Perl? [n]  
Build Perl for multiplicity? [n]  
Use which C compiler? [cc]  
Checking for GNU cc in disguise and/or its version number...
Now, how can we feed standard input to your C preprocessor...
Directories to use for library searches? [/usr/local/lib /usr/lib /lib]  
What is the file extension used for shared libraries? [so]  
Make shared library basenames unique? [n]  
Build Perl for SOCKS? [n]  
Try to use long doubles if available? [n]  
Checking for optional libraries...
What libraries to use?
[-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc]  
What optimizer/debugger flag should be used? [-O2]  
Any additional cc flags?
[-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include]  
Let me guess what the preprocessor flags are...
Any additional ld flags (NOT including libraries)?
[ -fstack-protector -L/usr/local/lib]  
Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program:

#include <stdio.h>
int main() { printf("Ok\n"); return(0); }

I used the command:

	cc -o try -O2 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib try.c -lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
	 ./try

and I got the following output:

./try: error while loading shared libraries: libdb-6.2.so: cannot open shared object file: No such file or directory
The program compiled OK, but exited with status 127.
You have a problem.  Shall I abort Configure [y]  
Ok.  Stopping Configure.
Failed to configure Perl

I was able to build an updated libdb from source. I built the db-6.2 from the following link.

http://download.oracle.com/berkeley-db/db-6.2.32.tar.gz

This was based on the information from beyond linux from scratch.

http://www.linuxfromscratch.org/blfs/view/8.1/server/db.html

wget http://download.oracle.com/berkeley-db/db-6.2.32.tar.gz
tar xzf db-6.2.32.tar.gz
cd db-6.2.32
./configure
make
sudo make install

I'm able to build perl with the build-perl.sh script if I revert the version of perl back to 5.10.1.

Thanks @cswoodruff,

The underlying problem is (1) OpenSSL needs too new a version of Perl, and (2) the circular dependencies of BerkleyDB, OpenSSL and Perl.

I think we have two or three options:

  • provide downlevel Perl that meets OpenSSL's requirements
  • build BerkleyDB without OpenSSL (this affects the Replication Manager)
  • bootstrap Perl with BerkleyDB without OpenSSL. The full recipe in for /usr/local would use the OpenSSL-enabled versions

Item (1), drop Perl version, is what you used. But I don't like the thought of using a version with security vulnerabilities.

Item (2), if it is true that BerkleyDB only needs OpenSSL for the Replication Manager, then the easiest path may be to disable SSL/TLS in BerkleyDB . This makes the most sense to me. I doubt someone is running a full-fledged database server with replication on Fedora 1, CentOS 5 or Ubuntu 4.

Item (3), bootstrapping Perl with BerkleyDB without OpenSSL will be a lot of work. We do it for Wget because we need to fetch packages. But Wget is a special case since there was no other way to fetch packages in 2020.

What do you think? Which option do you prefer?

I'll defer to you. I don't think I have the experience to make this call.

@cswoodruff,

Perl is being a mother fucker. It can't configure/build itself. See, for example, lib/auto/IO/Compress/Compress.a: No such file or directory on the Perl mailing list.

I think I can work around it by dropping back to OpenSSL 1.0.2 during bootstrap. But I don't know what to do when we start building real packages in /usr/local. I'm guessing Perl will shit all over itself again.

@cswoodruff,

Perl is completely fucked. Those devs do not test their shit.

Perl won't configure and build properly unless it being installed into a magic directory like /usr/local. We can forget about building it for a location like $HOME/bootstrap. To bootstrap Wget I had to go back to OpenSSL 1.0.2.

I was able to get Perl 5.30.1 and OpenSSL 1.1.1 installed, but they had to go into /usr/local because of Perl.

I've got things building back to CentOS 5. Fedora 1 and Ubuntu 4 are still giving me trouble.

centos5 $ lsb_release -a
LSB Version:	:core-4.0-amd64:core-4.0-ia32:core-4.0-noarch
Distributor ID:	CentOS
Description:	CentOS release 5.11 (Final)
Release:	5.11
Codename:	Final
centos5 $ git --version 
git version 2.25.0