LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices


Reply
  Search this Thread
Old 03-19-2019, 12:00 AM   #1
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,734

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Compiling OpenSSL-1.1.1b on AIX


Let's try in the practice what is written here: http://lzsiga.users.sourceforge.net/aix-linking.html

Source: https://www.openssl.org/source/openssl-1.1.1b.tar.gz

Assumptions:

* AIX5.3 or newer, 64-bit
* gcc installed
* libgcc_s.a or libgcc_s.so copied/linked in /usr/local/lib64
* libz is installed
* perl is installed
* bash is installed into /usr/local/bin
* sed_repl is installed into /usr/local/bin

Goal:
create these files, with hardcoded dependencies:
Code:
/usr/local/bin/openssl
/usr/local/lib64/libcrypto.so -> libcrypto.so.1.1.1.b
/usr/local/lib64/libcrypto.so.1.1 -> libcrypto.so.1.1.1.b
/usr/local/lib64/libcrypto.so.1.1.1.b
/usr/local/lib64/libssl.so -> libssl.so.1.1.1.b
/usr/local/lib64/libssl.so.1.1 -> libssl.so.1.1.1.b
/usr/local/lib64/libssl.so.1.1.1.b
Should it succeed, using application should be linked with options -Wl,-bipath /usr/local/lib64/libssl.so.1.1 /usr/local/lib64/libcrypt.so.1.1:
Code:
$ dump -H -X64 $(which wget)
                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER              
0      /usr/lib                                                              
1      /usr/local/lib64              libcrypto.so.1.1                        
...
7      /usr/local/lib64              libssl.so.1.1

Last edited by NevemTeve; 03-19-2019 at 05:14 AM.
 
Old 03-19-2019, 05:37 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,734

Original Poster
Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
This scripts in not yet complete, but it is a start.
Code:
#!/usr/local/bin/bash

set -e
set -o pipefail

W1=1
W2=1
W3=1
W4=b

VTOTALF="$W1.$W2.$W3.$W4"       # Filename:        1.1.1.b
VTOTALC="$W1.$W2.$W3$W4"        # Compressed:      1.1.1b
VMAJOR="$W1.$W2"                # Major:           1.1
VMINOR="$W3.$W4"                # Minor:           1.b
VMINORC="$W3$W4"                # Compressed:      1b

export PATH=/usr/local/bin:/opt/freeware/bin:"$PATH"
export PKG_CONFIG_PATH=/usr/local/lib64/pkg-config"${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}"

cd "openssl-$VTOTALC"

make distclean || make clean || true

export CFLAGS='-maix64 -pthread'
export LDFLAGS='-maix64 -pthread -Wl,-bernotok,-brtl,-bnortllib,-blibpath:/usr/lib -L/usr/local/lib64'
export LDLIBS='-lz'

(./Configure \
 shared \
 zlib \
 no-zlib-dynamic \
 enable-ssl3 enable-ssl3-method \
 enable-weak-ssl-ciphers \
 --prefix=/usr/local \
 --libdir=lib64 \
 --openssldir=/usr/local/ssl \
 aix64-gcc &&

 perl configdata.pm --dump
) 2>&1 | tee >../log.configure

# for some reason '-blibpath:/usr/lib' became '-blibpath /usr/lib' in Makefile
# undo it
sed_repl 's/-blibpath /-blibpath:/' Makefile

# to link shared objects, option '-shared' seems to be better
sed_repl 's/DSO_LDFLAGS=-Wl,-G,-bsymbolic,-bexpall/DSO_LDFLAGS=-shared/' Makefile

make all 2>&1 | tee ../log.make.all

(
set -xv

gcc ${LDFLAGS} -shared -static-libgcc \
    -Wl,-bE:libcrypto.map \
    -o libcrypto.so."$VTOTALF" libcrypto_a.a ${LDLIBS}

ln -sf libcrypto.so."$VTOTALF" libcrypto.so."$VMAJOR"
ln -sf libcrypto.so."$VMAJOR"  libcrypto.so

gcc ${LDFLAGS} -shared -static-libgcc \
    -Wl,-bE:libssl.map \
    -o libssl.so."$VTOTALF" libssl_a.a libcrypto.so."$VMAJOR"

ln -sf libssl.so."$VTOTALF" libssl.so."$VMAJOR"
ln -sf libssl.so."$VMAJOR"  libssl.so

gcc ${LDFLAGS} -shared -static-libgcc \
    -o apps/openssl apps/*.o \
    libssl.so.$VMAJOR libcrypto.so.$VMAJOR ${LDLIBS}

for i in capi dasync ossltest padlock; do
    gcc ${LDFLAGS} -shared -static-libgcc \
        -o engines/$i.so.$VMAJOR engines/e_$i.o \
        libcrypto.so.$VMAJOR ${LDLIBS}
    ln -sf $i.so.$VMAJOR engines/$i.so
done

) &> ../log.localextra

Last edited by NevemTeve; 03-25-2019 at 04:20 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] new openssl 1.1.0 - broken compatibility with openssl 1.0.1 FranekW Linux - Newbie 2 06-26-2018 10:49 AM
Does recursive mutex lock in openssl will affect other openssl users in same system? T.Selvan Linux - Networking 3 02-09-2016 12:59 AM
openssl: any simple examples no how to use openssl to do some decryption? eantoranz Programming 7 07-26-2012 07:57 PM
install of openssl-0.9.8b-8.3.el5 conflicts with file from package openssl-0.9.8b-8.3 jsaravana87 Linux - Server 1 09-26-2011 01:02 PM
oops openssl-0.9.8e over openssl-0.9.8d bad install now 2 copies? rcorkum Slackware 4 06-29-2007 01:58 AM

LinuxQuestions.org > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 05:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration